Show
Ignore:
Timestamp:
06/28/08 22:11:39 (5 months ago)
Author:
kga
Message:

j/k で移動して読み易いようにした。

Location:
lang/javascript/userscripts/ldr_show_sbm_comments
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/userscripts/ldr_show_sbm_comments/ldr_show_sbm_comments.user.js

    r14433 r14782  
    1414    var w = (typeof unsafeWindow == 'undefined') ? window : unsafeWindow; 
    1515 
    16     if (eval(GM_getValue('hide'))) w.addClass('right_body', 'nocomment'); 
     16    if (GM_getValue('hide', false)) w.addClass('right_body', 'nocomment'); 
    1717 
    1818    w.Keybind.add('n', function () { 
     
    2222        var item_link = item.link; 
    2323        var item_id   = item.id; 
    24         var url       = encodeURIComponent(item_link.replace(/%23/g, '#')); 
     24        var url       = encodeURIComponent(unescapeHTML(item_link)); 
    2525        var elem      = w.$('sbm_' + item_id); 
    2626 
     
    105105            var d = w.$N('div', { 
    106106                id    : 'sbm_' + item_id, 
    107                 style : 'display: block;' 
     107                style : 'display: block;', 
     108                class : 'sbm_comments' 
    108109            }); 
    109             d.innerHTML = comments; 
     110            d.innerHTML = '<h2 class="flat_menu sbm_comment">SBM Comments</h2>' + comments; 
    110111 
    111112            try { w.$('item_' + item_id).appendChild(d); } catch (e) {} 
     
    122123        ); 
    123124        setTimeout(function () { 
    124             GM_setValue('hide', !eval(GM_getValue('hide'))); 
     125            GM_setValue('hide', !GM_getValue('hide', false)); 
    125126        }, 0); 
    126127    }); 
     
    133134} 
    134135 
     136function unescapeHTML (str) { 
     137    return str.replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/%23/g, '#'); 
     138} 
     139 
    135140function merge (obj) { 
    136141    var tmp = []; 
  • lang/javascript/userscripts/ldr_show_sbm_comments/styles.css

    r14328 r14782  
    2626    color: #AAA; 
    2727} 
     28.sbm_comments h2 { 
     29    color: #AAA; 
     30    background-color: #EEE; 
     31    text-align: right; 
     32    font-weight: normal; 
     33} 
    2834.nocomment .without_comment { 
    2935    display: none;