Commit 2435c525dadb6bb72450d1f6039946c86ffe693c
1 parent
f86ab7eb
Exists in
master
and in
29 other branches
ActionItem152: MSIE SUX!!!
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1290 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
8 changed files
with
90 additions
and
13 deletions
Show diff stats
app/views/layouts/application.rhtml
| @@ -44,8 +44,9 @@ | @@ -44,8 +44,9 @@ | ||
| 44 | /* Adds a class to "msie" to the body element if a Microsoft browser is | 44 | /* Adds a class to "msie" to the body element if a Microsoft browser is |
| 45 | * detected. This is needed to workaround several of their limitations. | 45 | * detected. This is needed to workaround several of their limitations. |
| 46 | */ | 46 | */ |
| 47 | - if ( navigator.appName.indexOf("Microsoft") > -1 ) { | ||
| 48 | - document.body.className += " msie"; | 47 | + if ( navigator.appVersion.indexOf("MSIE") > -1 ) { |
| 48 | + document.body.className += " msie msie" + | ||
| 49 | + navigator.appVersion.replace(/^.*MSIE\s+([0-9]+).*$/, "$1"); | ||
| 49 | } | 50 | } |
| 50 | </script> | 51 | </script> |
| 51 | 52 | ||
| @@ -120,5 +121,17 @@ | @@ -120,5 +121,17 @@ | ||
| 120 | <%= localist_menu %> | 121 | <%= localist_menu %> |
| 121 | <%= footer %> | 122 | <%= footer %> |
| 122 | </div><!-- id="footer" --> | 123 | </div><!-- id="footer" --> |
| 124 | + | ||
| 125 | + <div id="better-browser-promotion" style="display:none"> | ||
| 126 | + <h3><%= | ||
| 127 | + _('Hey! Your web browser is really old!') +'</h3><p/>'+ | ||
| 128 | + _('This great website will be not so good on that. | ||
| 129 | + Don\'t you want to use Firefox? That is a great web browser, free, | ||
| 130 | + and made by people of all the world parts.') | ||
| 131 | + %><p/> | ||
| 132 | + <b id="bbp-getff"><a href="http://getfirefox.com" class="icon-firefox" target="getff"><%= _('Get Firefox Now!') %></a></b> | ||
| 133 | + </div> | ||
| 134 | + <%= javascript_include_tag 'better-browser-promotion' %> | ||
| 135 | + | ||
| 123 | </body> | 136 | </body> |
| 124 | </html> | 137 | </html> |
1.35 KB
public/designs/icons/default/style.css
| @@ -20,6 +20,7 @@ | @@ -20,6 +20,7 @@ | ||
| 20 | .icon-ok { background-image: url(gtk-ok.png); } | 20 | .icon-ok { background-image: url(gtk-ok.png); } |
| 21 | .icon-login { background-image: url(key-HC.gif); } | 21 | .icon-login { background-image: url(key-HC.gif); } |
| 22 | .icon-help { background-image: url(help.gif); } | 22 | .icon-help { background-image: url(help.gif); } |
| 23 | +.icon-firefox { background-image: url(firefox-24x24.gif); } | ||
| 23 | .icon-menu- { background-image: url(menu-without-ico-HC.gif) } | 24 | .icon-menu- { background-image: url(menu-without-ico-HC.gif) } |
| 24 | .icon-menu-blog { background-image: url(blog-HC.gif); } | 25 | .icon-menu-blog { background-image: url(blog-HC.gif); } |
| 25 | .icon-menu-album { background-image: url(album-HC.gif); } | 26 | .icon-menu-album { background-image: url(album-HC.gif); } |
public/javascripts/auto-open-menu.js
| @@ -7,15 +7,16 @@ function setAutoOpenMenu( menu ) { | @@ -7,15 +7,16 @@ function setAutoOpenMenu( menu ) { | ||
| 7 | mul.h = mul.clientHeight; // remember the current height to a faster animation | 7 | mul.h = mul.clientHeight; // remember the current height to a faster animation |
| 8 | mul.minSize = mul.clientHeight; | 8 | mul.minSize = mul.clientHeight; |
| 9 | var vli = mul.getElementsByTagName("li"); | 9 | var vli = mul.getElementsByTagName("li"); |
| 10 | - mul.paddingBottom = parseInt( menu.className.replace( /.*AOM_paddingBottom_([^\s]+).*/, "$1" ) ); | 10 | + mul.paddingBottom = parseInt( menu.className.replace( /^.*AOM_paddingBottom_([^\s]+).*$/, "$1" ) ); |
| 11 | mul.maxSize = ( vli.length * ( vli[1].offsetTop - vli[0].offsetTop ) ); | 11 | mul.maxSize = ( vli.length * ( vli[1].offsetTop - vli[0].offsetTop ) ); |
| 12 | + mul.inc = 1; | ||
| 12 | 13 | ||
| 13 | window["autoOpenMenu-"+menu.id] = menu; | 14 | window["autoOpenMenu-"+menu.id] = menu; |
| 14 | menu.mul = mul; | 15 | menu.mul = mul; |
| 15 | 16 | ||
| 16 | if ( mul.minSize == 1 ) { | 17 | if ( mul.minSize == 1 ) { |
| 17 | // Work arround bug for IE - ie sux - ie sux - ie sux - ie sux -ie sux -ie sux -ie sux - ie sux!!! | 18 | // Work arround bug for IE - ie sux - ie sux - ie sux - ie sux -ie sux -ie sux -ie sux - ie sux!!! |
| 18 | - mul.h = 12; | 19 | + mul.h = 3; |
| 19 | setTimeout('m = window[\'autoOpenMenu-'+menu.id+'\']; m.onmouseout()', 10); | 20 | setTimeout('m = window[\'autoOpenMenu-'+menu.id+'\']; m.onmouseout()', 10); |
| 20 | } | 21 | } |
| 21 | 22 | ||
| @@ -26,21 +27,24 @@ function setAutoOpenMenu( menu ) { | @@ -26,21 +27,24 @@ function setAutoOpenMenu( menu ) { | ||
| 26 | var mul = this.mul; | 27 | var mul = this.mul; |
| 27 | if ( mul.paddingBottom ) mul.parentNode.style.paddingBottom = mul.paddingBottom +"px"; | 28 | if ( mul.paddingBottom ) mul.parentNode.style.paddingBottom = mul.paddingBottom +"px"; |
| 28 | if ( mul.h < mul.maxSize ) { | 29 | if ( mul.h < mul.maxSize ) { |
| 29 | - mul.h += 10; | 30 | + mul.h += mul.inc; |
| 31 | + mul.inc += 2; | ||
| 30 | mul.style.height = mul.h +"px"; | 32 | mul.style.height = mul.h +"px"; |
| 31 | this.timeoutOpen = setTimeout( "window['autoOpenMenu-"+this.id+"'].onmouseover()", 33 ); | 33 | this.timeoutOpen = setTimeout( "window['autoOpenMenu-"+this.id+"'].onmouseover()", 33 ); |
| 32 | } else { | 34 | } else { |
| 33 | mul.h = mul.maxSize; | 35 | mul.h = mul.maxSize; |
| 34 | mul.style.height = mul.h +"px"; | 36 | mul.style.height = mul.h +"px"; |
| 37 | + mul.inc = 1; | ||
| 35 | } | 38 | } |
| 36 | } | 39 | } |
| 37 | 40 | ||
| 38 | - menu.onmouseout = function ( doIt ) { | 41 | + menu.onmouseout = function ( doIt, firstDoIt ) { |
| 39 | clearTimeout( this.timeoutOpen ); | 42 | clearTimeout( this.timeoutOpen ); |
| 40 | var mul = this.mul; | 43 | var mul = this.mul; |
| 41 | - if ( doIt ) { | 44 | + if ( firstDoIt ) mul.inc = 1; |
| 45 | + if ( doIt == true ) { | ||
| 42 | if ( mul.h > mul.minSize ) { | 46 | if ( mul.h > mul.minSize ) { |
| 43 | - mul.h -= 10; | 47 | + mul.h -= mul.inc++; |
| 44 | if ( mul.h < 0 ) mul.h = 0; | 48 | if ( mul.h < 0 ) mul.h = 0; |
| 45 | if ( this.isIE ) if ( mul.h < 1 ) mul.h = 1; | 49 | if ( this.isIE ) if ( mul.h < 1 ) mul.h = 1; |
| 46 | mul.style.height = mul.h +"px"; | 50 | mul.style.height = mul.h +"px"; |
| @@ -49,10 +53,11 @@ function setAutoOpenMenu( menu ) { | @@ -49,10 +53,11 @@ function setAutoOpenMenu( menu ) { | ||
| 49 | mul.h = mul.minSize; | 53 | mul.h = mul.minSize; |
| 50 | mul.style.height = mul.h +"px"; | 54 | mul.style.height = mul.h +"px"; |
| 51 | if ( mul.paddingBottom ) mul.parentNode.style.paddingBottom = "0px"; | 55 | if ( mul.paddingBottom ) mul.parentNode.style.paddingBottom = "0px"; |
| 56 | + mul.inc = 2; | ||
| 52 | } | 57 | } |
| 53 | } else { | 58 | } else { |
| 54 | // Work arround IE bug | 59 | // Work arround IE bug |
| 55 | - this.timeoutClose = setTimeout( "window['autoOpenMenu-"+this.id+"'].onmouseout(true)", 200 ); | 60 | + this.timeoutClose = setTimeout( "window['autoOpenMenu-"+this.id+"'].onmouseout(true, true)", 200 ); |
| 56 | } | 61 | } |
| 57 | } | 62 | } |
| 58 | 63 |
| @@ -0,0 +1,9 @@ | @@ -0,0 +1,9 @@ | ||
| 1 | +if ( navigator.appVersion.indexOf("MSIE 5") > -1 ) { | ||
| 2 | + if ( document.cookie.indexOf("better-browser-promotion=done") == -1 ) { | ||
| 3 | + var bbp = $("better-browser-promotion") | ||
| 4 | + bbp.style.display = 'block'; | ||
| 5 | + bbp.innerHTML += '<a href="javascript:void(bbp.style.display=\'none\')" class="button icon-close"><span>X</span></a>' | ||
| 6 | + // remember to show only one time per session: | ||
| 7 | + document.cookie = "better-browser-promotion=done"; | ||
| 8 | + } | ||
| 9 | +} |
public/stylesheets/common.css
| @@ -360,6 +360,37 @@ body.category4 #content h4, body.category4 #content h5, body.category4 #content | @@ -360,6 +360,37 @@ body.category4 #content h4, body.category4 #content h5, body.category4 #content | ||
| 360 | margin: 0px 0px 10px 0px; | 360 | margin: 0px 0px 10px 0px; |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | +#better-browser-promotion { | ||
| 364 | + position: absolute; | ||
| 365 | + top: 100px; | ||
| 366 | + left: 20%; | ||
| 367 | + right: 20%; | ||
| 368 | + border: 2px solid #000; | ||
| 369 | + background: #FE0; | ||
| 370 | + padding: 15px 5%; | ||
| 371 | + text-align: justify; | ||
| 372 | +} | ||
| 373 | + | ||
| 374 | +#bbp-getff { | ||
| 375 | + display: block; | ||
| 376 | + text-align: center; | ||
| 377 | +} | ||
| 378 | + | ||
| 379 | +#bbp-getff a { | ||
| 380 | + height: 24px; | ||
| 381 | + line-height: 24px; | ||
| 382 | + padding-left: 26px; | ||
| 383 | + background-repeat: no-repeat; | ||
| 384 | + background-position: 0px 50%; | ||
| 385 | +} | ||
| 386 | + | ||
| 387 | +#better-browser-promotion .button { | ||
| 388 | + position: absolute; | ||
| 389 | + top: 5px; | ||
| 390 | + right: 5px; | ||
| 391 | + height: 20px; | ||
| 392 | +} | ||
| 393 | + | ||
| 363 | /* Category */ | 394 | /* Category */ |
| 364 | 395 | ||
| 365 | #view-category { /* none */ } | 396 | #view-category { /* none */ } |
public/stylesheets/forms.css
| @@ -22,8 +22,11 @@ | @@ -22,8 +22,11 @@ | ||
| 22 | text-indent: 5px; | 22 | text-indent: 5px; |
| 23 | padding: 2px 0px; | 23 | padding: 2px 0px; |
| 24 | } | 24 | } |
| 25 | -.msie .formfield input { | 25 | +.msie5 .formfield input, |
| 26 | +.msie6 .formfield input { | ||
| 26 | background-attachment: fixed; | 27 | background-attachment: fixed; |
| 28 | +} | ||
| 29 | +.msie .formfield input { | ||
| 27 | padding-left: 2px; | 30 | padding-left: 2px; |
| 28 | } | 31 | } |
| 29 | .formfield textarea { | 32 | .formfield textarea { |
public/stylesheets/menu.css
| @@ -151,6 +151,9 @@ body.category4 .linkSubMenu { background-image: url(/images/borda-esq-aba-vermel | @@ -151,6 +151,9 @@ body.category4 .linkSubMenu { background-image: url(/images/borda-esq-aba-vermel | ||
| 151 | right: 0px; | 151 | right: 0px; |
| 152 | padding: 0px 0px 0px 10px; | 152 | padding: 0px 0px 0px 10px; |
| 153 | } | 153 | } |
| 154 | +.msie #assets_menu { | ||
| 155 | + right: -1px; | ||
| 156 | +} | ||
| 154 | 157 | ||
| 155 | #assets_menu_layout_iten { | 158 | #assets_menu_layout_iten { |
| 156 | position: absolute; | 159 | position: absolute; |
| @@ -169,6 +172,7 @@ body.category4 #assets_menu_layout_iten { background: url(/images/top-bar/assets | @@ -169,6 +172,7 @@ body.category4 #assets_menu_layout_iten { background: url(/images/top-bar/assets | ||
| 169 | #assets_menu_list { | 172 | #assets_menu_list { |
| 170 | padding: 0px 0px 6px 5px; | 173 | padding: 0px 0px 6px 5px; |
| 171 | background: url(/images/top-bar/assets-menu-bg-azul.gif) 0% 100%; | 174 | background: url(/images/top-bar/assets-menu-bg-azul.gif) 0% 100%; |
| 175 | + Xborder-right: 1px solid #2A5896; | ||
| 172 | } | 176 | } |
| 173 | body.category1 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-laranja.gif) } | 177 | body.category1 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-laranja.gif) } |
| 174 | body.category2 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-verde.gif) } | 178 | 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- | @@ -180,7 +184,8 @@ body.category4 #assets_menu_list { background-image: url(/images/top-bar/assets- | ||
| 180 | padding: 0px; | 184 | padding: 0px; |
| 181 | overflow: hidden; | 185 | overflow: hidden; |
| 182 | height: 56px; | 186 | height: 56px; |
| 183 | - width: 135px; | 187 | + max-width: 135px; |
| 188 | + width: 136px; | ||
| 184 | } | 189 | } |
| 185 | 190 | ||
| 186 | .top_extra_menu li { | 191 | .top_extra_menu li { |
| @@ -216,6 +221,11 @@ body.category4 .top_extra_menu a { color: #F79494 } | @@ -216,6 +221,11 @@ body.category4 .top_extra_menu a { color: #F79494 } | ||
| 216 | background: #3465A4; | 221 | background: #3465A4; |
| 217 | color: #FFF; | 222 | color: #FFF; |
| 218 | } | 223 | } |
| 224 | +.msie5 #user_box a, | ||
| 225 | +.msie5 .top_extra_menu a { | ||
| 226 | + color: #FFF; | ||
| 227 | + text-decoration: none; | ||
| 228 | +} | ||
| 219 | body.category1 #user_box a:hover, | 229 | body.category1 #user_box a:hover, |
| 220 | body.category1 .top_extra_menu a:hover { background: #F57900; color: #FFF } | 230 | body.category1 .top_extra_menu a:hover { background: #F57900; color: #FFF } |
| 221 | body.category2 #user_box a:hover, | 231 | body.category2 #user_box a:hover, |
| @@ -240,6 +250,11 @@ body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } | @@ -240,6 +250,11 @@ body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } | ||
| 240 | opacity: 0.7; | 250 | opacity: 0.7; |
| 241 | filter: alpha(opacity=70); | 251 | filter: alpha(opacity=70); |
| 242 | } | 252 | } |
| 253 | +.msie5 #user_box a img, | ||
| 254 | +.msie5 #user_box a span, | ||
| 255 | +.msie5 .top_extra_menu a span { | ||
| 256 | + display: none; | ||
| 257 | +} | ||
| 243 | #user_box a img, | 258 | #user_box a img, |
| 244 | #user_box a:hover span, | 259 | #user_box a:hover span, |
| 245 | .top_extra_menu a:hover span { | 260 | .top_extra_menu a:hover span { |
| @@ -260,13 +275,13 @@ body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } | @@ -260,13 +275,13 @@ body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } | ||
| 260 | position: absolute; | 275 | position: absolute; |
| 261 | top: 0px; | 276 | top: 0px; |
| 262 | right: 0px; | 277 | right: 0px; |
| 263 | - width: 200px; | 278 | + width: 150px; |
| 264 | } | 279 | } |
| 265 | 280 | ||
| 266 | #open_search { | 281 | #open_search { |
| 267 | position: absolute; | 282 | position: absolute; |
| 268 | top: 2px; | 283 | top: 2px; |
| 269 | - left: 64px; | 284 | + left: 14px; |
| 270 | float: left; | 285 | float: left; |
| 271 | } | 286 | } |
| 272 | #user_box #open_search:hover { | 287 | #user_box #open_search:hover { |