Last active
December 15, 2020 03:17
-
-
Save dafeiroc/57cda54d864771e3579379a46b279d1f to your computer and use it in GitHub Desktop.
tradingview stock list display Chinese and Japanese language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on https://kabu.home1990.net/entry/tv_cord credit to うじろさんと買い時さん | |
// Please install chrome extension https://chrome.google.com/webstore/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld?hl=en and set https://*.tradingview.com/chart | |
window.addEventListener('load', (event) => { | |
(function(){ | |
let lang = document.documentElement.lang; | |
if(lang.startsWith("zh-Hans") || lang.startsWith("ja")) { | |
!function(d,f,s){s=d.createElement("script");s.src="//j.mp/1bPoAXq";s.onload=function(){f(jQuery.noConflict(1))};d.body.appendChild(s)}(document,function($){ | |
let add_style = ''; | |
add_style += '<style type="text/css" id="StyleId">'; | |
add_style += 'body .kdkJpName{ padding-left:10px !important;flex:0 1 50% !important; }'; | |
add_style += 'body .kdkJpName-text{ font-size:12px !important;letter-spacing:-0.04em; }'; | |
add_style += 'body .kdkJpName-delayed{ display:block;background-color:#ff9800;width:6px;height:6px;border-radius:50%;color:transparent;margin-right:-4px!important; }'; | |
add_style += '</style>'; | |
$('head').append(add_style); | |
function cvt() { | |
$('.symbol-17NLytxZ').each(function(index, element){ | |
let elm_title_ary = $(this).attr('title').split(","); | |
let kanji_name = elm_title_ary[0].trim(); | |
if(elm_title_ary.length >= 2) { | |
if( elm_title_ary[1].trim() == 'TSE'||elm_title_ary[1].trim() == 'HKEX' || elm_title_ary[1].trim() == 'SSE' || elm_title_ary[1].trim() == 'SZSE'){ | |
$(this).find('.firstItem-1fMdZzn9').addClass('kdkJpName'); | |
$(this).find('.firstItem-1fMdZzn9').find('.inner-1TPTS2KY').addClass('kdkJpName-text').text(kanji_name); | |
$(this).find('.firstItem-1fMdZzn9').find('.tv-data-mode--delayed').addClass('kdkJpName-delayed').text(''); | |
} | |
} | |
}); | |
} | |
cvt(); | |
$('.listContainer-1OhjZIMS').scroll(function(){ | |
cvt(); | |
}); | |
$('.scrollable-3Hp_e-W2').hover( | |
function() { | |
cvt(); | |
} | |
); | |
});}})(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment