LEFT | RIGHT |
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 /** | 7 /** |
8 * Initialization function, called when the window is loaded. | 8 * Initialization function, called when the window is loaded. |
9 */ | 9 */ |
10 function init() | 10 function init() |
11 { | 11 { |
12 if (window.arguments && window.arguments.length) | 12 if (window.arguments && window.arguments.length) |
13 { | 13 { |
14 let filter = window.arguments[0].wrappedJSObject; | 14 let filter = window.arguments[0].wrappedJSObject; |
15 if (filter instanceof Filter) | 15 if (filter instanceof Filter) |
16 Utils.runAsync(SubscriptionActions.selectFilter, SubscriptionActions, filt
er); | 16 Utils.runAsync(SubscriptionActions.selectFilter, SubscriptionActions, filt
er); |
17 } | 17 } |
18 | |
19 TypoActions.init(); | |
20 } | 18 } |
21 | 19 |
22 /** | 20 /** |
23 * Called whenever the currently selected tab changes. | 21 * Called whenever the currently selected tab changes. |
24 */ | 22 */ |
25 function onTabChange(/**Element*/ tabbox) | 23 function onTabChange(/**Element*/ tabbox) |
26 { | 24 { |
27 updateSelectedSubscription(); | 25 updateSelectedSubscription(); |
28 | 26 |
29 Utils.runAsync(function() | 27 Utils.runAsync(function() |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 */ | 77 */ |
80 function updateSelectedSubscription() | 78 function updateSelectedSubscription() |
81 { | 79 { |
82 let panel = E("tabs").selectedPanel; | 80 let panel = E("tabs").selectedPanel; |
83 if (!panel) | 81 if (!panel) |
84 return; | 82 return; |
85 | 83 |
86 let list = panel.getElementsByTagName("richlistbox")[0]; | 84 let list = panel.getElementsByTagName("richlistbox")[0]; |
87 if (!list) | 85 if (!list) |
88 { | 86 { |
89 E("filtersContainer").style.visibility = "hidden"; | 87 E("filtersContainer").hidden = true; |
90 return; | 88 return; |
91 } | 89 } |
92 | 90 |
93 E("filtersContainer").style.visibility = "visible"; | 91 E("filtersContainer").hidden = false; |
94 | 92 |
95 let data = Templater.getDataForNode(list.selectedItem); | 93 let data = Templater.getDataForNode(list.selectedItem); |
96 FilterView.subscription = (data ? data.subscription : null); | 94 FilterView.subscription = (data ? data.subscription : null); |
97 FilterActions.updateCommands(); | 95 FilterActions.updateCommands(); |
98 } | 96 } |
99 | 97 |
100 /** | 98 /** |
101 * Template processing functions. | 99 * Template processing functions. |
102 * @class | 100 * @class |
103 */ | 101 */ |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 * data object. | 206 * data object. |
209 */ | 207 */ |
210 getNodeForData: function(/**Node*/ parent, /**String*/ property, /**Object*/ d
ata) /**Node*/ | 208 getNodeForData: function(/**Node*/ parent, /**String*/ property, /**Object*/ d
ata) /**Node*/ |
211 { | 209 { |
212 for (let child = parent.firstChild; child; child = child.nextSibling) | 210 for (let child = parent.firstChild; child; child = child.nextSibling) |
213 if ("_data" in child && property in child._data && child._data[property] =
= data) | 211 if ("_data" in child && property in child._data && child._data[property] =
= data) |
214 return child; | 212 return child; |
215 return null; | 213 return null; |
216 } | 214 } |
217 }; | 215 }; |
LEFT | RIGHT |