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

Delta Between Two Patch Sets: lib/main.js

Issue 8402021: Crawler frontend (Closed)
Left Patch Set: Created Sept. 21, 2012, 1:16 p.m.
Right Patch Set: Created Sept. 26, 2012, 8:25 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « lib/crawler.js ('k') | lib/storage.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 Cu.import("resource://gre/modules/Services.jsm"); 7 Cu.import("resource://gre/modules/Services.jsm");
8 8
9 let {Prefs} = require("prefs");
Wladimir Palant 2012/09/21 15:36:18 You aren't using prefs so you should remove that l
10 let {WindowObserver} = require("windowObserver"); 9 let {WindowObserver} = require("windowObserver");
11 10
12 let knownWindowTypes = 11 let knownWindowTypes =
13 { 12 {
14 "navigator:browser": true, 13 "navigator:browser": true,
15 "mail:3pane": true,
16 "mail:messageWindow": true,
Wladimir Palant 2012/09/21 15:36:18 I think that you only know navigator:browser - mea
17 __proto__: null 14 __proto__: null
18 }; 15 };
19 16
20 new WindowObserver({ 17 new WindowObserver({
21 applyToWindow: function(window) 18 applyToWindow: function(window)
22 { 19 {
23 let type = window.document.documentElement.getAttribute("windowtype"); 20 let type = window.document.documentElement.getAttribute("windowtype");
24 if (!(type in knownWindowTypes)) 21 if (!(type in knownWindowTypes))
25 return; 22 return;
26 23
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 { 83 {
87 if (!("@adblockplus.org/abp/public;1" in Cc)) 84 if (!("@adblockplus.org/abp/public;1" in Cc))
88 return; 85 return;
89 86
90 let crawlerWnd = Services.wm.getMostRecentWindow("abpcrawler:crawl"); 87 let crawlerWnd = Services.wm.getMostRecentWindow("abpcrawler:crawl");
91 if (crawlerWnd) 88 if (crawlerWnd)
92 crawlerWnd.focus(); 89 crawlerWnd.focus();
93 else 90 else
94 event.target.ownerDocument.defaultView.openDialog("chrome://abpcrawler/conte nt/crawler.xul", "_blank", "chrome,centerscreen,resizable,dialog=no"); 91 event.target.ownerDocument.defaultView.openDialog("chrome://abpcrawler/conte nt/crawler.xul", "_blank", "chrome,centerscreen,resizable,dialog=no");
95 } 92 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld