git-svn-id: svn://euphorik.ch/pompage@45 02bbb61a-6d21-0410-aba0-cb053bdfd66a
[pompage.git] / doc / webdeveloper / dialogs / outline_elements.js
diff --git a/doc/webdeveloper/dialogs/outline_elements.js b/doc/webdeveloper/dialogs/outline_elements.js
new file mode 100644 (file)
index 0000000..804dcb0
--- /dev/null
@@ -0,0 +1,52 @@
+// Cancels the outline elements
+function webdeveloper_cancelOutlineElements()
+{
+    window.opener.document.getElementById("webdeveloper-outline-custom-elements-menu").checked = false;
+
+    window.close();
+}
+
+// Initializes the outline elements dialog
+function webdeveloper_initializeOutlineElements()
+{
+    var color   = null;
+    var element = null;
+
+    // Loop through the possible custom elements
+       for(var i = 1; i <= 5; i++)
+       {
+           color   = "webdeveloper.custom." + i + ".color";
+           element = "webdeveloper.custom." + i + ".element";
+
+        // If the color is set
+        if(webdeveloper_isPreferenceSet(color))
+        {
+                   document.getElementById(color).color = webdeveloper_getStringPreference(color, true);
+               }
+
+        // If the element is set
+        if(webdeveloper_isPreferenceSet(element))
+        {
+                   document.getElementById(element).value = webdeveloper_getStringPreference(element, true);
+               }
+       }
+}
+
+// Saves the list of colors and elements to outline
+function webdeveloper_saveOutlineElements()
+{
+    var color   = null;
+    var element = null;
+
+    // Loop through the possible custom elements
+       for(var i = 1; i <= 5; i++)
+       {
+           color   = "webdeveloper.custom." + i + ".color";
+           element = "webdeveloper.custom." + i + ".element";
+
+        webdeveloper_setStringPreference(color, document.getElementById(color).color);
+        webdeveloper_setStringPreference(element, document.getElementById(element).value.trim());
+       }
+
+       window.arguments[0].push(true);
+}
\ No newline at end of file