/* * @title bookmarklet * @description my bookmarklet * @include http://* * @license MIT License * @require */ function __show(idx) { var popup = document.getElementById('__commPopup_' + idx); if ( !popup ) return; if ( popup.style.display=='none' ) { popup.style.display=''; return; } popup.style.display='none'; } function __hide(idx) { var popup = document.getElementById('__commPopup_' + idx); if ( !popup ) return; popup.style.display='none'; } (function o() { var elms=document.getElementsByClassName('contents_text'); var length = elms.length; for(i = 0; i < length; ++i){ elm = elms[i]; if ( elm.getElementsByClassName('popupSrc')[0] ) continue; html = elm.innerHTML; var idx = html.search("#[0-9]{7}"); if ( idx < 0 ) continue; var comm_idx = html.substring(idx + 1, idx + 1 + 7); var targetspan = document.getElementById('comment_otherdetails_' + comm_idx ); var link_id = (i + "__" + comm_idx).trim(); var targethtml = targetspan.parentNode.parentNode.parentNode.getElementsByClassName('contents_text')[0].innerHTML; html = html.substring(0,idx) + '#' + comm_idx + '' + '
' + html.substring(idx + 8); elm.innerHTML = html; } })();