1 var webdeveloper_optionsDataBoolean
= new Array();
2 var webdeveloper_optionsDataInteger
= new Array();
3 var webdeveloper_optionsDataString
= new Array();
4 var webdeveloper_resizeDescription
= null;
5 var webdeveloper_resizeHeight
= null;
6 var webdeveloper_resizeViewport
= false;
7 var webdeveloper_resizeWidth
= null;
8 var webdeveloper_toolBookmarklet
= null;
9 var webdeveloper_toolDescription
= null;
10 var webdeveloper_toolKey
= null;
11 var webdeveloper_toolPath
= null;
12 var webdeveloper_toolURL
= null;
13 var webdeveloper_viewSourceWithDescription
= null;
14 var webdeveloper_viewSourceWithKey
= null;
15 var webdeveloper_viewSourceWithPath
= null;
17 // Adds a resize option
18 function webdeveloper_addResize()
20 window
.openDialog("chrome://webdeveloper/content/options/dialogs/resize.xul", "webdeveloper-resize-dialog", "centerscreen,chrome,modal", "add");
22 // If the description, height and width are set
23 if(webdeveloper_resizeDescription
&& webdeveloper_resizeHeight
&& webdeveloper_resizeWidth
)
25 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
26 var listCell
= pageDocument
.createElement("listcell");
27 var listItem
= pageDocument
.createElement("listitem");
28 var resizeBox
= pageDocument
.getElementById("webdeveloper-listbox");
29 var stringBundle
= document
.getElementById("webdeveloper-string-bundle");
31 listCell
.setAttribute("label", webdeveloper_resizeDescription
);
32 listItem
.appendChild(listCell
);
34 listCell
= pageDocument
.createElement("listcell");
35 listCell
.setAttribute("label", webdeveloper_resizeWidth
);
36 listItem
.appendChild(listCell
);
38 listCell
= pageDocument
.createElement("listcell");
39 listCell
.setAttribute("label", webdeveloper_resizeHeight
);
40 listItem
.appendChild(listCell
);
42 listCell
= pageDocument
.createElement("listcell");
44 // If resizing the viewport
45 if(webdeveloper_resizeViewport
)
47 listCell
.setAttribute("label", stringBundle
.getString("webdeveloper_yes"));
51 listCell
.setAttribute("label", stringBundle
.getString("webdeveloper_no"));
54 listItem
.appendChild(listCell
);
56 resizeBox
.selectItem(resizeBox
.appendChild(listItem
));
57 resizeBox
.ensureElementIsVisible(resizeBox
.selectedItem
);
62 function webdeveloper_addTool()
64 window
.openDialog("chrome://webdeveloper/content/options/dialogs/tool.xul", "webdeveloper-tool-dialog", "centerscreen,chrome,modal", "add");
66 // If the description and the bookmarklet, path or URL are set
67 if(webdeveloper_toolDescription
&& (webdeveloper_toolBookmarklet
|| webdeveloper_toolPath
|| webdeveloper_toolURL
))
69 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
70 var listCell
= pageDocument
.createElement("listcell");
71 var listItem
= pageDocument
.createElement("listitem");
72 var stringBundle
= document
.getElementById("webdeveloper-string-bundle");
73 var toolBox
= pageDocument
.getElementById("webdeveloper-listbox");
75 listCell
.setAttribute("label", webdeveloper_toolDescription
);
77 // If the bookmarklet is set
78 if(webdeveloper_toolBookmarklet
)
80 listCell
.setAttribute("type", stringBundle
.getString("webdeveloper_bookmarklet"));
82 else if(webdeveloper_toolPath
)
84 listCell
.setAttribute("type", stringBundle
.getString("webdeveloper_application"));
88 listCell
.setAttribute("type", stringBundle
.getString("webdeveloper_url"));
91 listItem
.appendChild(listCell
);
93 listCell
= pageDocument
.createElement("listcell");
95 // If the bookmarklet is set
96 if(webdeveloper_toolBookmarklet
)
98 listCell
.setAttribute("label", webdeveloper_toolBookmarklet
);
100 else if(webdeveloper_toolPath
)
102 listCell
.setAttribute("label", webdeveloper_toolPath
);
106 listCell
.setAttribute("label", webdeveloper_toolURL
);
109 listCell
.setAttribute("crop", "end");
110 listItem
.appendChild(listCell
);
112 listCell
= pageDocument
.createElement("listcell");
115 if(webdeveloper_toolKey
)
117 listCell
.setAttribute("label", webdeveloper_toolKey
);
120 listItem
.appendChild(listCell
);
122 toolBox
.selectItem(toolBox
.appendChild(listItem
));
123 toolBox
.ensureElementIsVisible(toolBox
.selectedItem
);
127 // Adds a view source with option
128 function webdeveloper_addViewSourceWith()
130 window
.openDialog("chrome://webdeveloper/content/options/dialogs/view_source_with.xul", "webdeveloper-view-source-with-dialog", "centerscreen,chrome,modal", "add");
132 // If the description and path are set
133 if(webdeveloper_viewSourceWithDescription
&& webdeveloper_viewSourceWithPath
)
135 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
136 var listCell
= pageDocument
.createElement("listcell");
137 var listItem
= pageDocument
.createElement("listitem");
138 var stringBundle
= document
.getElementById("webdeveloper-string-bundle");
139 var viewSourceWithBox
= pageDocument
.getElementById("webdeveloper-listbox");
141 listCell
.setAttribute("label", webdeveloper_viewSourceWithDescription
);
142 listItem
.appendChild(listCell
);
144 listCell
= pageDocument
.createElement("listcell");
145 listCell
.setAttribute("label", webdeveloper_viewSourceWithPath
);
146 listCell
.setAttribute("crop", "end");
147 listItem
.appendChild(listCell
);
149 listCell
= pageDocument
.createElement("listcell");
152 if(webdeveloper_viewSourceWithKey
)
154 listCell
.setAttribute("label", webdeveloper_viewSourceWithKey
);
157 listItem
.appendChild(listCell
);
159 viewSourceWithBox
.selectItem(viewSourceWithBox
.appendChild(listItem
));
160 viewSourceWithBox
.ensureElementIsVisible(viewSourceWithBox
.selectedItem
);
164 // Handles changing the options page
165 function webdeveloper_changePage(pageList
)
167 webdeveloper_storeOptions();
168 webdeveloper_setIntegerPreference("webdeveloper.options.last.page", pageList
.selectedIndex
);
170 document
.getElementById("webdeveloper-options-iframe").setAttribute("src", pageList
.selectedItem
.value
);
173 // Deletes a resize option
174 function webdeveloper_deleteResize()
176 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
177 var resizeBox
= pageDocument
.getElementById("webdeveloper-listbox");
178 var selectedItem
= resizeBox
.selectedItem
;
180 // If an item is selected and the deletion is confirmed
181 if(selectedItem
&& webdeveloper_deleteConfirmation(document
.getElementById("webdeveloper-string-bundle").getString("webdeveloper_resizeDeleteConfirmation")))
183 resizeBox
.removeChild(selectedItem
);
188 function webdeveloper_deleteTool()
190 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
191 var toolBox
= pageDocument
.getElementById("webdeveloper-listbox");
192 var selectedItem
= toolBox
.selectedItem
;
194 // If an item is selected and it is a separator or the deletion is confirmed
195 if(selectedItem
&& (selectedItem
.childNodes
[0].tagName
== "separator" || webdeveloper_deleteConfirmation(document
.getElementById("webdeveloper-string-bundle").getString("webdeveloper_toolDeleteConfirmation"))))
197 toolBox
.removeChild(selectedItem
);
202 function webdeveloper_deleteViewSourceWith()
204 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
205 var viewSourceWithBox
= pageDocument
.getElementById("webdeveloper-listbox");
206 var selectedItem
= viewSourceWithBox
.selectedItem
;
208 // If an item is selected and the deletion is confirmed
209 if(selectedItem
&& webdeveloper_deleteConfirmation(document
.getElementById("webdeveloper-string-bundle").getString("webdeveloper_viewSourceWithDeleteConfirmation")))
211 viewSourceWithBox
.removeChild(selectedItem
);
215 // Edits a resize option
216 function webdeveloper_editResize()
218 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
219 var resizeBox
= pageDocument
.getElementById("webdeveloper-listbox");
220 var selectedItem
= resizeBox
.selectedItem
;
222 // If an option is selected
225 var stringBundle
= document
.getElementById("webdeveloper-string-bundle");
226 var viewportValue
= false;
228 // If the viewport value is set to yes
229 if(selectedItem
.childNodes
[3].getAttribute("label") == stringBundle
.getString("webdeveloper_yes"))
231 viewportValue
= true;
234 window
.openDialog("chrome://webdeveloper/content/options/dialogs/resize.xul", "webdeveloper-resize-dialog", "centerscreen,chrome,modal", "edit", selectedItem
.childNodes
[0].getAttribute("label"), selectedItem
.childNodes
[1].getAttribute("label"), selectedItem
.childNodes
[2].getAttribute("label"), viewportValue
);
236 // If the description, height and width are set
237 if(webdeveloper_resizeDescription
&& webdeveloper_resizeHeight
&& webdeveloper_resizeWidth
)
239 var listCell
= pageDocument
.createElement("listcell");
241 webdeveloper_removeAllChildElements(selectedItem
);
243 listCell
.setAttribute("label", webdeveloper_resizeDescription
);
244 selectedItem
.appendChild(listCell
);
246 listCell
= pageDocument
.createElement("listcell");
247 listCell
.setAttribute("label", webdeveloper_resizeWidth
);
248 selectedItem
.appendChild(listCell
);
250 listCell
= pageDocument
.createElement("listcell");
251 listCell
.setAttribute("label", webdeveloper_resizeHeight
);
252 selectedItem
.appendChild(listCell
);
254 listCell
= pageDocument
.createElement("listcell");
256 // If resizing the viewport
257 if(webdeveloper_resizeViewport
)
259 listCell
.setAttribute("label", stringBundle
.getString("webdeveloper_yes"));
263 listCell
.setAttribute("label", stringBundle
.getString("webdeveloper_no"));
266 selectedItem
.appendChild(listCell
);
267 resizeBox
.ensureElementIsVisible(selectedItem
);
273 function webdeveloper_editTool()
275 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
276 var toolBox
= pageDocument
.getElementById("webdeveloper-listbox");
277 var selectedItem
= toolBox
.selectedItem
;
279 // If an option is selected
282 var selectedCell
= selectedItem
.childNodes
[0];
284 // If this is not a separator
285 if(selectedCell
.tagName
!= "separator")
287 window
.openDialog("chrome://webdeveloper/content/options/dialogs/tool.xul", "webdeveloper-tool-dialog", "centerscreen,chrome,modal", "edit", selectedCell
.getAttribute("label"), selectedItem
.childNodes
[2].getAttribute("label"), selectedItem
.childNodes
[1].getAttribute("label"), selectedCell
.getAttribute("type"));
289 // If the description and the bookmarklet, path or URL are set
290 if(webdeveloper_toolDescription
&& (webdeveloper_toolBookmarklet
|| webdeveloper_toolPath
|| webdeveloper_toolURL
))
292 var listCell
= pageDocument
.createElement("listcell");
293 var stringBundle
= document
.getElementById("webdeveloper-string-bundle");
295 webdeveloper_removeAllChildElements(selectedItem
);
297 listCell
.setAttribute("label", webdeveloper_toolDescription
);
299 // If the bookmarklet is set
300 if(webdeveloper_toolBookmarklet
)
302 listCell
.setAttribute("type", stringBundle
.getString("webdeveloper_bookmarklet"));
304 else if(webdeveloper_toolPath
)
306 listCell
.setAttribute("type", stringBundle
.getString("webdeveloper_application"));
310 listCell
.setAttribute("type", stringBundle
.getString("webdeveloper_url"));
313 selectedItem
.appendChild(listCell
);
315 listCell
= pageDocument
.createElement("listcell");
317 // If the bookmarklet is set
318 if(webdeveloper_toolBookmarklet
)
320 listCell
.setAttribute("label", webdeveloper_toolBookmarklet
);
322 else if(webdeveloper_toolPath
)
324 listCell
.setAttribute("label", webdeveloper_toolPath
);
328 listCell
.setAttribute("label", webdeveloper_toolURL
);
331 listCell
.setAttribute("crop", "end");
332 selectedItem
.appendChild(listCell
);
334 listCell
= pageDocument
.createElement("listcell");
337 if(webdeveloper_toolKey
)
339 listCell
.setAttribute("label", webdeveloper_toolKey
);
342 selectedItem
.appendChild(listCell
);
343 toolBox
.ensureElementIsVisible(selectedItem
);
349 // Edits a view source with option
350 function webdeveloper_editViewSourceWith()
352 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
353 var viewSourceWithBox
= pageDocument
.getElementById("webdeveloper-listbox");
354 var selectedItem
= viewSourceWithBox
.selectedItem
;
356 // If an option is selected
359 window
.openDialog("chrome://webdeveloper/content/options/dialogs/view_source_with.xul", "webdeveloper-view-source-with-dialog", "centerscreen,chrome,modal", "edit", selectedItem
.childNodes
[0].getAttribute("label"), selectedItem
.childNodes
[1].getAttribute("label"), selectedItem
.childNodes
[2].getAttribute("label"));
361 // If the description and path are set
362 if(webdeveloper_viewSourceWithDescription
&& webdeveloper_viewSourceWithPath
)
364 var listCell
= pageDocument
.createElement("listcell");
366 webdeveloper_removeAllChildElements(selectedItem
);
368 listCell
.setAttribute("label", webdeveloper_viewSourceWithDescription
);
369 selectedItem
.appendChild(listCell
);
371 listCell
= pageDocument
.createElement("listcell");
372 listCell
.setAttribute("label", webdeveloper_viewSourceWithPath
);
373 listCell
.setAttribute("crop", "end");
374 selectedItem
.appendChild(listCell
);
376 listCell
= pageDocument
.createElement("listcell");
379 if(webdeveloper_viewSourceWithKey
)
381 listCell
.setAttribute("label", webdeveloper_viewSourceWithKey
);
384 selectedItem
.appendChild(listCell
);
385 viewSourceWithBox
.ensureElementIsVisible(selectedItem
);
390 // Initializes the colors and fonts page
391 function webdeveloper_initializeColorsAndFonts()
393 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
395 // If the generated content font size preference is set
396 if(typeof webdeveloper_optionsDataInteger
["webdeveloper.generated.content.font.size"] != "undefined")
398 pageDocument
.getElementById("webdeveloper.generated.content.font.size").value
= webdeveloper_optionsDataInteger
["webdeveloper.generated.content.font.size"];
400 else if(webdeveloper_isPreferenceSet("webdeveloper.generated.content.font.size"))
402 pageDocument
.getElementById("webdeveloper.generated.content.font.size").value
= webdeveloper_getIntegerPreference("webdeveloper.generated.content.font.size", true);
405 // If the feature tooltip text color is set
406 if(typeof webdeveloper_optionsDataString
["webdeveloper.feature.tooltip.color.text"] != "undefined")
408 pageDocument
.getElementById("webdeveloper.feature.tooltip.color.text").color
= webdeveloper_optionsDataString
["webdeveloper.feature.tooltip.color.text"].trim();
410 else if(webdeveloper_isPreferenceSet("webdeveloper.feature.tooltip.color.text"))
412 pageDocument
.getElementById("webdeveloper.feature.tooltip.color.text").color
= webdeveloper_getStringPreference("webdeveloper.feature.tooltip.color.text", true);
415 // If the feature tooltip background color is set
416 if(typeof webdeveloper_optionsDataString
["webdeveloper.feature.tooltip.color.background"] != "undefined")
418 pageDocument
.getElementById("webdeveloper.feature.tooltip.color.background").color
= webdeveloper_optionsDataString
["webdeveloper.feature.tooltip.color.background"].trim();
420 else if(webdeveloper_isPreferenceSet("webdeveloper.feature.tooltip.color.background"))
422 pageDocument
.getElementById("webdeveloper.feature.tooltip.color.background").color
= webdeveloper_getStringPreference("webdeveloper.feature.tooltip.color.background", true);
425 // If the feature tooltip border color is set
426 if(typeof webdeveloper_optionsDataString
["webdeveloper.feature.tooltip.color.border"] != "undefined")
428 pageDocument
.getElementById("webdeveloper.feature.tooltip.color.border").color
= webdeveloper_optionsDataString
["webdeveloper.feature.tooltip.color.border"].trim();
430 else if(webdeveloper_isPreferenceSet("webdeveloper.feature.tooltip.color.border"))
432 pageDocument
.getElementById("webdeveloper.feature.tooltip.color.border").color
= webdeveloper_getStringPreference("webdeveloper.feature.tooltip.color.border", true);
435 // If the feature tooltip opacity is set
436 if(typeof webdeveloper_optionsDataString
["webdeveloper.feature.tooltip.opacity"] != "undefined")
438 pageDocument
.getElementById("webdeveloper.feature.tooltip.opacity").value
= webdeveloper_optionsDataString
["webdeveloper.feature.tooltip.opacity"];
440 else if(webdeveloper_isPreferenceSet("webdeveloper.feature.tooltip.opacity"))
442 pageDocument
.getElementById("webdeveloper.feature.tooltip.opacity").value
= webdeveloper_getStringPreference("webdeveloper.feature.tooltip.opacity", true);
446 // Initializes the dashboard page
447 function webdeveloper_initializeDashboard()
449 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
451 // If the edit CSS text color is set
452 if(typeof webdeveloper_optionsDataString
["webdeveloper.edit.color.text"] != "undefined")
454 pageDocument
.getElementById("webdeveloper.edit.color.text").color
= webdeveloper_optionsDataString
["webdeveloper.edit.color.text"].trim();
456 else if(webdeveloper_isPreferenceSet("webdeveloper.edit.color.text"))
458 pageDocument
.getElementById("webdeveloper.edit.color.text").color
= webdeveloper_getStringPreference("webdeveloper.edit.color.text", true);
461 // If the edit CSS background color is set
462 if(typeof webdeveloper_optionsDataString
["webdeveloper.edit.color.background"] != "undefined")
464 pageDocument
.getElementById("webdeveloper.edit.color.background").color
= webdeveloper_optionsDataString
["webdeveloper.edit.color.background"].trim();
466 else if(webdeveloper_isPreferenceSet("webdeveloper.edit.color.background"))
468 pageDocument
.getElementById("webdeveloper.edit.color.background").color
= webdeveloper_getStringPreference("webdeveloper.edit.color.background", true);
471 // If the edit CSS font preference is set
472 if(typeof webdeveloper_optionsDataInteger
["webdeveloper.edit.font.size"] != "undefined")
474 pageDocument
.getElementById("webdeveloper.edit.font.size").value
= webdeveloper_optionsDataInteger
["webdeveloper.edit.font.size"];
476 else if(webdeveloper_isPreferenceSet("webdeveloper.edit.font.size"))
478 pageDocument
.getElementById("webdeveloper.edit.font.size").value
= webdeveloper_getIntegerPreference("webdeveloper.edit.font.size", true);
481 // If the edit CSS update frequency preference is set
482 if(typeof webdeveloper_optionsDataInteger
["webdeveloper.edit.update.frequency"] != "undefined")
484 pageDocument
.getElementById("webdeveloper.edit.update.frequency").value
= webdeveloper_optionsDataInteger
["webdeveloper.edit.update.frequency"];
486 else if(webdeveloper_isPreferenceSet("webdeveloper.edit.update.frequency"))
488 pageDocument
.getElementById("webdeveloper.edit.update.frequency").value
= webdeveloper_getIntegerPreference("webdeveloper.edit.update.frequency", true);
491 // If the edit CSS wrap preference is set
492 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.edit.wrap"] != "undefined")
494 pageDocument
.getElementById("webdeveloper.edit.wrap").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.edit.wrap"];
496 else if(webdeveloper_isPreferenceSet("webdeveloper.edit.wrap"))
498 pageDocument
.getElementById("webdeveloper.edit.wrap").checked
= webdeveloper_getBooleanPreference("webdeveloper.edit.wrap", true);
501 // If the style information dashboard preference is set
502 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.style.information.dashboard"] != "undefined")
504 pageDocument
.getElementById("webdeveloper.style.information.dashboard").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.style.information.dashboard"];
506 else if(webdeveloper_isPreferenceSet("webdeveloper.style.information.dashboard"))
508 pageDocument
.getElementById("webdeveloper.style.information.dashboard").checked
= webdeveloper_getBooleanPreference("webdeveloper.style.information.dashboard", true);
511 // If the DOM Inspector dashboard preference is set
512 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.dom.inspector.dashboard"] != "undefined")
514 pageDocument
.getElementById("webdeveloper.dom.inspector.dashboard").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.dom.inspector.dashboard"];
516 else if(webdeveloper_isPreferenceSet("webdeveloper.dom.inspector.dashboard"))
518 pageDocument
.getElementById("webdeveloper.dom.inspector.dashboard").checked
= webdeveloper_getBooleanPreference("webdeveloper.dom.inspector.dashboard", true);
521 // If the error console dashboard preference is set
522 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.error.console.dashboard"] != "undefined")
524 pageDocument
.getElementById("webdeveloper.error.console.dashboard").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.error.console.dashboard"];
526 else if(webdeveloper_isPreferenceSet("webdeveloper.error.console.dashboard"))
528 pageDocument
.getElementById("webdeveloper.error.console.dashboard").checked
= webdeveloper_getBooleanPreference("webdeveloper.error.console.dashboard", true);
532 // Initializes the general page
533 function webdeveloper_initializeGeneral()
535 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
537 // If the hide menu preference is set
538 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.menu.hide"] != "undefined")
540 pageDocument
.getElementById("webdeveloper.menu.hide").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.menu.hide"];
542 else if(webdeveloper_isPreferenceSet("webdeveloper.menu.hide"))
544 pageDocument
.getElementById("webdeveloper.menu.hide").checked
= webdeveloper_getBooleanPreference("webdeveloper.menu.hide", true);
548 pageDocument
.getElementById("webdeveloper.menu.hide").checked
= false;
551 // If the hide context menu preference is set
552 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.context.hide"] != "undefined")
554 pageDocument
.getElementById("webdeveloper.context.hide").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.context.hide"];
556 else if(webdeveloper_isPreferenceSet("webdeveloper.context.hide"))
558 pageDocument
.getElementById("webdeveloper.context.hide").checked
= webdeveloper_getBooleanPreference("webdeveloper.context.hide", true);
562 pageDocument
.getElementById("webdeveloper.context.hide").checked
= false;
565 // If the hide confirmation dialogs preference is set
566 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.confirmation.dialogs.hide"] != "undefined")
568 pageDocument
.getElementById("webdeveloper.confirmation.dialogs.hide").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.confirmation.dialogs.hide"];
570 else if(webdeveloper_isPreferenceSet("webdeveloper.confirmation.dialogs.hide"))
572 pageDocument
.getElementById("webdeveloper.confirmation.dialogs.hide").checked
= webdeveloper_getBooleanPreference("webdeveloper.confirmation.dialogs.hide", true);
576 pageDocument
.getElementById("webdeveloper.confirmation.dialogs.hide").checked
= false;
579 // If the hide informational dialogs preference is set
580 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.informational.dialogs.hide"] != "undefined")
582 pageDocument
.getElementById("webdeveloper.informational.dialogs.hide").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.informational.dialogs.hide"];
584 else if(webdeveloper_isPreferenceSet("webdeveloper.informational.dialogs.hide"))
586 pageDocument
.getElementById("webdeveloper.informational.dialogs.hide").checked
= webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true);
590 pageDocument
.getElementById("webdeveloper.informational.dialogs.hide").checked
= false;
593 // If the toolbar icons preference is set
594 if(typeof webdeveloper_optionsDataString
["webdeveloper.toolbar.icons"] != "undefined")
596 pageDocument
.getElementById("webdeveloper.toolbar.icons").value
= webdeveloper_optionsDataString
["webdeveloper.toolbar.icons"];
598 else if(webdeveloper_isPreferenceSet("webdeveloper.toolbar.icons"))
600 pageDocument
.getElementById("webdeveloper.toolbar.icons").value
= webdeveloper_getStringPreference("webdeveloper.toolbar.icons", true);
604 pageDocument
.getElementById("webdeveloper.toolbar.icons").selectedIndex
= 0;
607 // If the open tabs preference is set
608 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.open.tabs"] != "undefined")
610 pageDocument
.getElementById("webdeveloper.open.tabs").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.open.tabs"];
612 else if(webdeveloper_isPreferenceSet("webdeveloper.open.tabs"))
614 pageDocument
.getElementById("webdeveloper.open.tabs").checked
= webdeveloper_getBooleanPreference("webdeveloper.open.tabs", true);
617 // If the open tabs background preference is set
618 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.open.tabs.background"] != "undefined")
620 pageDocument
.getElementById("webdeveloper.open.tabs.background").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.open.tabs.background"];
622 else if(webdeveloper_isPreferenceSet("webdeveloper.open.tabs.background"))
624 pageDocument
.getElementById("webdeveloper.open.tabs.background").checked
= webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true);
628 pageDocument
.getElementById("webdeveloper.open.tabs.background").checked
= false;
631 pageDocument
.getElementById("webdeveloper.open.tabs.background").disabled
= !pageDocument
.getElementById("webdeveloper.open.tabs").checked
;
634 // Initializes the keys page
635 function webdeveloper_initializeKeys()
637 var mainDocument
= null;
639 // If there is a parent window
642 // If there is a grand parent window
643 if(window
.opener
.opener
)
645 mainDocument
= window
.opener
.opener
.document
;
649 mainDocument
= window
.opener
.document
;
654 mainDocument
= document
;
657 // If a main document was found
660 var keySet
= mainDocument
.getElementById("mainKeyset");
662 // If the key set was not found
665 keySet
= mainDocument
.getElementById("navKeys");
668 // If the key set was found
671 var description
= null;
672 var horizontalBox
= null;
674 var labelElement
= null;
676 var keys
= keySet
.childNodes
;
677 var keysLength
= keys
.length
;
678 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
680 var rows
= pageDocument
.getElementById("webdeveloper-key-rows");
682 var stringBundle
= document
.getElementById("webdeveloper-string-bundle");
683 var modifiers
= null;
686 // If running on a Mac
687 if(webdeveloper_isMac())
689 modifiers
= stringBundle
.getString("webdeveloper_keyboardShortcutModifiersMac");
693 modifiers
= stringBundle
.getString("webdeveloper_keyboardShortcutModifiers");
696 // Loop through the keys
697 for(var i
= 0; i
< keysLength
; i
++)
701 // If the key has and id attribute starting with webdeveloper-
702 if(key
.hasAttribute("id") && key
.getAttribute("id").indexOf("webdeveloper-") == 0)
704 description
= pageDocument
.createElement("description");
705 horizontalBox
= pageDocument
.createElement("hbox");
706 id
= key
.getAttribute("id").split("-").join(".");
707 labelElement
= pageDocument
.createElement("label");
708 row
= pageDocument
.createElement("row");
709 textBox
= pageDocument
.createElement("textbox");
711 labelElement
.setAttribute("control", id
);
712 labelElement
.setAttribute("value", key
.getAttribute("label"));
713 row
.appendChild(labelElement
);
715 description
.setAttribute("value", modifiers
);
716 horizontalBox
.appendChild(description
);
718 // If the option is defined
719 if(typeof webdeveloper_optionsDataString
[id
] != "undefined")
721 textBox
.setAttribute("value", webdeveloper_optionsDataString
[id
].trim());
723 else if(webdeveloper_isPreferenceSet(id
))
725 textBox
.setAttribute("value", webdeveloper_getStringPreference(id
, true));
729 textBox
.setAttribute("value", key
.getAttribute("key"));
732 textBox
.setAttribute("id", id
);
733 textBox
.setAttribute("size", "1");
734 textBox
.setAttribute("maxlength", "1");
735 horizontalBox
.appendChild(textBox
);
737 horizontalBox
.setAttribute("align", "center");
738 row
.appendChild(horizontalBox
);
740 row
.setAttribute("align", "center");
741 rows
.appendChild(row
);
748 // Initializes the miscellaneous page
749 function webdeveloper_initializeMiscellaneous()
751 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
753 // If the populate form fields email preference is set
754 if(typeof webdeveloper_optionsDataString
["webdeveloper.populate.form.fields.email"] != "undefined")
756 pageDocument
.getElementById("webdeveloper.populate.form.fields.email").value
= webdeveloper_optionsDataString
["webdeveloper.populate.form.fields.email"];
758 else if(webdeveloper_isPreferenceSet("webdeveloper.populate.form.fields.email"))
760 pageDocument
.getElementById("webdeveloper.populate.form.fields.email").value
= webdeveloper_getStringPreference("webdeveloper.populate.form.fields.email", true);
763 // If the tidy information preference is set
764 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.information.tidy"] != "undefined")
766 pageDocument
.getElementById("webdeveloper.information.tidy").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.information.tidy"];
768 else if(webdeveloper_isPreferenceSet("webdeveloper.information.tidy"))
770 pageDocument
.getElementById("webdeveloper.information.tidy").checked
= webdeveloper_getBooleanPreference("webdeveloper.information.tidy", true);
774 pageDocument
.getElementById("webdeveloper.information.tidy").checked
= false;
777 // If the open CSS console error preference is set
778 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.open.css.console.error"] != "undefined")
780 pageDocument
.getElementById("webdeveloper.open.css.console.error").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.open.css.console.error"];
782 else if(webdeveloper_isPreferenceSet("webdeveloper.open.css.console.error"))
784 pageDocument
.getElementById("webdeveloper.open.css.console.error").checked
= webdeveloper_getBooleanPreference("webdeveloper.open.css.console.error", true);
788 pageDocument
.getElementById("webdeveloper.open.css.console.error").checked
= false;
791 // If the open JavaScript console warning preference is set
792 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.open.javascript.console.warning"] != "undefined")
794 pageDocument
.getElementById("webdeveloper.open.javascript.console.warning").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.open.javascript.console.warning"];
796 else if(webdeveloper_isPreferenceSet("webdeveloper.open.javascript.console.warning"))
798 pageDocument
.getElementById("webdeveloper.open.javascript.console.warning").checked
= webdeveloper_getBooleanPreference("webdeveloper.open.javascript.console.warning", true);
802 pageDocument
.getElementById("webdeveloper.open.javascript.console.warning").checked
= false;
805 // If the open JavaScript console error preference is set
806 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.open.javascript.console.error"] != "undefined")
808 pageDocument
.getElementById("webdeveloper.open.javascript.console.error").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.open.javascript.console.error"];
810 else if(webdeveloper_isPreferenceSet("webdeveloper.open.javascript.console.error"))
812 pageDocument
.getElementById("webdeveloper.open.javascript.console.error").checked
= webdeveloper_getBooleanPreference("webdeveloper.open.javascript.console.error", true);
816 pageDocument
.getElementById("webdeveloper.open.javascript.console.error").checked
= false;
820 // Initializes the options dialog
821 function webdeveloper_initializeOptions(checkDialogParameters
)
823 var pageList
= document
.getElementById("webdeveloper-options-page-list");
826 // If check dialog parameters and window arguments are set
827 if(checkDialogParameters
&& window
.arguments
)
829 selectPage
= webdeveloper_translatePageNameToIndex(window
.arguments
[0]);
831 else if(webdeveloper_isPreferenceSet("webdeveloper.options.last.page"))
833 selectPage
= webdeveloper_getIntegerPreference("webdeveloper.options.last.page");
836 pageList
.selectedIndex
= selectPage
;
838 document
.getElementById("webdeveloper-options-iframe").setAttribute("src", pageList
.selectedItem
.value
);
841 // Initializes the resize page
842 function webdeveloper_initializeResize()
844 var description
= null;
845 var descriptionValue
= null;
847 var heightValue
= null;
850 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
851 var resizeBox
= pageDocument
.getElementById("webdeveloper-listbox");
853 var stringBundle
= document
.getElementById("webdeveloper-string-bundle");
854 var no
= stringBundle
.getString("webdeveloper_no");
856 var viewportValue
= false;
858 var widthValue
= null;
859 var yes
= stringBundle
.getString("webdeveloper_yes");
861 // If the resize count preference is set
862 if(typeof webdeveloper_optionsDataInteger
["webdeveloper.resize.count"] != "undefined")
864 resizeCount
= webdeveloper_optionsDataInteger
["webdeveloper.resize.count"];
866 else if(webdeveloper_isPreferenceSet("webdeveloper.resize.count"))
868 resizeCount
= webdeveloper_getIntegerPreference("webdeveloper.resize.count", true);
871 // Loop through the possible resize options
872 for(var i
= 1; i
<= resizeCount
; i
++)
874 description
= "webdeveloper.resize." + i
+ ".description";
875 height
= "webdeveloper.resize." + i
+ ".height";
876 viewport
= "webdeveloper.resize." + i
+ ".viewport";
877 width
= "webdeveloper.resize." + i
+ ".width";
879 // If the description is set
880 if(typeof webdeveloper_optionsDataString
[description
] != "undefined")
882 descriptionValue
= webdeveloper_optionsDataString
[description
].trim();
884 else if(webdeveloper_isPreferenceSet(description
))
886 descriptionValue
= webdeveloper_getStringPreference(description
, true);
890 descriptionValue
= null;
893 // If the width is set
894 if(typeof webdeveloper_optionsDataInteger
[width
] != "undefined")
896 widthValue
= webdeveloper_optionsDataInteger
[width
];
898 else if(webdeveloper_isPreferenceSet(width
))
900 widthValue
= webdeveloper_getIntegerPreference(width
, true);
907 // If the height is set
908 if(typeof webdeveloper_optionsDataInteger
[height
] != "undefined")
910 heightValue
= webdeveloper_optionsDataInteger
[height
];
912 else if(webdeveloper_isPreferenceSet(height
))
914 heightValue
= webdeveloper_getIntegerPreference(height
, true);
921 // If the viewport is set
922 if(typeof webdeveloper_optionsDataBoolean
[viewport
] != "undefined")
924 viewportValue
= webdeveloper_optionsDataBoolean
[viewport
];
926 else if(webdeveloper_isPreferenceSet(viewport
))
928 viewportValue
= webdeveloper_getBooleanPreference(viewport
, true);
932 viewportValue
= false;
935 // If the description, width and height are set
936 if(descriptionValue
&& widthValue
&& heightValue
)
938 listItem
= pageDocument
.createElement("listitem");
940 listCell
= pageDocument
.createElement("listcell");
941 listCell
.setAttribute("label", descriptionValue
);
942 listItem
.appendChild(listCell
);
944 listCell
= pageDocument
.createElement("listcell");
945 listCell
.setAttribute("label", widthValue
);
946 listItem
.appendChild(listCell
);
948 listCell
= pageDocument
.createElement("listcell");
949 listCell
.setAttribute("label", heightValue
);
950 listItem
.appendChild(listCell
);
952 listCell
= pageDocument
.createElement("listcell");
954 // If resizing the viewport
957 listCell
.setAttribute("label", yes
);
961 listCell
.setAttribute("label", no
);
964 listItem
.appendChild(listCell
);
965 resizeBox
.appendChild(listItem
);
969 webdeveloper_listBoxSelected();
972 // Initializes the tools page
973 function webdeveloper_initializeTools()
975 var bookmarklet
= null;
976 var bookmarkletValue
= null;
977 var description
= null;
978 var descriptionValue
= null;
983 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
985 var pathValue
= null;
986 var separator
= null;
987 var separatorValue
= false;
988 var stringBundle
= document
.getElementById("webdeveloper-string-bundle");
989 var applicationType
= stringBundle
.getString("webdeveloper_application");
990 var bookmarkletType
= stringBundle
.getString("webdeveloper_bookmarklet");
991 var toolBox
= pageDocument
.getElementById("webdeveloper-listbox");
994 var urlType
= stringBundle
.getString("webdeveloper_url");
997 // If the tool count preference is set
998 if(typeof webdeveloper_optionsDataInteger
["webdeveloper.tool.count"] != "undefined")
1000 toolCount
= webdeveloper_optionsDataInteger
["webdeveloper.tool.count"];
1002 else if(webdeveloper_isPreferenceSet("webdeveloper.tool.count"))
1004 toolCount
= webdeveloper_getIntegerPreference("webdeveloper.tool.count", true);
1007 // Loop through the possible tools
1008 for(var i
= 1; i
<= toolCount
; i
++)
1010 bookmarklet
= "webdeveloper.tool." + i
+ ".bookmarklet";
1011 description
= "webdeveloper.tool." + i
+ ".description";
1012 key
= "webdeveloper.tool." + i
+ ".key";
1013 path
= "webdeveloper.tool." + i
+ ".path";
1014 separator
= "webdeveloper.tool." + i
+ ".separator";
1015 url
= "webdeveloper.tool." + i
+ ".url";
1017 // If the bookmarklet is set
1018 if(typeof webdeveloper_optionsDataString
[bookmarklet
] != "undefined")
1020 bookmarkletValue
= webdeveloper_optionsDataString
[bookmarklet
].trim();
1022 else if(webdeveloper_isPreferenceSet(bookmarklet
))
1024 bookmarkletValue
= webdeveloper_getStringPreference(bookmarklet
, true);
1028 bookmarkletValue
= null;
1031 // If the description is set
1032 if(typeof webdeveloper_optionsDataString
[description
] != "undefined")
1034 descriptionValue
= webdeveloper_optionsDataString
[description
].trim();
1036 else if(webdeveloper_isPreferenceSet(description
))
1038 descriptionValue
= webdeveloper_getStringPreference(description
, true);
1042 descriptionValue
= null;
1045 // If the key is set
1046 if(typeof webdeveloper_optionsDataString
[key
] != "undefined")
1048 keyValue
= webdeveloper_optionsDataString
[key
].trim();
1050 else if(webdeveloper_isPreferenceSet(key
))
1052 keyValue
= webdeveloper_getStringPreference(key
, true);
1059 // If the path is set
1060 if(typeof webdeveloper_optionsDataString
[path
] != "undefined")
1062 pathValue
= webdeveloper_optionsDataString
[path
].trim();
1064 else if(webdeveloper_isPreferenceSet(path
))
1066 pathValue
= webdeveloper_getStringPreference(path
, true);
1073 // If the separator is set
1074 if(typeof webdeveloper_optionsDataBoolean
[separator
] != "undefined")
1076 separatorValue
= webdeveloper_optionsDataBoolean
[separator
];
1078 else if(webdeveloper_isPreferenceSet(separator
))
1080 separatorValue
= webdeveloper_getBooleanPreference(separator
, true);
1084 separatorValue
= false;
1087 // If the URL is set
1088 if(typeof webdeveloper_optionsDataString
[url
] != "undefined")
1090 urlValue
= webdeveloper_optionsDataString
[url
].trim();
1092 else if(webdeveloper_isPreferenceSet(url
))
1094 urlValue
= webdeveloper_getStringPreference(url
, true);
1101 // If the separator is set
1104 listItem
= pageDocument
.createElement("listitem");
1105 separator
= pageDocument
.createElement("separator");
1107 separator
.setAttribute("class", "groove");
1108 listItem
.appendChild(separator
);
1110 separator
= pageDocument
.createElement("separator");
1111 separator
.setAttribute("class", "groove");
1112 listItem
.appendChild(separator
);
1114 separator
= pageDocument
.createElement("separator");
1115 separator
.setAttribute("class", "groove");
1116 listItem
.appendChild(separator
);
1118 toolBox
.appendChild(listItem
);
1120 else if(descriptionValue
&& (bookmarkletValue
|| pathValue
|| urlValue
))
1122 listItem
= pageDocument
.createElement("listitem");
1124 listCell
= pageDocument
.createElement("listcell");
1125 listCell
.setAttribute("label", descriptionValue
);
1127 // If the bookmarklet is set
1128 if(bookmarkletValue
)
1130 listCell
.setAttribute("type", bookmarkletType
);
1134 listCell
.setAttribute("type", applicationType
);
1138 listCell
.setAttribute("type", urlType
);
1141 listItem
.appendChild(listCell
);
1143 listCell
= pageDocument
.createElement("listcell");
1145 // If the bookmarklet is set
1146 if(bookmarkletValue
)
1148 listCell
.setAttribute("label", bookmarkletValue
);
1152 listCell
.setAttribute("label", pathValue
);
1156 listCell
.setAttribute("label", urlValue
);
1159 listCell
.setAttribute("crop", "end");
1160 listItem
.appendChild(listCell
);
1162 listCell
= pageDocument
.createElement("listcell");
1164 // If the key is set
1167 listCell
.setAttribute("label", keyValue
);
1170 listItem
.appendChild(listCell
);
1171 toolBox
.appendChild(listItem
);
1175 webdeveloper_listBoxSelected();
1178 // Initializes the validation page
1179 function webdeveloper_initializeValidation()
1181 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
1182 var validateLocalCSSProfile
= "css21";
1183 var validateLocalCSSProfileRadio
= pageDocument
.getElementById("webdeveloper-validate-local-css21-radio");
1185 // If the Section 508 preference is set
1186 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.accessibility.section508"] != "undefined")
1188 pageDocument
.getElementById("webdeveloper.validate.local.accessibility.section508").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.accessibility.section508"];
1190 else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.accessibility.section508"))
1192 pageDocument
.getElementById("webdeveloper.validate.local.accessibility.section508").checked
= webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.section508", true);
1195 // If the WAI priority 1 preference is set
1196 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.accessibility.wai.priority1"] != "undefined")
1198 pageDocument
.getElementById("webdeveloper.validate.local.accessibility.wai.priority1").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.accessibility.wai.priority1"];
1200 else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.accessibility.wai.priority1"))
1202 pageDocument
.getElementById("webdeveloper.validate.local.accessibility.wai.priority1").checked
= webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.wai.priority1", true);
1205 // If the WAI priority 2 preference is set
1206 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.accessibility.wai.priority2"] != "undefined")
1208 pageDocument
.getElementById("webdeveloper.validate.local.accessibility.wai.priority2").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.accessibility.wai.priority2"];
1210 else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.accessibility.wai.priority2"))
1212 pageDocument
.getElementById("webdeveloper.validate.local.accessibility.wai.priority2").checked
= webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.wai.priority2", true);
1215 // If the WAI priority 3 preference is set
1216 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.accessibility.wai.priority3"] != "undefined")
1218 pageDocument
.getElementById("webdeveloper.validate.local.accessibility.wai.priority3").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.accessibility.wai.priority3"];
1220 else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.accessibility.wai.priority3"))
1222 pageDocument
.getElementById("webdeveloper.validate.local.accessibility.wai.priority3").checked
= webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.wai.priority3", true);
1225 // If the CSS profile preference is set
1226 if(typeof webdeveloper_optionsDataString
["webdeveloper.validate.local.css.profile"] != "undefined")
1228 validateLocalCSSProfile
= webdeveloper_optionsDataString
["webdeveloper.validate.local.css.profile"];
1230 else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.css.profile"))
1232 validateLocalCSSProfile
= webdeveloper_getStringPreference("webdeveloper.validate.local.css.profile", true);
1235 // If validate local CSS profile is set to CSS 3
1236 if(validateLocalCSSProfile
== "css3")
1238 validateLocalCSSProfileRadio
= pageDocument
.getElementById("webdeveloper-validate-local-css3-radio");
1241 validateLocalCSSProfileRadio
.radioGroup
.selectedItem
= validateLocalCSSProfileRadio
;
1243 // If the show outline preference is set
1244 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.html.show.outline"] != "undefined")
1246 pageDocument
.getElementById("webdeveloper.validate.local.html.show.outline").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.html.show.outline"];
1248 else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.html.show.outline"))
1250 pageDocument
.getElementById("webdeveloper.validate.local.html.show.outline").checked
= webdeveloper_getBooleanPreference("webdeveloper.validate.local.html.show.outline", true);
1253 // If the show parse tree preference is set
1254 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.html.show.parse.tree"] != "undefined")
1256 pageDocument
.getElementById("webdeveloper.validate.local.html.show.parse.tree").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.html.show.parse.tree"];
1258 else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.html.show.parse.tree"))
1260 pageDocument
.getElementById("webdeveloper.validate.local.html.show.parse.tree").checked
= webdeveloper_getBooleanPreference("webdeveloper.validate.local.html.show.parse.tree", true);
1263 // If the show source preference is set
1264 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.html.show.source"] != "undefined")
1266 pageDocument
.getElementById("webdeveloper.validate.local.html.show.source").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.html.show.source"];
1268 else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.html.show.source"))
1270 pageDocument
.getElementById("webdeveloper.validate.local.html.show.source").checked
= webdeveloper_getBooleanPreference("webdeveloper.validate.local.html.show.source", true);
1274 // Initializes the view source page
1275 function webdeveloper_initializeViewSource()
1277 var description
= null;
1278 var descriptionValue
= null;
1280 var keyValue
= null;
1281 var listCell
= null;
1282 var listItem
= null;
1283 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
1285 var pathValue
= null;
1286 var viewSourceWithBox
= pageDocument
.getElementById("webdeveloper-listbox");
1287 var viewSourceWithCount
= 0;
1289 // If the view source in tab preference is set
1290 if(typeof webdeveloper_optionsDataBoolean
["webdeveloper.view.source.tab"] != "undefined")
1292 pageDocument
.getElementById("webdeveloper.view.source.tab").checked
= webdeveloper_optionsDataBoolean
["webdeveloper.view.source.tab"];
1294 else if(webdeveloper_isPreferenceSet("webdeveloper.view.source.tab"))
1296 pageDocument
.getElementById("webdeveloper.view.source.tab").checked
= webdeveloper_getBooleanPreference("webdeveloper.view.source.tab", true);
1300 pageDocument
.getElementById("webdeveloper.view.source.tab").checked
= false;
1303 // If the view source with count preference is set
1304 if(typeof webdeveloper_optionsDataInteger
["webdeveloper.view.source.with.count"] != "undefined")
1306 viewSourceWithCount
= webdeveloper_optionsDataInteger
["webdeveloper.view.source.with.count"];
1308 else if(webdeveloper_isPreferenceSet("webdeveloper.view.source.with.count"))
1310 viewSourceWithCount
= webdeveloper_getIntegerPreference("webdeveloper.view.source.with.count", true);
1313 // Loop through the possible view source with options
1314 for(var i
= 1; i
<= viewSourceWithCount
; i
++)
1316 description
= "webdeveloper.view.source.with." + i
+ ".description";
1317 key
= "webdeveloper.view.source.with." + i
+ ".key";
1318 path
= "webdeveloper.view.source.with." + i
+ ".path";
1320 // If the description is set
1321 if(typeof webdeveloper_optionsDataString
[description
] != "undefined")
1323 descriptionValue
= webdeveloper_optionsDataString
[description
].trim();
1325 else if(webdeveloper_isPreferenceSet(description
))
1327 descriptionValue
= webdeveloper_getStringPreference(description
, true);
1331 descriptionValue
= null;
1334 // If the key is set
1335 if(typeof webdeveloper_optionsDataString
[key
] != "undefined")
1337 keyValue
= webdeveloper_optionsDataString
[key
].trim();
1339 else if(webdeveloper_isPreferenceSet(key
))
1341 keyValue
= webdeveloper_getStringPreference(key
, true);
1348 // If the path is set
1349 if(typeof webdeveloper_optionsDataString
[path
] != "undefined")
1351 pathValue
= webdeveloper_optionsDataString
[path
].trim();
1353 else if(webdeveloper_isPreferenceSet(path
))
1355 pathValue
= webdeveloper_getStringPreference(path
, true);
1362 // If the description and path are set
1363 if(descriptionValue
&& pathValue
)
1365 listItem
= pageDocument
.createElement("listitem");
1366 listCell
= pageDocument
.createElement("listcell");
1368 listCell
.setAttribute("label", descriptionValue
);
1369 listItem
.appendChild(listCell
);
1371 listCell
= pageDocument
.createElement("listcell");
1372 listCell
.setAttribute("label", pathValue
);
1373 listCell
.setAttribute("crop", "end");
1374 listItem
.appendChild(listCell
);
1376 listCell
= pageDocument
.createElement("listcell");
1378 // If the key is set
1381 listCell
.setAttribute("label", keyValue
);
1384 listItem
.appendChild(listCell
);
1385 viewSourceWithBox
.appendChild(listItem
);
1389 webdeveloper_listBoxSelected();
1392 // Called whenever a list box is selected
1393 function webdeveloper_listBoxSelected()
1395 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
1396 var deleteButton
= pageDocument
.getElementById("webdeveloper-delete");
1397 var editButton
= pageDocument
.getElementById("webdeveloper-edit");
1398 var listBox
= pageDocument
.getElementById("webdeveloper-listbox");
1399 var moveDownButton
= pageDocument
.getElementById("webdeveloper-move-down");
1400 var moveUpButton
= pageDocument
.getElementById("webdeveloper-move-up");
1401 var selectedIndex
= listBox
.selectedIndex
;
1403 // If an item is selected
1404 if(listBox
.selectedItem
)
1406 deleteButton
.disabled
= false;
1407 editButton
.disabled
= false;
1409 // If this is the first item
1410 if(selectedIndex
== 0)
1412 moveUpButton
.disabled
= true;
1416 moveUpButton
.disabled
= false;
1419 // If this is the last item
1420 if(selectedIndex
== listBox
.getRowCount() - 1)
1422 moveDownButton
.disabled
= true;
1426 moveDownButton
.disabled
= false;
1431 deleteButton
.disabled
= true;
1432 editButton
.disabled
= true;
1433 moveDownButton
.disabled
= true;
1434 moveUpButton
.disabled
= true;
1438 // Moves the selected item down
1439 function webdeveloper_moveDown()
1441 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
1442 var resizeBox
= pageDocument
.getElementById("webdeveloper-listbox");
1443 var selectedItem
= resizeBox
.selectedItem
;
1445 // If an item is selected and it is not at the bottom
1446 if(selectedItem
&& resizeBox
.selectedIndex
!= resizeBox
.getRowCount() - 1)
1448 resizeBox
.selectItem(resizeBox
.insertBefore(selectedItem
, resizeBox
.getNextItem(selectedItem
, 2)));
1452 // Moves the selected item up
1453 function webdeveloper_moveUp()
1455 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
1456 var resizeBox
= pageDocument
.getElementById("webdeveloper-listbox");
1457 var selectedItem
= resizeBox
.selectedItem
;
1459 // If an item is selected and it is not at the top
1460 if(selectedItem
&& resizeBox
.selectedIndex
!= 0)
1462 resizeBox
.selectItem(resizeBox
.insertBefore(selectedItem
, resizeBox
.getPreviousItem(selectedItem
, 1)));
1466 // Adds a new separator
1467 function webdeveloper_newSeparator()
1469 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
1470 var listItem
= pageDocument
.createElement("listitem");
1471 var separator
= pageDocument
.createElement("separator");
1472 var toolBox
= pageDocument
.getElementById("webdeveloper-listbox");
1474 separator
.setAttribute("class", "groove");
1475 listItem
.appendChild(separator
);
1477 separator
= pageDocument
.createElement("separator");
1478 separator
.setAttribute("class", "groove");
1479 listItem
.appendChild(separator
);
1481 separator
= pageDocument
.createElement("separator");
1482 separator
.setAttribute("class", "groove");
1483 listItem
.appendChild(separator
);
1485 toolBox
.selectItem(toolBox
.appendChild(listItem
));
1486 toolBox
.ensureElementIsVisible(toolBox
.selectedItem
);
1489 // Resets the user's options
1490 function webdeveloper_resetOptions()
1492 var promptServiceInterface
= Components
.interfaces
.nsIPromptService
;
1493 var stringBundle
= document
.getElementById("webdeveloper-string-bundle");
1495 // If the reset is confirmed
1496 if(Components
.classes
["@mozilla.org/embedcomp/prompt-service;1"].getService(promptServiceInterface
).confirmEx(null, stringBundle
.getString("webdeveloper_resetConfirmation"), stringBundle
.getString("webdeveloper_resetConfirmationMessage"), promptServiceInterface
.BUTTON_TITLE_YES
* promptServiceInterface
.BUTTON_POS_0
+ promptServiceInterface
.BUTTON_TITLE_CANCEL
* promptServiceInterface
.BUTTON_POS_1
, stringBundle
.getString("webdeveloper_reset"), null, null, null, {}) == 0)
1498 webdeveloper_optionsDataBoolean
= new Array();
1499 webdeveloper_optionsDataInteger
= new Array();
1500 webdeveloper_optionsDataString
= new Array();
1502 webdeveloper_deletePreferenceBranch("webdeveloper.");
1503 webdeveloper_setStringPreference("webdeveloper.version", webdeveloper_parseVersion("1.1.4"));
1505 webdeveloper_configureKeyboardShortcuts(true);
1506 webdeveloper_setupDefaultOptions();
1507 webdeveloper_setupLocalizedOptions();
1508 webdeveloper_initializeOptions(false);
1512 // Saves the user's options
1513 function webdeveloper_saveOptions()
1515 var parentWindow
= null;
1517 var optionValue
= null;
1519 // Make sure current page is stored
1520 webdeveloper_storeOptions();
1522 // Loop through the boolean options
1523 for(option
in webdeveloper_optionsDataBoolean
)
1525 webdeveloper_setBooleanPreference(option
, webdeveloper_optionsDataBoolean
[option
]);
1528 // Loop through the integer options
1529 for(option
in webdeveloper_optionsDataInteger
)
1531 optionValue
= webdeveloper_optionsDataInteger
[option
];
1533 // If the option value is set
1536 webdeveloper_setIntegerPreference(option
, optionValue
);
1538 else if(webdeveloper_isPreferenceSet(option
))
1540 webdeveloper_deletePreference(option
);
1544 // Loop through the string options
1545 for(option
in webdeveloper_optionsDataString
)
1547 optionValue
= webdeveloper_optionsDataString
[option
];
1549 // If the option value is set or the preference currently has a value
1550 if(optionValue
|| webdeveloper_isPreferenceSet(option
))
1552 webdeveloper_setStringPreference(option
, optionValue
);
1556 webdeveloper_changeOptions();
1557 webdeveloper_configureKeyboardShortcuts(false);
1560 // Stores the user's options to be saved later
1561 function webdeveloper_storeOptions()
1563 var childNodes
= null;
1564 var description
= null;
1566 var iFrame
= document
.getElementById("webdeveloper-options-iframe");
1567 var iFrameSrc
= iFrame
.getAttribute("src");
1569 var listCell
= null;
1570 var listItem
= null;
1571 var pageDocument
= iFrame
.contentDocument
;
1573 var stringBundle
= document
.getElementById("webdeveloper-string-bundle");
1575 // If this is the colors page
1576 if(iFrameSrc
.indexOf("colors_fonts") != -1)
1578 webdeveloper_optionsDataInteger
["webdeveloper.generated.content.font.size"] = pageDocument
.getElementById("webdeveloper.generated.content.font.size").value
;
1579 webdeveloper_optionsDataString
["webdeveloper.feature.tooltip.color.background"] = pageDocument
.getElementById("webdeveloper.feature.tooltip.color.background").color
;
1580 webdeveloper_optionsDataString
["webdeveloper.feature.tooltip.color.border"] = pageDocument
.getElementById("webdeveloper.feature.tooltip.color.border").color
;
1581 webdeveloper_optionsDataString
["webdeveloper.feature.tooltip.color.text"] = pageDocument
.getElementById("webdeveloper.feature.tooltip.color.text").color
;
1582 webdeveloper_optionsDataString
["webdeveloper.feature.tooltip.opacity"] = pageDocument
.getElementById("webdeveloper.feature.tooltip.opacity").value
;
1584 else if(iFrameSrc
.indexOf("dashboard") != -1)
1586 var updateFrequency
= pageDocument
.getElementById("webdeveloper.edit.update.frequency").value
;
1588 webdeveloper_optionsDataBoolean
["webdeveloper.dom.inspector.dashboard"] = pageDocument
.getElementById("webdeveloper.dom.inspector.dashboard").checked
;
1589 webdeveloper_optionsDataBoolean
["webdeveloper.edit.wrap"] = pageDocument
.getElementById("webdeveloper.edit.wrap").checked
;
1590 webdeveloper_optionsDataBoolean
["webdeveloper.error.console.dashboard"] = pageDocument
.getElementById("webdeveloper.error.console.dashboard").checked
;
1591 webdeveloper_optionsDataBoolean
["webdeveloper.style.information.dashboard"] = pageDocument
.getElementById("webdeveloper.style.information.dashboard").checked
;
1592 webdeveloper_optionsDataInteger
["webdeveloper.edit.font.size"] = pageDocument
.getElementById("webdeveloper.edit.font.size").value
;
1593 webdeveloper_optionsDataString
["webdeveloper.edit.color.background"] = pageDocument
.getElementById("webdeveloper.edit.color.background").color
;
1594 webdeveloper_optionsDataString
["webdeveloper.edit.color.text"] = pageDocument
.getElementById("webdeveloper.edit.color.text").color
;
1596 // If the update frequency is set and is a valid integer and is positive
1597 if(updateFrequency
&& parseInt(updateFrequency
) == updateFrequency
&& updateFrequency
>= 0)
1599 webdeveloper_optionsDataInteger
["webdeveloper.edit.update.frequency"] = updateFrequency
;
1603 webdeveloper_optionsDataInteger
["webdeveloper.edit.update.frequency"] = 0;
1606 else if(iFrameSrc
.indexOf("general") != -1)
1608 webdeveloper_optionsDataBoolean
["webdeveloper.context.hide"] = pageDocument
.getElementById("webdeveloper.context.hide").checked
;
1609 webdeveloper_optionsDataBoolean
["webdeveloper.confirmation.dialogs.hide"] = pageDocument
.getElementById("webdeveloper.confirmation.dialogs.hide").checked
;
1610 webdeveloper_optionsDataBoolean
["webdeveloper.informational.dialogs.hide"] = pageDocument
.getElementById("webdeveloper.informational.dialogs.hide").checked
;
1611 webdeveloper_optionsDataBoolean
["webdeveloper.menu.hide"] = pageDocument
.getElementById("webdeveloper.menu.hide").checked
;
1612 webdeveloper_optionsDataBoolean
["webdeveloper.open.tabs"] = pageDocument
.getElementById("webdeveloper.open.tabs").checked
;
1613 webdeveloper_optionsDataBoolean
["webdeveloper.open.tabs.background"] = pageDocument
.getElementById("webdeveloper.open.tabs.background").checked
;
1614 webdeveloper_optionsDataString
["webdeveloper.toolbar.icons"] = pageDocument
.getElementById("webdeveloper.toolbar.icons").value
;
1616 else if(iFrameSrc
.indexOf("keys") != -1)
1619 var textBoxes
= pageDocument
.getElementById("webdeveloper-key-rows").getElementsByTagName("textbox");
1620 var textBoxesLength
= textBoxes
.length
;
1622 // Loop through the text boxes
1623 for(i
= 0; i
< textBoxesLength
; i
++)
1625 textBox
= textBoxes
.item(i
);
1627 webdeveloper_optionsDataString
[textBox
.getAttribute("id")] = textBox
.value
.trim();
1630 else if(iFrameSrc
.indexOf("miscellaneous") != -1)
1632 webdeveloper_optionsDataBoolean
["webdeveloper.information.tidy"] = pageDocument
.getElementById("webdeveloper.information.tidy").checked
;
1633 webdeveloper_optionsDataBoolean
["webdeveloper.open.css.console.error"] = pageDocument
.getElementById("webdeveloper.open.css.console.error").checked
;
1634 webdeveloper_optionsDataBoolean
["webdeveloper.open.javascript.console.warning"] = pageDocument
.getElementById("webdeveloper.open.javascript.console.warning").checked
;
1635 webdeveloper_optionsDataBoolean
["webdeveloper.open.javascript.console.error"] = pageDocument
.getElementById("webdeveloper.open.javascript.console.error").checked
;
1636 webdeveloper_optionsDataString
["webdeveloper.populate.form.fields.email"] = pageDocument
.getElementById("webdeveloper.populate.form.fields.email").value
;
1638 else if(iFrameSrc
.indexOf("resize") != -1)
1641 var resizeBox
= pageDocument
.getElementById("webdeveloper-listbox");
1642 var resizeCount
= webdeveloper_getIntegerPreference("webdeveloper.resize.count", true);
1643 var viewport
= null;
1644 var viewportValue
= false;
1646 var yes
= stringBundle
.getString("webdeveloper_yes");
1648 // Loop through the previous resize options
1649 for(i
= 1; i
<= resizeCount
; i
++)
1651 description
= "webdeveloper.resize." + i
+ ".description";
1652 height
= "webdeveloper.resize." + i
+ ".height";
1653 width
= "webdeveloper.resize." + i
+ ".width";
1655 webdeveloper_optionsDataInteger
[height
] = "";
1656 webdeveloper_optionsDataInteger
[width
] = "";
1657 webdeveloper_optionsDataString
[description
] = "";
1660 resizeCount
= resizeBox
.getRowCount();
1662 // Loop through the possible resize options
1663 for(i
= 1; i
<= resizeCount
; i
++)
1665 description
= "webdeveloper.resize." + i
+ ".description";
1666 height
= "webdeveloper.resize." + i
+ ".height";
1667 listItem
= resizeBox
.getItemAtIndex(i
- 1);
1668 childNodes
= listItem
.childNodes
;
1669 viewport
= "webdeveloper.resize." + i
+ ".viewport";
1670 viewportValue
= false;
1671 width
= "webdeveloper.resize." + i
+ ".width";
1673 // If the viewport label is set to yes
1674 if(listItem
.childNodes
[3].getAttribute("label") == yes
)
1676 viewportValue
= true;
1679 webdeveloper_optionsDataBoolean
[viewport
] = viewportValue
;
1680 webdeveloper_optionsDataInteger
[width
] = listItem
.childNodes
[1].getAttribute("label");
1681 webdeveloper_optionsDataInteger
[height
] = listItem
.childNodes
[2].getAttribute("label");
1682 webdeveloper_optionsDataString
[description
] = listItem
.childNodes
[0].getAttribute("label").trim();
1685 webdeveloper_optionsDataInteger
["webdeveloper.resize.count"] = resizeCount
;
1687 else if(iFrameSrc
.indexOf("tools") != -1)
1689 var applicationType
= stringBundle
.getString("webdeveloper_application");
1690 var bookmarklet
= null;
1691 var bookmarkletType
= stringBundle
.getString("webdeveloper_bookmarklet");
1692 var separator
= null;
1693 var toolBox
= pageDocument
.getElementById("webdeveloper-listbox");
1694 var toolCount
= toolBox
.getRowCount();
1695 var toolPreviousCount
= webdeveloper_getIntegerPreference("webdeveloper.tool.count", true);
1698 // Loop through the previous tools
1699 for(i
= 1; i
<= toolCount
|| i
<= toolPreviousCount
; i
++)
1701 bookmarklet
= "webdeveloper.tool." + i
+ ".bookmarklet";
1702 description
= "webdeveloper.tool." + i
+ ".description";
1703 key
= "webdeveloper.tool." + i
+ ".key";
1704 path
= "webdeveloper.tool." + i
+ ".path";
1705 separator
= "webdeveloper.tool." + i
+ ".separator";
1706 url
= "webdeveloper.tool." + i
+ ".url";
1708 webdeveloper_optionsDataBoolean
[separator
] = false;
1709 webdeveloper_optionsDataString
[bookmarklet
] = "";
1710 webdeveloper_optionsDataString
[description
] = "";
1711 webdeveloper_optionsDataString
[key
] = "";
1712 webdeveloper_optionsDataString
[path
] = "";
1713 webdeveloper_optionsDataString
[url
] = "";
1716 // Loop through the possible tools
1717 for(i
= 1; i
<= toolCount
; i
++)
1719 bookmarklet
= "webdeveloper.tool." + i
+ ".bookmarklet";
1720 description
= "webdeveloper.tool." + i
+ ".description";
1721 listItem
= toolBox
.getItemAtIndex(i
- 1);
1722 childNodes
= listItem
.childNodes
;
1723 listCell
= listItem
.childNodes
[0];
1724 key
= "webdeveloper.tool." + i
+ ".key";
1725 path
= "webdeveloper.tool." + i
+ ".path";
1726 separator
= "webdeveloper.tool." + i
+ ".separator";
1727 url
= "webdeveloper.tool." + i
+ ".url";
1729 // If the first cell is a separator
1730 if(listCell
.tagName
== "separator")
1732 webdeveloper_optionsDataBoolean
[separator
] = true;
1736 webdeveloper_optionsDataString
[description
] = listCell
.getAttribute("label").trim();
1737 webdeveloper_optionsDataString
[key
] = listItem
.childNodes
[2].getAttribute("label").trim();
1739 // If the tool type equals application
1740 if(listCell
.getAttribute("type") == applicationType
)
1742 webdeveloper_optionsDataString
[path
] = listItem
.childNodes
[1].getAttribute("label").trim();
1744 else if(listCell
.getAttribute("type") == bookmarkletType
)
1746 webdeveloper_optionsDataString
[bookmarklet
] = listItem
.childNodes
[1].getAttribute("label").trim();
1750 webdeveloper_optionsDataString
[url
] = listItem
.childNodes
[1].getAttribute("label").trim();
1755 webdeveloper_optionsDataInteger
["webdeveloper.tool.count"] = toolCount
;
1757 else if(iFrameSrc
.indexOf("validation") != -1)
1759 var validateLocalCSSProfile
= "css21";
1761 // If the validate local CSS 3 radio button is selected
1762 if(pageDocument
.getElementById("webdeveloper-validate-local-css3-radio").selected
)
1764 validateLocalCSSProfile
= "css3";
1767 webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.accessibility.section508"] = pageDocument
.getElementById("webdeveloper.validate.local.accessibility.section508").checked
;
1768 webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.accessibility.wai.priority1"] = pageDocument
.getElementById("webdeveloper.validate.local.accessibility.wai.priority1").checked
;
1769 webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.accessibility.wai.priority2"] = pageDocument
.getElementById("webdeveloper.validate.local.accessibility.wai.priority2").checked
;
1770 webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.accessibility.wai.priority3"] = pageDocument
.getElementById("webdeveloper.validate.local.accessibility.wai.priority3").checked
;
1771 webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.html.show.outline"] = pageDocument
.getElementById("webdeveloper.validate.local.html.show.outline").checked
;
1772 webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.html.show.parse.tree"] = pageDocument
.getElementById("webdeveloper.validate.local.html.show.parse.tree").checked
;
1773 webdeveloper_optionsDataBoolean
["webdeveloper.validate.local.html.show.source"] = pageDocument
.getElementById("webdeveloper.validate.local.html.show.source").checked
;
1774 webdeveloper_optionsDataString
["webdeveloper.validate.local.css.profile"] = validateLocalCSSProfile
;
1776 else if(iFrameSrc
.indexOf("view_source") != -1)
1778 var viewSourceWithBox
= pageDocument
.getElementById("webdeveloper-listbox");
1779 var viewSourceWithCount
= viewSourceWithBox
.getRowCount();
1780 var viewSourceWithPreviousCount
= webdeveloper_getIntegerPreference("webdeveloper.view.source.with.count", true);
1782 // Loop through the previous view source with options
1783 for(i
= 1; i
<= viewSourceWithCount
|| i
<= viewSourceWithPreviousCount
; i
++)
1785 description
= "webdeveloper.view.source.with." + i
+ ".description";
1786 key
= "webdeveloper.view.source.with." + i
+ ".key";
1787 path
= "webdeveloper.view.source.with." + i
+ ".path";
1789 webdeveloper_optionsDataString
[description
] = "";
1790 webdeveloper_optionsDataString
[key
] = "";
1791 webdeveloper_optionsDataString
[path
] = "";
1794 // Loop through the possible view source with options
1795 for(i
= 1; i
<= viewSourceWithCount
; i
++)
1797 description
= "webdeveloper.view.source.with." + i
+ ".description";
1798 listItem
= viewSourceWithBox
.getItemAtIndex(i
- 1);
1799 childNodes
= listItem
.childNodes
;
1800 key
= "webdeveloper.view.source.with." + i
+ ".key";
1801 path
= "webdeveloper.view.source.with." + i
+ ".path";
1803 webdeveloper_optionsDataString
[description
] = listItem
.childNodes
[0].getAttribute("label").trim();
1804 webdeveloper_optionsDataString
[key
] = listItem
.childNodes
[2].getAttribute("label").trim();
1805 webdeveloper_optionsDataString
[path
] = listItem
.childNodes
[1].getAttribute("label").trim();
1808 webdeveloper_optionsDataBoolean
["webdeveloper.view.source.tab"] = pageDocument
.getElementById("webdeveloper.view.source.tab").checked
;
1809 webdeveloper_optionsDataInteger
["webdeveloper.view.source.with.count"] = viewSourceWithCount
;
1813 // Returns the index of the given page name
1814 function webdeveloper_translatePageNameToIndex(pageName
)
1816 // If the page name is set
1819 // Switch on the page name
1824 case "colors-fonts":
1830 case "miscellaneous":
1848 // Updates the tab option status
1849 function webdeveloper_updateTabOptionStatus()
1851 var disabled
= true;
1852 var pageDocument
= document
.getElementById("webdeveloper-options-iframe").contentDocument
;
1854 // If open tabs is checked
1855 if(pageDocument
.getElementById("webdeveloper.open.tabs").checked
)
1860 pageDocument
.getElementById("webdeveloper.open.tabs.background").disabled
= disabled
;