Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/aardvark.js

Issue 29323107: Issue 2816 - Restore Preview functionality (Closed)
Patch Set: Fixed nit and shutdown failures Created July 31, 2015, 2:36 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This Source Code is subject to the terms of the Mozilla Public License 2 * This Source Code is subject to the terms of the Mozilla Public License
3 * version 2.0 (the "License"). You can obtain a copy of the License at 3 * version 2.0 (the "License"). You can obtain a copy of the License at
4 * http://mozilla.org/MPL/2.0/. 4 * http://mozilla.org/MPL/2.0/.
5 */ 5 */
6 6
7 let {Prefs} = require("prefs"); 7 let {Prefs} = require("prefs");
8 8
9 // Make sure to stop selection when we are uninstalled 9 // Make sure to stop selection when we are uninstalled
10 onShutdown.add(() => Aardvark.quit()); 10 onShutdown.add(() => Aardvark.quit());
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 select: function(elem) 570 select: function(elem)
571 { 571 {
572 if (!elem) 572 if (!elem)
573 return false; 573 return false;
574 574
575 this.browser.selectedBrowser.messageManager.sendAsyncMessage( 575 this.browser.selectedBrowser.messageManager.sendAsyncMessage(
576 "ElemHideHelper:GetNodeInfo", 576 "ElemHideHelper:GetNodeInfo",
577 null, 577 null,
578 { 578 {
579 element: elem, 579 element: elem,
580 callback: (nodeData, host) => 580 callback: (response) =>
581 { 581 {
582 response = JSON.parse(response);
583 if (!response.nodeData)
584 return;
585
582 this.window.openDialog("chrome://elemhidehelper/content/composer.xul", 586 this.window.openDialog("chrome://elemhidehelper/content/composer.xul",
583 "_blank", "chrome,centerscreen,resizable,dialog=no", nodeData, 587 "_blank", "chrome,centerscreen,resizable,dialog=no", response);
584 host);
585 this.quit(); 588 this.quit();
586 } 589 }
587 } 590 }
588 ); 591 );
589 return false; 592 return false;
590 }, 593 },
591 594
592 blinkElement: function(elem) 595 blinkElement: function(elem)
593 { 596 {
594 if (!elem) 597 if (!elem)
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 // Show help box 761 // Show help box
759 helpBox.showPopup(this.browser, -1, -1, "tooltip", "topleft", "topleft"); 762 helpBox.showPopup(this.browser, -1, -1, "tooltip", "topleft", "topleft");
760 return true; 763 return true;
761 } 764 }
762 } 765 }
763 766
764 // Makes sure event handlers like Aardvark.onKeyPress always have the correct 767 // Makes sure event handlers like Aardvark.onKeyPress always have the correct
765 // this pointer set. 768 // this pointer set.
766 for (let method of ["onMouseClick", "onMouseScroll", "onKeyPress", "onPageHide", "onMouseMove", "onAfterPaint", "quit"]) 769 for (let method of ["onMouseClick", "onMouseScroll", "onKeyPress", "onPageHide", "onMouseMove", "onAfterPaint", "quit"])
767 Aardvark[method] = Aardvark[method].bind(Aardvark); 770 Aardvark[method] = Aardvark[method].bind(Aardvark);
OLDNEW

Powered by Google App Engine
This is Rietveld