endef
### Themes ###
+define Package/luci-theme-base
+ $(call Package/luci/thtemplate)
+ DEPENDS:=+luci-web
+ TITLE:=Common base for all themes
+endef
+
+define Package/luci-theme-base/install
+ $(call Package/luci/install/template,$(1),themes/base)
+endef
+
define Package/luci-theme-fledermaus
$(call Package/luci/fftemplate)
DEPENDS:=+luci-web
define Package/luci-theme-openwrt
$(call Package/luci/thtemplate)
TITLE:=OpenWRT.org (default)
+ DEPENDS:=+luci-theme-base
endef
define Package/luci-theme-openwrt/install
define Package/luci-theme-openwrtlight
$(call Package/luci/thtemplate)
TITLE:=OpenWRT.org - light variant without images
+ DEPENDS:=+luci-theme-base
endef
define Package/luci-theme-openwrtlight/install
PKG_SELECTED_MODULES+=libs/sgi-webuci
endif
+ifneq ($(CONFIG_PACKAGE_luci-theme-base),)
+ PKG_SELECTED_MODULES+=themes/base
+endif
ifneq ($(CONFIG_PACKAGE_luci-theme-fledermaus),)
PKG_SELECTED_MODULES+=themes/fledermaus
endif
$(eval $(call BuildPackage,luci-sgi-luci))
$(eval $(call BuildPackage,luci-sgi-webuci))
+$(eval $(call BuildPackage,luci-theme-base))
$(eval $(call BuildPackage,luci-theme-fledermaus))
$(eval $(call BuildPackage,luci-theme-freifunk))
$(eval $(call BuildPackage,luci-theme-freifunk-bno))
--- /dev/null
+include ../../build/config.mk
+include ../../build/module.mk
\ No newline at end of file
--- /dev/null
+/*
+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() {
+ var aSelects = XHTML1.getElementsByTagName("select");
+ var isIE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
+
+ function showPlaceholder(sel) {
+ if( ! sel._ph ) {
+ var box = sel.getBoundingClientRect();
+ sel._dm = sel.currentStyle.display;
+ sel._ph = document.createElement('input');
+ sel.parentNode.insertBefore(sel._ph, sel);
+ sel._ph.style.width = ( box.right - box.left ) + 'px';
+ sel._ph.style.height = ( box.bottom - box.top ) + 'px';
+ sel._ph.style.margin = sel.currentStyle.margin;
+ }
+
+ sel._ph.value = sel.options[sel.selectedIndex].text;
+ sel._ph.style.display = sel._dm;
+ sel.style.display = 'none';
+ }
+
+ function hidePlaceholder(sel) {
+ if( sel._ph ) sel._ph.style.display = 'none';
+ sel.style.display = sel._dm;
+ }
+
+ function hideSelects() {
+ for(var i = 0; i < aSelects.length; i++) {
+ showPlaceholder(aSelects[i]);
+ }
+ }
+
+ function showSelects() {
+ for(var i = 0; i < aSelects.length; i++) {
+ hidePlaceholder(aSelects[i]);
+ }
+ }
+
+ function onmouseover(evt) {
+ XHTML1.addClass(evt.currentTarget, "over");
+ if( isIE6 ) hideSelects();
+ }
+
+ function onmouseout(evt) {
+ XHTML1.removeClass(evt.currentTarget, "over");
+ if( isIE6 ) showSelects();
+ }
+
+ function onfocus(evt) {
+ for(var element = evt.currentTarget; element; element = element.parentNode) {
+ if(XHTML1.isElement(element, "li")) {
+ XHTML1.addClass(element, "focus");
+ }
+ }
+ if( isIE6 ) hideSelects();
+ }
+
+ function onblur(evt) {
+ for(var element = evt.currentTarget; element; element = element.parentNode) {
+ if(XHTML1.isElement(element, "li")) {
+ XHTML1.removeClass(element, "focus");
+ }
+ }
+ if( isIE6 ) showSelects();
+ }
+
+ 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);
+}
--- /dev/null
+/*
+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();
+ }
+};
--- /dev/null
+/*
+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;
+ }
+};
+++ /dev/null
-/*
-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() {
- var aSelects = XHTML1.getElementsByTagName("select");
- var isIE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
-
- function showPlaceholder(sel) {
- if( ! sel._ph ) {
- var box = sel.getBoundingClientRect();
- sel._dm = sel.currentStyle.display;
- sel._ph = document.createElement('input');
- sel.parentNode.insertBefore(sel._ph, sel);
- sel._ph.style.width = ( box.right - box.left ) + 'px';
- sel._ph.style.height = ( box.bottom - box.top ) + 'px';
- sel._ph.style.margin = sel.currentStyle.margin;
- }
-
- sel._ph.value = sel.options[sel.selectedIndex].text;
- sel._ph.style.display = sel._dm;
- sel.style.display = 'none';
- }
-
- function hidePlaceholder(sel) {
- if( sel._ph ) sel._ph.style.display = 'none';
- sel.style.display = sel._dm;
- }
-
- function hideSelects() {
- for(var i = 0; i < aSelects.length; i++) {
- showPlaceholder(aSelects[i]);
- }
- }
-
- function showSelects() {
- for(var i = 0; i < aSelects.length; i++) {
- hidePlaceholder(aSelects[i]);
- }
- }
-
- function onmouseover(evt) {
- XHTML1.addClass(evt.currentTarget, "over");
- if( isIE6 ) hideSelects();
- }
-
- function onmouseout(evt) {
- XHTML1.removeClass(evt.currentTarget, "over");
- if( isIE6 ) showSelects();
- }
-
- function onfocus(evt) {
- for(var element = evt.currentTarget; element; element = element.parentNode) {
- if(XHTML1.isElement(element, "li")) {
- XHTML1.addClass(element, "focus");
- }
- }
- if( isIE6 ) hideSelects();
- }
-
- function onblur(evt) {
- for(var element = evt.currentTarget; element; element = element.parentNode) {
- if(XHTML1.isElement(element, "li")) {
- XHTML1.removeClass(element, "focus");
- }
- }
- if( isIE6 ) showSelects();
- }
-
- 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);
-}
+++ /dev/null
-/*
-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();
- }
-};
+++ /dev/null
-/*
-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;
- }
-};
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/ie7.css" /><![endif]-->
<% 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>
+<script type="text/javascript" src="<%=resource%>/VarType.js"></script>
+<script type="text/javascript" src="<%=resource%>/XHTML1.js"></script>
+<script type="text/javascript" src="<%=resource%>/Dropdowns.js"></script>
<title><%=striptags( hostname .. ( (node and node.title) and ' - ' .. node.title or '')) %> - LuCI</title>
</head>
<body class="lang_<%=luci.i18n.context.lang%>">