Changeset 14329 for lang/javascript/userscripts/ldr_show_sbm_comments
- Timestamp:
- 06/21/08 12:43:26 (5 months ago)
- Files:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userscripts/ldr_show_sbm_comments/ldr_show_sbm_comments.user.js
r14328 r14329 3 3 // @namespace http://shinten.info/ 4 4 // @include http://reader.livedoor.com/reader/ 5 // @resource styles styles.css5 // @resource styles http://svn.coderepos.org/share/lang/javascript/userscripts/ldr_show_sbm_comments/styles.css 6 6 // @require http://svn.coderepos.org/share/lang/javascript/jsdeferred/trunk/jsdeferred.userscript.js 7 7 // ==/UserScript== … … 102 102 updateStat(); 103 103 w.LoadEffect.Stop(); 104 var c = []; 105 for (var s in o) c = c.concat(o[s]); 106 c = c.sort(function (a, b) { 104 105 var comments = merge(o).sort(function (a, b) { 107 106 return b.sort_key - a.sort_key; 108 }); 107 }).map(function (c) { return c.comment }).join('\n'); 108 109 109 var d = w.$N('div', { 110 110 id : 'sbm_' + item_id, 111 111 style : 'display: block;' 112 112 }); 113 d.innerHTML = c.map(function (cm) { return cm.comment }).join('\n'); 113 d.innerHTML = comments; 114 114 115 try { w.$('item_' + item_id).appendChild(d); } catch (e) {} 115 116 }).error(function (e) { … … 120 121 w.register_command('tc|togglecomment', function () { 121 122 w.toggleClass('right_body', 'nocomment'); 122 (w.contain(w.$('right_body').className, 'nocomment')) 123 ? w.message('Hide without comment') 124 : w.message('Show without comment'); 123 w.message( 124 ((w.contain(w.$('right_body').className, 'nocomment')) ? 'Hide' : 'Show') 125 + ' without comment' 126 ); 125 127 setTimeout(function () { 126 128 GM_setValue('hide', !eval(GM_getValue('hide'))); … … 135 137 } 136 138 139 function merge (obj) { 140 var tmp = []; 141 for (var key in obj) tmp = tmp.concat(obj[key]); 142 return tmp; 143 } 144 137 145 })();
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)