diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-09-24 13:02:49 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-09-24 13:02:49 +0000 |
commit | 23206ee3c979cd22af0c7b9b97bedab6197d3852 (patch) | |
tree | 893a980fbd84985fe57ae6fb561a9376fdd66d7e | |
parent | 57e0c3075e5b458f89d4704020c88cce65f22ded (diff) |
* luci/themes/openwrt.org: added usability patch thanks Alina!
* luci/i18n: add additional strings needed for patch above
-rw-r--r-- | i18n/english/luasrc/i18n/default.en.lua | 3 | ||||
-rw-r--r-- | i18n/english/luasrc/i18n/default.en.xml | 4 | ||||
-rw-r--r-- | i18n/german/luasrc/i18n/default.de.lua | 3 | ||||
-rw-r--r-- | i18n/german/luasrc/i18n/default.de.xml | 5 | ||||
-rw-r--r-- | themes/openwrt.org/htdocs/luci-static/openwrt.org/Dropdowns.js | 160 | ||||
-rw-r--r-- | themes/openwrt.org/htdocs/luci-static/openwrt.org/VarType.js | 182 | ||||
-rw-r--r-- | themes/openwrt.org/htdocs/luci-static/openwrt.org/XHTML1.js | 542 | ||||
-rw-r--r-- | themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css | 303 | ||||
-rw-r--r-- | themes/openwrt.org/luasrc/view/themes/openwrt.org/footer.htm | 7 | ||||
-rw-r--r-- | themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm | 185 |
10 files changed, 1191 insertions, 203 deletions
diff --git a/i18n/english/luasrc/i18n/default.en.lua b/i18n/english/luasrc/i18n/default.en.lua index 6b8a3c744..1ad721afe 100644 --- a/i18n/english/luasrc/i18n/default.en.lua +++ b/i18n/english/luasrc/i18n/default.en.lua @@ -1,3 +1,6 @@ +skiplink1 = 'Skip to navigation' +skiplink2 = 'Skip to content' +navigation = 'Navigation' about = 'About' add = 'Add' addresses = 'Addresses' diff --git a/i18n/english/luasrc/i18n/default.en.xml b/i18n/english/luasrc/i18n/default.en.xml index 636c628c0..93f90116a 100644 --- a/i18n/english/luasrc/i18n/default.en.xml +++ b/i18n/english/luasrc/i18n/default.en.xml @@ -2,6 +2,10 @@ <i18n:msgs xmlns:i18n="http://luci.freifunk-halle.net/2008/i18n#" xmlns="http://www.w3.org/1999/xhtml"> +<i18n:msg xml:id="skiplink1">Skip to navigation</i18n:msg> +<i18n:msg xml:id="skiplink2">Skip to content</i18n:msg> +<i18n:msg xml:id="navigation">Navigation</i18n:msg> + <i18n:msg xml:id="about">About</i18n:msg> <i18n:msg xml:id="add">Add</i18n:msg> <i18n:msg xml:id="addresses">Addresses</i18n:msg> diff --git a/i18n/german/luasrc/i18n/default.de.lua b/i18n/german/luasrc/i18n/default.de.lua index 02f86d99f..b64bf379c 100644 --- a/i18n/german/luasrc/i18n/default.de.lua +++ b/i18n/german/luasrc/i18n/default.de.lua @@ -1,3 +1,6 @@ +skiplink1 = 'Zur Navigation springen' +skiplink2 = 'Zum Inhalt springen' +navigation = 'Navigation' about = 'Über' add = 'Hinzufügen' addresses = 'Adressen' diff --git a/i18n/german/luasrc/i18n/default.de.xml b/i18n/german/luasrc/i18n/default.de.xml index c77beb38f..6543ad3a2 100644 --- a/i18n/german/luasrc/i18n/default.de.xml +++ b/i18n/german/luasrc/i18n/default.de.xml @@ -2,6 +2,10 @@ <i18n:msgs xmlns:i18n="http://luci.freifunk-halle.net/2008/i18n#" xmlns="http://www.w3.org/1999/xhtml"> +<i18n:msg xml:id="skiplink1">Zur Navigation springen</i18n:msg> +<i18n:msg xml:id="skiplink2">Zum Inhalt springen</i18n:msg> +<i18n:msg xml:id="navigation">Navigation</i18n:msg> + <i18n:msg xml:id="about">Über</i18n:msg> <i18n:msg xml:id="add">Hinzufügen</i18n:msg> <i18n:msg xml:id="addresses">Adressen</i18n:msg> @@ -117,4 +121,5 @@ <i18n:msg xml:id="webui">Weboberfläche</i18n:msg> <i18n:msg xml:id="wifi">Drahtlos</i18n:msg> <i18n:msg xml:id="zone">Zone</i18n:msg> + </i18n:msgs> diff --git a/themes/openwrt.org/htdocs/luci-static/openwrt.org/Dropdowns.js b/themes/openwrt.org/htdocs/luci-static/openwrt.org/Dropdowns.js new file mode 100644 index 000000000..7d800f07b --- /dev/null +++ b/themes/openwrt.org/htdocs/luci-static/openwrt.org/Dropdowns.js @@ -0,0 +1,160 @@ +/* +Copyright (C) 2008 Alina Friedrichsen <x-alina@gmx.net> + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +*/ + +function initDropdowns() { + function onmouseover(evt) { + XHTML1.addClass(evt.currentTarget, "over"); + } + + function onmouseout(evt) { + XHTML1.removeClass(evt.currentTarget, "over"); + } + + function onfocus(evt) { + for(var element = evt.currentTarget; element; element = element.parentNode) { + if(XHTML1.isElement(element, "li")) { + XHTML1.addClass(element, "focus"); + } + } + } + + function onblur(evt) { + for(var element = evt.currentTarget; element; element = element.parentNode) { + if(XHTML1.isElement(element, "li")) { + XHTML1.removeClass(element, "focus"); + } + } + } + + if(document.all) { + var liElements = XHTML1.getElementsByTagName("li"); + for(var i = 0; i < liElements.length; i++) { + var li = liElements[i]; + for(var element = li.parentNode; element; element = element.parentNode) { + if(XHTML1.isElement(element, "ul") && XHTML1.containsClass(element, "dropdowns")) { + XHTML1.addEventListener(li, "mouseover", onmouseover); + XHTML1.addEventListener(li, "mouseout", onmouseout); + break; + } + } + } + } + + var aElements = XHTML1.getElementsByTagName("a"); + for(var i = 0; i < aElements.length; i++) { + var a = aElements[i]; + for(var element = a.parentNode; element; element = element.parentNode) { + if(XHTML1.isElement(element, "ul") && XHTML1.containsClass(element, "dropdowns")) { + XHTML1.addEventListener(a, "focus", onfocus); + XHTML1.addEventListener(a, "blur", onblur); + break; + } + } + } +} + +if(XHTML1.isDOMSupported()) { + XHTML1.addEventListener(window, "load", initDropdowns); +} +/* +Copyright (C) 2008 Alina Friedrichsen <x-alina@gmx.net> + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +*/ + +function initDropdowns() { + function onmouseover(evt) { + XHTML1.addClass(evt.currentTarget, "over"); + } + + function onmouseout(evt) { + XHTML1.removeClass(evt.currentTarget, "over"); + } + + function onfocus(evt) { + for(var element = evt.currentTarget; element; element = element.parentNode) { + if(XHTML1.isElement(element, "li")) { + XHTML1.addClass(element, "focus"); + } + } + } + + function onblur(evt) { + for(var element = evt.currentTarget; element; element = element.parentNode) { + if(XHTML1.isElement(element, "li")) { + XHTML1.removeClass(element, "focus"); + } + } + } + + if(document.all) { + var liElements = XHTML1.getElementsByTagName("li"); + for(var i = 0; i < liElements.length; i++) { + var li = liElements[i]; + for(var element = li.parentNode; element; element = element.parentNode) { + if(XHTML1.isElement(element, "ul") && XHTML1.containsClass(element, "dropdowns")) { + XHTML1.addEventListener(li, "mouseover", onmouseover); + XHTML1.addEventListener(li, "mouseout", onmouseout); + break; + } + } + } + } + + var aElements = XHTML1.getElementsByTagName("a"); + for(var i = 0; i < aElements.length; i++) { + var a = aElements[i]; + for(var element = a.parentNode; element; element = element.parentNode) { + if(XHTML1.isElement(element, "ul") && XHTML1.containsClass(element, "dropdowns")) { + XHTML1.addEventListener(a, "focus", onfocus); + XHTML1.addEventListener(a, "blur", onblur); + break; + } + } + } +} + +if(XHTML1.isDOMSupported()) { + XHTML1.addEventListener(window, "load", initDropdowns); +} diff --git a/themes/openwrt.org/htdocs/luci-static/openwrt.org/VarType.js b/themes/openwrt.org/htdocs/luci-static/openwrt.org/VarType.js new file mode 100644 index 000000000..12811dd4f --- /dev/null +++ b/themes/openwrt.org/htdocs/luci-static/openwrt.org/VarType.js @@ -0,0 +1,182 @@ +/* +Copyright (C) 2008 Alina Friedrichsen <x-alina@gmx.net> + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +*/ + +function VarType() { +} + +VarType.isNull = function(obj) { + if(typeof obj == "undefined") return true; + if(typeof obj == "object" && (!obj)) return true; + return false; +}; + +VarType.toFloat = function(value) { + value = Number(value); + return value; +}; + +VarType.toDecimal = function(value) { + value = Number(value); + if(!isFinite(value)) value = 0.0; + return value; +}; + +VarType.toInt = function(value) { + value = Number(value); + if(!isFinite(value)) value = 0.0; + value = Math.floor(value); + return value; +}; + +VarType.toUInt = function(value) { + value = Number(value); + if(!isFinite(value)) value = 0.0; + else if(value < 0.0) value = 0.0; + value = Math.floor(value); + return value; +}; + +VarType.toStr = function(value) { + if(VarType.isNull(value)) value = ""; + value = String(value); + return value; +}; + +VarType.toBool = function(value) { + value = Boolean(value); + return value; +}; + +VarType.needObject = function(obj) { + if(typeof obj != "object" || (!obj)) throw new TypeError(); +}; + +VarType.needInstanceOf = function(obj, type) { + if(!(obj instanceof type)) throw new TypeError(); +}; + +VarType.needFunction = function(obj) { + if(typeof obj != "function") throw new TypeError(); +}; + +VarType.needNode = function(obj, type) { + VarType.needObject(obj); + if(VarType.isNull(obj.nodeType)) throw new TypeError(); + if(!VarType.isNull(type)) { + type = VarType.toInt(type); + if(obj.nodeType != type) throw new TypeError(); + } +}; +/* +Copyright (C) 2008 Alina Friedrichsen <x-alina@gmx.net> + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +*/ + +function VarType() { +} + +VarType.isNull = function(obj) { + if(typeof obj == "undefined") return true; + if(typeof obj == "object" && (!obj)) return true; + return false; +}; + +VarType.toFloat = function(value) { + value = Number(value); + return value; +}; + +VarType.toDecimal = function(value) { + value = Number(value); + if(!isFinite(value)) value = 0.0; + return value; +}; + +VarType.toInt = function(value) { + value = Number(value); + if(!isFinite(value)) value = 0.0; + value = Math.floor(value); + return value; +}; + +VarType.toUInt = function(value) { + value = Number(value); + if(!isFinite(value)) value = 0.0; + else if(value < 0.0) value = 0.0; + value = Math.floor(value); + return value; +}; + +VarType.toStr = function(value) { + if(VarType.isNull(value)) value = ""; + value = String(value); + return value; +}; + +VarType.toBool = function(value) { + value = Boolean(value); + return value; +}; + +VarType.needObject = function(obj) { + if(typeof obj != "object" || (!obj)) throw new TypeError(); +}; + +VarType.needInstanceOf = function(obj, type) { + if(!(obj instanceof type)) throw new TypeError(); +}; + +VarType.needFunction = function(obj) { + if(typeof obj != "function") throw new TypeError(); +}; + +VarType.needNode = function(obj, type) { + VarType.needObject(obj); + if(VarType.isNull(obj.nodeType)) throw new TypeError(); + if(!VarType.isNull(type)) { + type = VarType.toInt(type); + if(obj.nodeType != type) throw new TypeError(); + } +}; diff --git a/themes/openwrt.org/htdocs/luci-static/openwrt.org/XHTML1.js b/themes/openwrt.org/htdocs/luci-static/openwrt.org/XHTML1.js new file mode 100644 index 000000000..b196f5313 --- /dev/null +++ b/themes/openwrt.org/htdocs/luci-static/openwrt.org/XHTML1.js @@ -0,0 +1,542 @@ +/* +Copyright (C) 2007, 2008 Alina Friedrichsen <x-alina@gmx.net> + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +*/ + +var XMLNS_XMLNS = "http://www.w3.org/2000/xmlns/"; +var XMLNS_XML = "http://www.w3.org/XML/1998/namespace"; +var XMLNS_XHTML = "http://www.w3.org/1999/xhtml"; + +function W3CDOM_Event(currentTarget) { + VarType.needObject(currentTarget); + this.currentTarget = currentTarget; + this.preventDefault = function() { window.event.returnValue = false; }; + return this; +} + +function XHTML1() { +} + +XHTML1.isDOMSupported = function() { + if(!document.getElementById) return false; + if(!(window.addEventListener || window.attachEvent)) return false; + return true; +}; + +XHTML1.isXHTML = function() { + if(document.documentElement.nodeName == "HTML") return false; + return true; +}; + +XHTML1.addEventListener = function(target, type, listener) { + VarType.needObject(target); + type = VarType.toStr(type); + VarType.needFunction(listener); + + if(target.addEventListener) { + target.addEventListener(type, listener, false); + } + else if(target.attachEvent) { + target.attachEvent("on" + type, function() { listener(new W3CDOM_Event(target)); } ); + } +}; + +XHTML1.createElement = function(tagName) { + tagName = VarType.toStr(tagName); + + if(XHTML1.isXHTML()) { + return document.createElementNS(XMLNS_XHTML, tagName.toLowerCase()); + } + + return document.createElement(tagName.toUpperCase()); +}; + +XHTML1.getElementsByTagName = function(tagName) { + tagName = VarType.toStr(tagName); + + if(XHTML1.isXHTML()) { + return document.getElementsByTagNameNS(XMLNS_XHTML, tagName.toLowerCase()); + } + + return document.getElementsByTagName(tagName.toUpperCase()); +}; + +XHTML1.isElement = function(node, tagName) { + VarType.needNode(node); + tagName = VarType.toStr(tagName); + + if(node.nodeType == 1) { + if(XHTML1.isXHTML()) { + if(node.namespaceURI == XMLNS_XHTML) { + if(node.localName == tagName.toLowerCase()) return true; + } + } else { + if(node.nodeName == tagName.toUpperCase()) return true; + } + } + + return false; +}; + +XHTML1.getAttribute = function(element, name) { + VarType.needNode(element, 1); + name = VarType.toStr(name); + + name = name.toLowerCase(); + + if(XHTML1.isXHTML()) { + return element.getAttributeNS(null, name); + } + + if(name == "class") { + return element.className; + } + + return element.getAttribute(name); +}; + +XHTML1.setAttribute = function(element, name, value) { + VarType.needNode(element, 1); + name = VarType.toStr(name); + value = VarType.toStr(value); + + name = name.toLowerCase(); + + if(XHTML1.isXHTML()) { + element.setAttributeNS(null, name, value); + return; + } + + if(name == "class") { + element.className = value; + return; + } + + element.setAttribute(name, value); +}; + +XHTML1.removeAttribute = function(element, name) { + VarType.needNode(element, 1); + name = VarType.toStr(name); + + name = name.toLowerCase(); + + if(XHTML1.isXHTML()) { + element.removeAttributeNS(null, name); + return; + } + + if(name == "class") { + element.className = ""; + return; + } + + element.removeAttribute(name); +}; + +XHTML1.containsClass = function(element, className) { + VarType.needNode(element, 1); + className = VarType.toStr(className).replace(/^\s+/g, "").replace(/\s+$/g, ""); + + var classString = XHTML1.getAttribute(element, "class").replace(/\s+/g, " ").replace(/^\s+/g, "").replace(/\s+$/g, ""); + var classArray = classString.split(" "); + for(var i = 0; i < classArray.length; i++) { + if(classArray[i] == className) return true; + } + + return false; +}; + +XHTML1.addClass = function(element, className) { + VarType.needNode(element, 1); + className = VarType.toStr(className).replace(/^\s+/g, "").replace(/\s+$/g, ""); + + var classString = XHTML1.getAttribute(element, "class").replace(/\s+/g, " ").replace(/^\s+/g, "").replace(/\s+$/g, ""); + var classArray = classString.split(" "); + classString = ""; + for(var i = 0; i < classArray.length; i++) { + if(classArray[i] != className) { + if(classString == "") classString = classArray[i]; + else classString += " " + classArray[i]; + } + } + + if(classString == "") classString = className; + else classString += " " + className; + + XHTML1.setAttribute(element, "class", classString); +}; + +XHTML1.removeClass = function(element, className) { + VarType.needNode(element, 1); + className = VarType.toStr(className).replace(/^\s+/g, "").replace(/\s+$/g, ""); + + var classString = XHTML1.getAttribute(element, "class").replace(/\s+/g, " ").replace(/^\s+/g, "").replace(/\s+$/g, ""); + var classArray = classString.split(" "); + classString = ""; + for(var i = 0; i < classArray.length; i++) { + if(classArray[i] != className) { + if(classString == "") classString = classArray[i]; + else classString += " " + classArray[i]; + } + } + + XHTML1.setAttribute(element, "class", classString); +}; + +XHTML1.removeAllChildren = function(node) { + VarType.needNode(node); + + while(node.lastChild) { + node.removeChild(node.lastChild); + } +}; + +XHTML1.getTextContent = function(node) { + VarType.needNode(node); + + if(typeof node.textContent != "undefined") { + return node.textContent; + } + + switch(node.nodeType) { + case 1: + case 2: + case 5: + case 6: + case 11: + var textContent = ""; + for(node = node.firstChild; node; node = node.nextSibling) { + if(node.nodeType == 7) continue; + if(node.nodeType == 8) continue; + textContent += VarType.toStr(XHTML1.getTextContent(node)); + } + return textContent; + case 3: + case 4: + case 7: + case 8: + return node.nodeValue; + } + + return null; +}; + +XHTML1.setTextContent = function(node, value) { + VarType.needNode(node); + value = VarType.toStr(value); + + if(typeof node.textContent != "undefined") { + node.textContent = value; + } + + switch(node.nodeType) { + case 1: + case 2: + case 5: + case 6: + case 11: + XHTML1.removeAllChildren(node); + if(value != "") { + node.appendChild(document.createTextNode(value)); + } + break; + case 3: + case 4: + case 7: + case 8: + node.nodeValue = value; + break; + } +}; +/* +Copyright (C) 2007, 2008 Alina Friedrichsen <x-alina@gmx.net> + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +*/ + +var XMLNS_XMLNS = "http://www.w3.org/2000/xmlns/"; +var XMLNS_XML = "http://www.w3.org/XML/1998/namespace"; +var XMLNS_XHTML = "http://www.w3.org/1999/xhtml"; + +function W3CDOM_Event(currentTarget) { + VarType.needObject(currentTarget); + this.currentTarget = currentTarget; + this.preventDefault = function() { window.event.returnValue = false; }; + return this; +} + +function XHTML1() { +} + +XHTML1.isDOMSupported = function() { + if(!document.getElementById) return false; + if(!(window.addEventListener || window.attachEvent)) return false; + return true; +}; + +XHTML1.isXHTML = function() { + if(document.documentElement.nodeName == "HTML") return false; + return true; +}; + +XHTML1.addEventListener = function(target, type, listener) { + VarType.needObject(target); + type = VarType.toStr(type); + VarType.needFunction(listener); + + if(target.addEventListener) { + target.addEventListener(type, listener, false); + } + else if(target.attachEvent) { + target.attachEvent("on" + type, function() { listener(new W3CDOM_Event(target)); } ); + } +}; + +XHTML1.createElement = function(tagName) { + tagName = VarType.toStr(tagName); + + if(XHTML1.isXHTML()) { + return document.createElementNS(XMLNS_XHTML, tagName.toLowerCase()); + } + + return document.createElement(tagName.toUpperCase()); +}; + +XHTML1.getElementsByTagName = function(tagName) { + tagName = VarType.toStr(tagName); + + if(XHTML1.isXHTML()) { + return document.getElementsByTagNameNS(XMLNS_XHTML, tagName.toLowerCase()); + } + + return document.getElementsByTagName(tagName.toUpperCase()); +}; + +XHTML1.isElement = function(node, tagName) { + VarType.needNode(node); + tagName = VarType.toStr(tagName); + + if(node.nodeType == 1) { + if(XHTML1.isXHTML()) { + if(node.namespaceURI == XMLNS_XHTML) { + if(node.localName == tagName.toLowerCase()) return true; + } + } else { + if(node.nodeName == tagName.toUpperCase()) return true; + } + } + + return false; +}; + +XHTML1.getAttribute = function(element, name) { + VarType.needNode(element, 1); + name = VarType.toStr(name); + + name = name.toLowerCase(); + + if(XHTML1.isXHTML()) { + return element.getAttributeNS(null, name); + } + + if(name == "class") { + return element.className; + } + + return element.getAttribute(name); +}; + +XHTML1.setAttribute = function(element, name, value) { + VarType.needNode(element, 1); + name = VarType.toStr(name); + value = VarType.toStr(value); + + name = name.toLowerCase(); + + if(XHTML1.isXHTML()) { + element.setAttributeNS(null, name, value); + return; + } + + if(name == "class") { + element.className = value; + return; + } + + element.setAttribute(name, value); +}; + +XHTML1.removeAttribute = function(element, name) { + VarType.needNode(element, 1); + name = VarType.toStr(name); + + name = name.toLowerCase(); + + if(XHTML1.isXHTML()) { + element.removeAttributeNS(null, name); + return; + } + + if(name == "class") { + element.className = ""; + return; + } + + element.removeAttribute(name); +}; + +XHTML1.containsClass = function(element, className) { + VarType.needNode(element, 1); + className = VarType.toStr(className).replace(/^\s+/g, "").replace(/\s+$/g, ""); + + var classString = XHTML1.getAttribute(element, "class").replace(/\s+/g, " ").replace(/^\s+/g, "").replace(/\s+$/g, ""); + var classArray = classString.split(" "); + for(var i = 0; i < classArray.length; i++) { + if(classArray[i] == className) return true; + } + + return false; +}; + +XHTML1.addClass = function(element, className) { + VarType.needNode(element, 1); + className = VarType.toStr(className).replace(/^\s+/g, "").replace(/\s+$/g, ""); + + var classString = XHTML1.getAttribute(element, "class").replace(/\s+/g, " ").replace(/^\s+/g, "").replace(/\s+$/g, ""); + var classArray = classString.split(" "); + classString = ""; + for(var i = 0; i < classArray.length; i++) { + if(classArray[i] != className) { + if(classString == "") classString = classArray[i]; + else classString += " " + classArray[i]; + } + } + + if(classString == "") classString = className; + else classString += " " + className; + + XHTML1.setAttribute(element, "class", classString); +}; + +XHTML1.removeClass = function(element, className) { + VarType.needNode(element, 1); + className = VarType.toStr(className).replace(/^\s+/g, "").replace(/\s+$/g, ""); + + var classString = XHTML1.getAttribute(element, "class").replace(/\s+/g, " ").replace(/^\s+/g, "").replace(/\s+$/g, ""); + var classArray = classString.split(" "); + classString = ""; + for(var i = 0; i < classArray.length; i++) { + if(classArray[i] != className) { + if(classString == "") classString = classArray[i]; + else classString += " " + classArray[i]; + } + } + + XHTML1.setAttribute(element, "class", classString); +}; + +XHTML1.removeAllChildren = function(node) { + VarType.needNode(node); + + while(node.lastChild) { + node.removeChild(node.lastChild); + } +}; + +XHTML1.getTextContent = function(node) { + VarType.needNode(node); + + if(typeof node.textContent != "undefined") { + return node.textContent; + } + + switch(node.nodeType) { + case 1: + case 2: + case 5: + case 6: + case 11: + var textContent = ""; + for(node = node.firstChild; node; node = node.nextSibling) { + if(node.nodeType == 7) continue; + if(node.nodeType == 8) continue; + textContent += VarType.toStr(XHTML1.getTextContent(node)); + } + return textContent; + case 3: + case 4: + case 7: + case 8: + return node.nodeValue; + } + + return null; +}; + +XHTML1.setTextContent = function(node, value) { + VarType.needNode(node); + value = VarType.toStr(value); + + if(typeof node.textContent != "undefined") { + node.textContent = value; + } + + switch(node.nodeType) { + case 1: + case 2: + case 5: + case 6: + case 11: + XHTML1.removeAllChildren(node); + if(value != "") { + node.appendChild(document.createTextNode(value)); + } + break; + case 3: + case 4: + case 7: + case 8: + node.nodeValue = value; + break; + } +}; diff --git a/themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css b/themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css index 3f44f202e..1deec09cf 100644 --- a/themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css +++ b/themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css @@ -1,7 +1,6 @@ -* { - margin: 0; - padding: 0; -} +@charset "utf-8"; + +@media all { body { background-color: #4a6b7c; @@ -15,27 +14,58 @@ body { line-height: 100%; } +* { + margin: 0; + padding: 0; +} + +abbr, +acronym { + font-style: normal; + font-variant: normal; +} + +abbr[title], +acronym[title] { + border-bottom: 1px dotted; + cursor: help; +} + +a:link abbr[title], +a:visited abbr[title], +a:link acronym[title], +a:visited acronym[title] { + cursor: pointer; +} + code { font-family: monospace; white-space: pre; } -div#content ul { +#maincontent ul { margin-left: 2em; } .warning { - color: red !important; + color: red; font-weight: bold; } .clear { clear: both; - height: 1px; } +.skiplink, +.navigation, .hidden { - display: none; + position: absolute; + left: -1000px; + top: -1000px; + width: 0px; + height: 0px; + overflow: hidden; + display: inline; } .error { @@ -51,110 +81,220 @@ div#content ul { text-align: right; } -#header .info { - padding: 1em 1em; +#header h1 { + padding: 1em 1em 0 1em; +} + +#header p { + padding: 0 1em 1em 1em; +} + +#header h1, +#header p { font-size: 70%; + font-weight: normal; line-height: 160%; + text-align: right; } -#header .title { - display: none; +ul.dropdowns { + float: left; + margin: 0; + padding: 0; + width: auto; + list-style: none; } -.pathbar { - display: none; +html>body ul.dropdowns { + position: relative; } -.menubar { +ul.dropdowns li, +ul.dropdowns ul { + margin: 0; + padding: 0; + list-style: none; +} + +ul.dropdowns li { + float: left; + position: relative; + white-space: nowrap; +} + +ul.dropdowns li ul { + position: absolute; + z-index: 1000; + top: auto; + width: 10em; +} + +ul.dropdowns li li { + clear: both; + position: relative; + width: 100%; +} + +ul.dropdowns li a { + display: block; +} + +ul.dropdowns li>a { + overflow: hidden; +} + +* html ul.dropdowns li li a { + height: 1%; +} + +ul.dropdowns ul li ul { + top: 0; +} + +ul.dropdowns li ul, +ul.dropdowns li.over ul ul, +ul.dropdowns li.focus ul ul, +ul.dropdowns li:hover ul ul { + left: -1000px; +} + +ul.dropdowns li.over ul, +ul.dropdowns li.focus ul, +ul.dropdowns li:hover ul { + left: 0; +} + +ul.dropdowns ul li.over ul, +ul.dropdowns ul li.focus ul, +ul.dropdowns ul li:hover ul { + left: 100%; +} + +#menubar { + position: relative; width: 100%; - min-height: 1.8em; background: #000000; color: #ffffff; } -.mainmenu { - float: left; - width: auto; +#menubar ul.dropdowns { min-height: 1.8em; background: #000000; color: #ffffff; } -.mainmenu div { - float: left; -} - -.mainmenu li { - white-space: nowrap; -} - -.mainmenu div ul { - display: none; - position: absolute; +#menubar ul.dropdowns li ul { background: #000000; color: #ffffff; border-width: 0 1px 1px 1px; border-style: solid; border-color: #444444; - list-style-type: none; -} - -.mainmenu ul li:hover > ul, -.mainmenu div:hover > ul { - display: block; } -.mainmenu ul li > ul { - left: 100%; - margin-top: -1.8em; +#menubar ul.dropdowns ul li ul { border-width: 1px; } -.modemenu a, -.mainmenu a { +html #menubar a:link, +html #menubar a:visited { display: block; padding: 0.5em; + background: #000000; color: #ffffff; text-decoration: none; font-size: 80%; + font-weight: normal; } -.mainmenu .active a, -.modemenu .active a { + +html #menubar a:link:hover, +html #menubar a:visited:hover, +html #menubar a:link:active, +html #menubar a:visited:active, +#menubar a:link:focus, +#menubar a:visited:focus { + background: #000000; color: #ffff00; font-weight: bold; } -.mainmenu li:hover > span > a, -.mainmenu div:hover > a { +html #menubar a:link.active, +html #menubar a:visited.active, +html #menubar a:link.preactive, +html #menubar a:visited.preactive { + background: #000000; + color: #ffff00; font-weight: bold; } -.modemenu a:hover, -.modemenu a:focus, -.mainmenu a:hover, -.mainmenu a:focus { - color: #ffff00; +html #menubar a:link.warning, +html #menubar a:visited.warning { + background: #000000; + color: red; font-weight: bold; } -.mainmenu div.preactive > a { - color: #ffff00; +#menubar ul.dropdowns li.over>a, +#menubar ul.dropdowns li.focus>a, +#menubar ul.dropdowns li:hover>a { font-weight: bold; } -.modemenu ul { +.lang_ru #submenu_admin_index { + width: 15.5em; +} + +.lang_ru #submenu_admin_status { + width: 10.5em; +} + +.lang_de #submenu_admin_system { + width: 13.3em; +} + +.lang_fr #submenu_admin_system { + width: 14.5em; +} + +.lang_ru #submenu_admin_system { + width: 18em; +} + +.lang_ru #submenu_admin_network_routes { + width: 15.3em; +} + +.lang_de #submenu_admin_network_firewall { + width: 12em; +} + +#modemenu { width: auto; background: #000000; color: #ffffff; - list-style-type: none; + list-style: none; + margin-right: 1px; } -.modemenu li { +#modemenu li { float: right; + list-style: none; +} + +#savemenu { + float: right; + margin-right: 2em; +} + +.lang_de #submenu_admin_uci { + width: 12em; } -#content { +.lang_ru #submenu_admin_uci { + width: 11.5em; +} + +#maincontent { clear: both; width: 80%; margin: 0 auto; @@ -167,20 +307,20 @@ div#content ul { font-size: 80%; } -#content h1 { +#maincontent h1 { margin: 0.25em 0 0.5em 0; font-size: 150%; font-weight: normal; } -#content h2 { +#maincontent h2 { margin: 0.5em 0; font-size: 120%; font-weight: normal; text-decoration: underline; } -#content p { +#maincontent p { margin-bottom: 1em; } @@ -508,7 +648,8 @@ td.cbi-value-error { text-align: right; } -.luci a { +.luci a:link, +.luci a:visited { color: #666666; text-decoration: none; font-size: 70%; @@ -539,19 +680,20 @@ td.cbi-value-error { } #memfree { - background-color:green; + background-color: green; } #membuffers { - background-color:yellow; + background-color: yellow; } #memcached { - background-color:orange; + background-color: orange; } /* obligatory IE6 Voodoo Code */ + * html body { padding-left: 50% !important; } @@ -560,45 +702,18 @@ td.cbi-value-error { margin-left: -100% !important; } -* html div.menubar { +* html div#menubar { margin-left: -100% !important; width: 200% !important; } -* html div#content { +* html div#maincontent { margin-left: -80% !important; width: 160% !important; } -* html div.mainmenu div.hover ul, -* html div.mainmenu div li.hover ul, -* html div.mainmenu div li li.hover ul, -* html div.mainmenu div li li li.hover ul, -* html div.mainmenu div li li li li.hover ul { - display: block !important; - margin-left: 3em; -} - -* html div.mainmenu div.hover ul { - margin-left: 0; -} - -* html div.mainmenu .hover ul ul, -* html div.mainmenu .hover ul ul ul, -* html div.mainmenu .hover ul ul ul ul, -* html div.mainmenu .hover ul ul ul ul ul { - display: none !important; -} - -* html div.mainmenu li { - height: 1em !important; - width: 10em !important; -} - -* html .mainmenu { - height: 1.8em; -} - * html div.cbi-value-description { margin-left: 40%; } + +} diff --git a/themes/openwrt.org/luasrc/view/themes/openwrt.org/footer.htm b/themes/openwrt.org/luasrc/view/themes/openwrt.org/footer.htm index c1d4dfccb..f8ea5ad57 100644 --- a/themes/openwrt.org/luasrc/view/themes/openwrt.org/footer.htm +++ b/themes/openwrt.org/luasrc/view/themes/openwrt.org/footer.htm @@ -12,9 +12,10 @@ You may obtain a copy of the License at $Id$ -%> - <br class="clear" /> - </div> +<div class="clear"></div> +</div> - <div class="luci separator black whitetext bold"><a href="<%=controller%>/about">Powered by <%= luci.__appname__ .. " " .. luci.__version__%></a></div> +<p class="luci"><a href="<%=controller%>/about">Powered by <%= luci.__appname__ .. " " .. luci.__version__%></a></p> </body> </html> + diff --git a/themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm b/themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm index 6e460d5b0..05ee94ffb 100644 --- a/themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm +++ b/themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm @@ -34,64 +34,39 @@ require("luci.i18n").loadc("default") require("luci.http").prepare_content("application/xhtml+xml") -%> - <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%=luci.config.main.lang%>" lang="<%=luci.config.main.lang%>"> <head> - <link rel="stylesheet" type="text/css" href="<%=media%>/cascade.css" /> - <% if node and node.css then %><link rel="stylesheet" type="text/css" href="<%=resource%>/<%=node.css%>" /><% end %> - <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> - <meta http-equiv="content-script-type" content="text/javascript" /> - <title><%=striptags( hostname .. ( (node and node.title) and ' - ' .. node.title or '')) %> - LuCI</title> - - <!--[if lt IE 7]> - <script type="text/javascript"> - function setup_hover() { - function ie_hover(e) { - e.onmouseover = function() { this.className = "hover" } - e.onmouseout = function() { this.className = null } - } - - var lis = document.getElementById("mainmenu").getElementsByTagName("LI"); - var divs = document.getElementById("mainmenu").getElementsByTagName("DIV"); - - for( var i = 0; i < lis.length; i++ ) ie_hover( lis[i] ); - for( var i = 0; i < divs.length; i++ ) ie_hover( divs[i] ); - } - </script> - <![endif]--> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta http-equiv="Content-Script-Type" content="text/javascript" /> +<link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" /> +<% if node and node.css then %><link rel="stylesheet" type="text/css" media="screen" href="<%=resource%>/<%=node.css%>" /> +<% end -%> +<script type="text/javascript" src="<%=media%>/VarType.js"></script> +<script type="text/javascript" src="<%=media%>/XHTML1.js"></script> +<script type="text/javascript" src="<%=media%>/Dropdowns.js"></script> +<title><%=striptags( hostname .. ( (node and node.title) and ' - ' .. node.title or '')) %> - LuCI</title> </head> -<body onload="window.setup_hover && setup_hover()"> -<div id="header"> - <div class="info whitetext smalltext bold right"> - <%=luci.config.brand.firmware%><br /> - <%=luci.config.brand.distro%><br /> - <%:load%>: <%=load1%> <%=load5%> <%=load15%><br /> - <%:hostname%>: <%=hostname%> - </div> - <div class="title"> - <span class="headertitle"><%=luci.config.brand.title%></span><br /> - <span class="whitetext bold"><%=luci.config.brand.subtitle%></span> - </div> -</div> +<body class="lang_<%=luci.config.main.lang%>"> -<div class="pathbar separator black whitetext bold"> -<%:path%>: <% -local c = tree -local url = controller -for k,v in pairs(request) do - if c.nodes and c.nodes[v] then - c = c.nodes[v] - url = url .. "/" .. v - %><a href="<%=url%>"><%=c.title or v%></a> <% if k ~= #request then %>» <% end - end -end -%> +<p class="skiplink"> +<span id="skiplink1"><a href="#navigation"><%:skiplink1 Skip to navigation%></a></span> +<span id="skiplink2"><a href="#content"><%:skiplink2 Skip to content%></a></span> +</p> + +<div id="header"> +<h1><%=luci.config.brand.firmware%></h1> +<p> +<%=luci.config.brand.distro%><br /> +<%:load%>: <%=load1%> <%=load5%> <%=load15%><br /> +<%:hostname%>: <%=hostname%> +</p> </div> -<div class="menubar"> - <div id="mainmenu" class="mainmenu"> +<div id="menubar"> +<h2 class="navigation"><a id="navigation" name="navigation"><%:navigation Navigation%></a></h2> +<ul id="mainmenu" class="dropdowns"> <%- local function submenu(prefix, node) if not node.nodes or node.hidden then @@ -110,21 +85,23 @@ local function submenu(prefix, node) if count > 0 then %> - <ul> - <%- for j, v in pairs(index) do - if #v.name > 0 then - local nnode = node.nodes[v.name] - local href = controller .. prefix .. v.name - href = (nnode.query) and href .. luci.http.build_querystring(nnode.query) or href - %> - <li> - <span<% if nnode._menu_selected then %> class="active"<%end%>><a href="<%=luci.util.pcdata(href)%>"><%=nnode.title%></a></span> - <%- submenu(prefix .. v.name .. "/", nnode) %> - </li> - <%- end %> - <%- end %> - </ul> +<ul id="submenu_<%=string.gsub(string.gsub(prefix, "/", "_"), "^_(.-)_$", "%1")%>"> +<%- + for j, v in pairs(index) do + if #v.name > 0 then + local nnode = node.nodes[v.name] + local href = controller .. prefix .. v.name .. "/" + href = (nnode.query) and href .. luci.http.build_querystring(nnode.query) or href +%> +<li><a<% if nnode._menu_selected then %> class="active"<%end%> href="<%=luci.util.pcdata(href)%>"><%=nnode.title%></a><%- +submenu(prefix .. v.name .. "/", nnode) +%></li> <%- + end + end +%> +</ul> +<% end end @@ -139,49 +116,45 @@ if cattree and cattree.nodes then for i, k in ipairs(index) do node = cattree.nodes[k.name] if node.title and node.target and not node.hidden then - local href = controller.."/"..category.."/"..k.name - href = (k.query) and href .. luci.http.build_querystring(k.query) or href %> - <div<% if node._menu_selected then %> class="preactive"<%end%>><a href="<%=href%>"><%=node.title%></a> - <%submenu("/" .. category .. "/" .. k.name .. "/", node)%> - </div> -<% end + local href = controller.."/"..category.."/"..k.name.."/" + href = (k.query) and href .. luci.http.build_querystring(k.query) or href +%> +<li><a<% if node._menu_selected then %> class="preactive"<%end%> href="<%=href%>"><%=node.title%></a><% +submenu("/" .. category .. "/" .. k.name .. "/", node) +%></li><% end + end +end +%> +</ul> + +<ul id="modemenu"><% +for k,node in pairs(tree.nodes) do + if node.title and not node.hidden then %> +<li><a<% if request[1] == k then %> class="active"<%end%> href="<%=controller%>/<%=k%>/"><%=node.title%></a></li><% end end %> - </div> - <div class="modemenu"> - <ul><% - for k,node in pairs(tree.nodes) do - if node.title and not node.hidden then %> - <li<% if request[1] == k then %> class="active"<%end%>><a href="<%=controller%>/<%=k%>"><%=node.title%></a></li> -<% end - end%> - </ul> - </div> - - <% - if tree.nodes[category] and tree.nodes[category].ucidata then - local ucic = 0 - for i, j in pairs(require("luci.model.uci").cursor():changes()) do - for k, l in pairs(j) do - for m, n in pairs(l) do - ucic = ucic + 1; - end - end +</ul> + +<% +if tree.nodes[category] and tree.nodes[category].ucidata then + local ucic = 0 + for i, j in pairs(require("luci.model.uci").cursor():changes()) do + for k, l in pairs(j) do + for m, n in pairs(l) do + ucic = ucic + 1; end - %> - <div class="mainmenu" style="float:right; margin-right:2em"> - <div> - <% if ucic > 0 then %> - <a class="warning" href="<%=controller%>/<%=category%>/uci/changes"><%:unsavedchanges%>: <%=ucic%></a> - <% submenu("/" .. category .. "/uci/", tree.nodes[category].nodes["uci"]) -%> - <% else %> - <a href="#"><%:changes%>: 0</a> - <% end %> - </div> - </div> - <% end %> - - <br class="clear" /> + end + end +-%> +<ul id="savemenu" class="dropdowns"> +<li><% if ucic > 0 then %><a class="warning" href="<%=controller%>/<%=category%>/uci/changes/"><%:unsavedchanges%>: <%=ucic%></a><% +submenu("/" .. category .. "/uci/", tree.nodes[category].nodes["uci"]) +else -%> +<a href="#"><%:changes%>: 0</a><% end -%> +</li> +</ul><% end %> + +<div class="clear"></div> </div> -<div id="content"> +<div id="maincontent"> |