Changeset 11552
- Timestamp:
- 05/14/08 09:41:38 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userscripts/googlereaderfullfeed.user.js
r10423 r11552 6 6 // @description loading full entry on Google Reader 7 7 // @privilege false 8 // @version 0.1. 68 // @version 0.1.7 9 9 // ==/UserScript== 10 10 // based on: LDR Full Feed <http://d.hatena.ne.jp/toshi123> … … 300 300 icon = document.createElement('span'); 301 301 icon.title = description; 302 icon.innerHTML = '<img src="'+ICON+'">'; 302 icon.innerHTML = '<img src="'+ICON+'" style="cursor: pointer;">'; 303 icon.addEventListener('click', init, false); 303 304 w.addClass(icon, 'gm_fullfeed_checked'); 304 305 container.appendChild(document.createTextNode(' ')); … … 306 307 if (autoLoad) init(); 307 308 } 309 }; 310 311 FullFeed.registerSbmIcons = function() { 312 if (!WIDGET) return; 313 var container = getFirstElementByXPath('id("current-entry")//a[contains(concat(" ",normalize-space(@class)," ")," entry-title-link ")]').parentNode; 314 if (!container) return; 315 316 var c = new getCurrentItem(); 317 icon = document.createElement('span'); 318 icon.innerHTML = '' 319 + ' <img src="http://b.hatena.ne.jp/entry/image/' + c.item.link + '"/>' 320 + ' <img src="http://image.clip.livedoor.com/counter/' + c.item.link + '"/>' 321 container.appendChild(icon); 308 322 }; 309 323 … … 320 334 ]; 321 335 336 FullFeed.preFilters = [ 337 FullFeed.registerWidgets, 338 FullFeed.registerSbmIcons, 339 ]; 340 322 341 FullFeed.filters = []; 323 342 … … 326 345 window.FullFeed.addDocumentFilter = function(f) { 327 346 FullFeed.documentFilters.push(f); 347 }; 348 349 window.FullFeed.addPreFilter = function(f) { 350 FullFeed.preFilters.push(f); 328 351 }; 329 352 … … 445 468 var pattern; 446 469 var autoLoad = false; 470 var lastItem = null; 447 471 448 472 GM_registerMenuCommand('Google Reader Full Feed - reset cache', FullFeed.resetCache); … … 466 490 if (timer) clearTimeout(timer); 467 491 try { 468 var container = getFirstElementByXPath('id("current-entry")//a[contains(concat(" ",normalize-space(@class)," ")," entry-title-link ")]'); 469 var icon = getFirstElementByXPath('id("current-entry")//span[contains(concat(" ",normalize-space(@class)," ")," gm_fullfeed_checked ")]'); 470 if (container && !icon) { 471 FullFeed.registerWidgets(); 472 } 492 var currentItem = w.get_active_item(true); 493 if (!lastItem || lastItem.link != currentItem.link) { 494 lastItem = currentItem; 495 FullFeed.preFilters.forEach(function(filter) { 496 filter(currentItem); 497 }); 498 } 473 499 } catch (e) {} 474 500 timer = setTimeout(arguments.callee, 200);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)