From 2435c525dadb6bb72450d1f6039946c86ffe693c Mon Sep 17 00:00:00 2001 From: AurelioAHeckert Date: Thu, 31 Jan 2008 21:37:44 +0000 Subject: [PATCH] ActionItem152: MSIE SUX!!! --- app/views/layouts/application.rhtml | 17 +++++++++++++++-- public/designs/icons/default/firefox-24x24.gif | Bin 0 -> 1384 bytes public/designs/icons/default/style.css | 1 + public/javascripts/auto-open-menu.js | 19 ++++++++++++------- public/javascripts/better-browser-promotion.js | 9 +++++++++ public/stylesheets/common.css | 31 +++++++++++++++++++++++++++++++ public/stylesheets/forms.css | 5 ++++- public/stylesheets/menu.css | 21 ++++++++++++++++++--- 8 files changed, 90 insertions(+), 13 deletions(-) create mode 100644 public/designs/icons/default/firefox-24x24.gif create mode 100644 public/javascripts/better-browser-promotion.js diff --git a/app/views/layouts/application.rhtml b/app/views/layouts/application.rhtml index 419c51a..920aa10 100644 --- a/app/views/layouts/application.rhtml +++ b/app/views/layouts/application.rhtml @@ -44,8 +44,9 @@ /* Adds a class to "msie" to the body element if a Microsoft browser is * detected. This is needed to workaround several of their limitations. */ - if ( navigator.appName.indexOf("Microsoft") > -1 ) { - document.body.className += " msie"; + if ( navigator.appVersion.indexOf("MSIE") > -1 ) { + document.body.className += " msie msie" + + navigator.appVersion.replace(/^.*MSIE\s+([0-9]+).*$/, "$1"); } @@ -120,5 +121,17 @@ <%= localist_menu %> <%= footer %> + + + <%= javascript_include_tag 'better-browser-promotion' %> + diff --git a/public/designs/icons/default/firefox-24x24.gif b/public/designs/icons/default/firefox-24x24.gif new file mode 100644 index 0000000..6425f27 Binary files /dev/null and b/public/designs/icons/default/firefox-24x24.gif differ diff --git a/public/designs/icons/default/style.css b/public/designs/icons/default/style.css index 8133cbc..fc32629 100644 --- a/public/designs/icons/default/style.css +++ b/public/designs/icons/default/style.css @@ -20,6 +20,7 @@ .icon-ok { background-image: url(gtk-ok.png); } .icon-login { background-image: url(key-HC.gif); } .icon-help { background-image: url(help.gif); } +.icon-firefox { background-image: url(firefox-24x24.gif); } .icon-menu- { background-image: url(menu-without-ico-HC.gif) } .icon-menu-blog { background-image: url(blog-HC.gif); } .icon-menu-album { background-image: url(album-HC.gif); } diff --git a/public/javascripts/auto-open-menu.js b/public/javascripts/auto-open-menu.js index f5a159e..69b675d 100644 --- a/public/javascripts/auto-open-menu.js +++ b/public/javascripts/auto-open-menu.js @@ -7,15 +7,16 @@ function setAutoOpenMenu( menu ) { 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.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 = 12; + mul.h = 3; setTimeout('m = window[\'autoOpenMenu-'+menu.id+'\']; m.onmouseout()', 10); } @@ -26,21 +27,24 @@ function setAutoOpenMenu( menu ) { var mul = this.mul; if ( mul.paddingBottom ) mul.parentNode.style.paddingBottom = mul.paddingBottom +"px"; if ( mul.h < mul.maxSize ) { - mul.h += 10; + 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 ) { + menu.onmouseout = function ( doIt, firstDoIt ) { clearTimeout( this.timeoutOpen ); var mul = this.mul; - if ( doIt ) { + if ( firstDoIt ) mul.inc = 1; + if ( doIt == true ) { if ( mul.h > mul.minSize ) { - mul.h -= 10; + 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"; @@ -49,10 +53,11 @@ function setAutoOpenMenu( menu ) { 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)", 200 ); + this.timeoutClose = setTimeout( "window['autoOpenMenu-"+this.id+"'].onmouseout(true, true)", 200 ); } } diff --git a/public/javascripts/better-browser-promotion.js b/public/javascripts/better-browser-promotion.js new file mode 100644 index 0000000..2739f86 --- /dev/null +++ b/public/javascripts/better-browser-promotion.js @@ -0,0 +1,9 @@ +if ( navigator.appVersion.indexOf("MSIE 5") > -1 ) { + if ( document.cookie.indexOf("better-browser-promotion=done") == -1 ) { + var bbp = $("better-browser-promotion") + bbp.style.display = 'block'; + bbp.innerHTML += 'X' + // remember to show only one time per session: + document.cookie = "better-browser-promotion=done"; + } +} diff --git a/public/stylesheets/common.css b/public/stylesheets/common.css index 7364c75..6c747a0 100644 --- a/public/stylesheets/common.css +++ b/public/stylesheets/common.css @@ -360,6 +360,37 @@ body.category4 #content h4, body.category4 #content h5, body.category4 #content margin: 0px 0px 10px 0px; } +#better-browser-promotion { + position: absolute; + top: 100px; + left: 20%; + right: 20%; + border: 2px solid #000; + background: #FE0; + padding: 15px 5%; + text-align: justify; +} + +#bbp-getff { + display: block; + text-align: center; +} + +#bbp-getff a { + height: 24px; + line-height: 24px; + padding-left: 26px; + background-repeat: no-repeat; + background-position: 0px 50%; +} + +#better-browser-promotion .button { + position: absolute; + top: 5px; + right: 5px; + height: 20px; +} + /* Category */ #view-category { /* none */ } diff --git a/public/stylesheets/forms.css b/public/stylesheets/forms.css index d995e7f..9eceb7d 100644 --- a/public/stylesheets/forms.css +++ b/public/stylesheets/forms.css @@ -22,8 +22,11 @@ text-indent: 5px; padding: 2px 0px; } -.msie .formfield input { +.msie5 .formfield input, +.msie6 .formfield input { background-attachment: fixed; +} +.msie .formfield input { padding-left: 2px; } .formfield textarea { diff --git a/public/stylesheets/menu.css b/public/stylesheets/menu.css index a5ccf35..ab3a3b4 100644 --- a/public/stylesheets/menu.css +++ b/public/stylesheets/menu.css @@ -151,6 +151,9 @@ body.category4 .linkSubMenu { background-image: url(/images/borda-esq-aba-vermel right: 0px; padding: 0px 0px 0px 10px; } +.msie #assets_menu { + right: -1px; +} #assets_menu_layout_iten { position: absolute; @@ -169,6 +172,7 @@ body.category4 #assets_menu_layout_iten { background: url(/images/top-bar/assets #assets_menu_list { padding: 0px 0px 6px 5px; background: url(/images/top-bar/assets-menu-bg-azul.gif) 0% 100%; + Xborder-right: 1px solid #2A5896; } body.category1 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-laranja.gif) } body.category2 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-verde.gif) } @@ -180,7 +184,8 @@ body.category4 #assets_menu_list { background-image: url(/images/top-bar/assets- padding: 0px; overflow: hidden; height: 56px; - width: 135px; + max-width: 135px; + width: 136px; } .top_extra_menu li { @@ -216,6 +221,11 @@ body.category4 .top_extra_menu a { color: #F79494 } background: #3465A4; color: #FFF; } +.msie5 #user_box a, +.msie5 .top_extra_menu a { + color: #FFF; + text-decoration: none; +} body.category1 #user_box a:hover, body.category1 .top_extra_menu a:hover { background: #F57900; color: #FFF } body.category2 #user_box a:hover, @@ -240,6 +250,11 @@ body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } opacity: 0.7; filter: alpha(opacity=70); } +.msie5 #user_box a img, +.msie5 #user_box a span, +.msie5 .top_extra_menu a span { + display: none; +} #user_box a img, #user_box a:hover span, .top_extra_menu a:hover span { @@ -260,13 +275,13 @@ body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } position: absolute; top: 0px; right: 0px; - width: 200px; + width: 150px; } #open_search { position: absolute; top: 2px; - left: 64px; + left: 14px; float: left; } #user_box #open_search:hover { -- libgit2 0.21.2