Changeset 36242
- Timestamp:
- 12/23/09 00:38:08 (3 years ago)
- Files:
-
- 1 modified
-
lang/javascript/userscripts/ldrize.user.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userscripts/ldrize.user.js
r36074 r36242 247 247 { name: 'current-link', 248 248 command: function(stdin){return self.getCurrentLink() || []}}, 249 { name: 'all-node', 250 command: function(stdin){ 251 return self.getParagraphes().list.map(function(i){return i.node;});}}, 249 252 { name: 'clear-pin', 250 253 command: function(stdin){if(!!stdin) self.clearPinlist(); return stdin}}, … … 476 479 setPin: function(nodes){ 477 480 var self = this; 478 this.togglePin(nodes, function(node){ self.addPinToPinList(node)});481 this.togglePin(nodes, function(node){return self.addPinToPinList(node);}); 479 482 }, 480 483 unsetPin: function(nodes){ 481 484 var self = this; 482 this.togglePin(nodes, function(node){ self.removePinFromPinList(node)});485 this.togglePin(nodes, function(node){return self.removePinFromPinList(node);}); 483 486 }, 484 487 togglePin: function(nodes, fn){ … … 486 489 if(typeof fn == 'undefined'){ 487 490 fn = function(node){ 488 self.removePinFromPinList(node) || self.addPinToPinList(node);491 return self.removePinFromPinList(node) || self.addPinToPinList(node); 489 492 } 490 493 } 491 494 toArray(nodes).forEach(function(node){ 492 fn(node); 493 self.toggleClassForPin(node); 495 if ( fn(node) ) { 496 self.toggleClassForPin(node); 497 } 494 498 }); 495 499 var a = this.html.pinlist_number; … … 542 546 xpath = '(descendant-or-self::img | descendant::text()[normalize-space(self::text()) != ""])'; 543 547 matches = $X(xpath, node); 544 if(!matches.length) return ;548 if(!matches.length) return false; 545 549 var height = new Paragraph(matches[0]).y; 546 550 res = []; … … 568 572 } 569 573 this.html.pinlist_container.appendChild(paragraph.html); 574 return true; 570 575 }, 571 576 removePinFromPinList: function(node){ 572 577 var para = this.getParagraphes().find(function(para){return node == para.node}); 573 578 var view = para.html; 574 if(!view) return ;579 if(!view) return false; 575 580 var children = toArray(this.html.pinlist_container.childNodes); 576 581 var html = children.find(function(arg){return arg == view}); 577 if(!html) return ;582 if(!html) return false; 578 583 this.html.pinlist_container.removeChild(html); 579 584 return true;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)