diff --git a/public/designs/themes/ecosol/default.yml b/public/designs/themes/ecosol/default.yml deleted file mode 100644 index bcad135..0000000 --- a/public/designs/themes/ecosol/default.yml +++ /dev/null @@ -1,2 +0,0 @@ -title: "Default" -description: "A simple theme" diff --git a/public/designs/themes/ecosol/javascript/auto-open-menu.js b/public/designs/themes/ecosol/javascript/auto-open-menu.js new file mode 100644 index 0000000..69b675d --- /dev/null +++ b/public/designs/themes/ecosol/javascript/auto-open-menu.js @@ -0,0 +1,64 @@ + +function setAutoOpenMenu( menu ) { + + var mul = menu.getElementsByTagName("ul")[0]; + if ( !mul ) return false; + + mul.h = mul.clientHeight; // remember the current height to a faster animation + mul.minSize = mul.clientHeight; + var vli = mul.getElementsByTagName("li"); + mul.paddingBottom = parseInt( menu.className.replace( /^.*AOM_paddingBottom_([^\s]+).*$/, "$1" ) ); + mul.maxSize = ( vli.length * ( vli[1].offsetTop - vli[0].offsetTop ) ); + mul.inc = 1; + + window["autoOpenMenu-"+menu.id] = menu; + menu.mul = mul; + + if ( mul.minSize == 1 ) { + // Work arround bug for IE - ie sux - ie sux - ie sux - ie sux -ie sux -ie sux -ie sux - ie sux!!! + mul.h = 3; + setTimeout('m = window[\'autoOpenMenu-'+menu.id+'\']; m.onmouseout()', 10); + } + + menu.isIE = ( navigator.appName.indexOf("Microsoft") > -1 ); + + menu.onmouseover = function () { + clearTimeout( this.timeoutClose ); + var mul = this.mul; + if ( mul.paddingBottom ) mul.parentNode.style.paddingBottom = mul.paddingBottom +"px"; + if ( mul.h < mul.maxSize ) { + mul.h += mul.inc; + mul.inc += 2; + mul.style.height = mul.h +"px"; + this.timeoutOpen = setTimeout( "window['autoOpenMenu-"+this.id+"'].onmouseover()", 33 ); + } else { + mul.h = mul.maxSize; + mul.style.height = mul.h +"px"; + mul.inc = 1; + } + } + + menu.onmouseout = function ( doIt, firstDoIt ) { + clearTimeout( this.timeoutOpen ); + var mul = this.mul; + if ( firstDoIt ) mul.inc = 1; + if ( doIt == true ) { + if ( mul.h > mul.minSize ) { + mul.h -= mul.inc++; + if ( mul.h < 0 ) mul.h = 0; + if ( this.isIE ) if ( mul.h < 1 ) mul.h = 1; + mul.style.height = mul.h +"px"; + this.timeoutClose = setTimeout( "window['autoOpenMenu-"+this.id+"'].onmouseout(true)", 33 ); + } else { + mul.h = mul.minSize; + mul.style.height = mul.h +"px"; + if ( mul.paddingBottom ) mul.parentNode.style.paddingBottom = "0px"; + mul.inc = 2; + } + } else { + // Work arround IE bug + this.timeoutClose = setTimeout( "window['autoOpenMenu-"+this.id+"'].onmouseout(true, true)", 200 ); + } + } + +} diff --git a/public/designs/themes/ecosol/theme.yml b/public/designs/themes/ecosol/theme.yml new file mode 100644 index 0000000..fdf2d0a --- /dev/null +++ b/public/designs/themes/ecosol/theme.yml @@ -0,0 +1,3 @@ +title: "Default" +description: "A simple theme" +js: [ auto-open-menu ] diff --git a/public/javascripts/auto-open-menu.js b/public/javascripts/auto-open-menu.js deleted file mode 100644 index 69b675d..0000000 --- a/public/javascripts/auto-open-menu.js +++ /dev/null @@ -1,64 +0,0 @@ - -function setAutoOpenMenu( menu ) { - - var mul = menu.getElementsByTagName("ul")[0]; - if ( !mul ) return false; - - mul.h = mul.clientHeight; // remember the current height to a faster animation - mul.minSize = mul.clientHeight; - var vli = mul.getElementsByTagName("li"); - mul.paddingBottom = parseInt( menu.className.replace( /^.*AOM_paddingBottom_([^\s]+).*$/, "$1" ) ); - mul.maxSize = ( vli.length * ( vli[1].offsetTop - vli[0].offsetTop ) ); - mul.inc = 1; - - window["autoOpenMenu-"+menu.id] = menu; - menu.mul = mul; - - if ( mul.minSize == 1 ) { - // Work arround bug for IE - ie sux - ie sux - ie sux - ie sux -ie sux -ie sux -ie sux - ie sux!!! - mul.h = 3; - setTimeout('m = window[\'autoOpenMenu-'+menu.id+'\']; m.onmouseout()', 10); - } - - menu.isIE = ( navigator.appName.indexOf("Microsoft") > -1 ); - - menu.onmouseover = function () { - clearTimeout( this.timeoutClose ); - var mul = this.mul; - if ( mul.paddingBottom ) mul.parentNode.style.paddingBottom = mul.paddingBottom +"px"; - if ( mul.h < mul.maxSize ) { - mul.h += mul.inc; - mul.inc += 2; - mul.style.height = mul.h +"px"; - this.timeoutOpen = setTimeout( "window['autoOpenMenu-"+this.id+"'].onmouseover()", 33 ); - } else { - mul.h = mul.maxSize; - mul.style.height = mul.h +"px"; - mul.inc = 1; - } - } - - menu.onmouseout = function ( doIt, firstDoIt ) { - clearTimeout( this.timeoutOpen ); - var mul = this.mul; - if ( firstDoIt ) mul.inc = 1; - if ( doIt == true ) { - if ( mul.h > mul.minSize ) { - mul.h -= mul.inc++; - if ( mul.h < 0 ) mul.h = 0; - if ( this.isIE ) if ( mul.h < 1 ) mul.h = 1; - mul.style.height = mul.h +"px"; - this.timeoutClose = setTimeout( "window['autoOpenMenu-"+this.id+"'].onmouseout(true)", 33 ); - } else { - mul.h = mul.minSize; - mul.style.height = mul.h +"px"; - if ( mul.paddingBottom ) mul.parentNode.style.paddingBottom = "0px"; - mul.inc = 2; - } - } else { - // Work arround IE bug - this.timeoutClose = setTimeout( "window['autoOpenMenu-"+this.id+"'].onmouseout(true, true)", 200 ); - } - } - -} -- libgit2 0.21.2