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 | 44 | /* Adds a class to "msie" to the body element if a Microsoft browser is |
45 | 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 | 51 | </script> |
51 | 52 | |
... | ... | @@ -120,5 +121,17 @@ |
120 | 121 | <%= localist_menu %> |
121 | 122 | <%= footer %> |
122 | 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 | 136 | </body> |
124 | 137 | </html> | ... | ... |
1.35 KB
public/designs/icons/default/style.css
... | ... | @@ -20,6 +20,7 @@ |
20 | 20 | .icon-ok { background-image: url(gtk-ok.png); } |
21 | 21 | .icon-login { background-image: url(key-HC.gif); } |
22 | 22 | .icon-help { background-image: url(help.gif); } |
23 | +.icon-firefox { background-image: url(firefox-24x24.gif); } | |
23 | 24 | .icon-menu- { background-image: url(menu-without-ico-HC.gif) } |
24 | 25 | .icon-menu-blog { background-image: url(blog-HC.gif); } |
25 | 26 | .icon-menu-album { background-image: url(album-HC.gif); } | ... | ... |
public/javascripts/auto-open-menu.js
... | ... | @@ -7,15 +7,16 @@ function setAutoOpenMenu( menu ) { |
7 | 7 | mul.h = mul.clientHeight; // remember the current height to a faster animation |
8 | 8 | mul.minSize = mul.clientHeight; |
9 | 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 | 11 | mul.maxSize = ( vli.length * ( vli[1].offsetTop - vli[0].offsetTop ) ); |
12 | + mul.inc = 1; | |
12 | 13 | |
13 | 14 | window["autoOpenMenu-"+menu.id] = menu; |
14 | 15 | menu.mul = mul; |
15 | 16 | |
16 | 17 | if ( mul.minSize == 1 ) { |
17 | 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 | 20 | setTimeout('m = window[\'autoOpenMenu-'+menu.id+'\']; m.onmouseout()', 10); |
20 | 21 | } |
21 | 22 | |
... | ... | @@ -26,21 +27,24 @@ function setAutoOpenMenu( menu ) { |
26 | 27 | var mul = this.mul; |
27 | 28 | if ( mul.paddingBottom ) mul.parentNode.style.paddingBottom = mul.paddingBottom +"px"; |
28 | 29 | if ( mul.h < mul.maxSize ) { |
29 | - mul.h += 10; | |
30 | + mul.h += mul.inc; | |
31 | + mul.inc += 2; | |
30 | 32 | mul.style.height = mul.h +"px"; |
31 | 33 | this.timeoutOpen = setTimeout( "window['autoOpenMenu-"+this.id+"'].onmouseover()", 33 ); |
32 | 34 | } else { |
33 | 35 | mul.h = mul.maxSize; |
34 | 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 | 42 | clearTimeout( this.timeoutOpen ); |
40 | 43 | var mul = this.mul; |
41 | - if ( doIt ) { | |
44 | + if ( firstDoIt ) mul.inc = 1; | |
45 | + if ( doIt == true ) { | |
42 | 46 | if ( mul.h > mul.minSize ) { |
43 | - mul.h -= 10; | |
47 | + mul.h -= mul.inc++; | |
44 | 48 | if ( mul.h < 0 ) mul.h = 0; |
45 | 49 | if ( this.isIE ) if ( mul.h < 1 ) mul.h = 1; |
46 | 50 | mul.style.height = mul.h +"px"; |
... | ... | @@ -49,10 +53,11 @@ function setAutoOpenMenu( menu ) { |
49 | 53 | mul.h = mul.minSize; |
50 | 54 | mul.style.height = mul.h +"px"; |
51 | 55 | if ( mul.paddingBottom ) mul.parentNode.style.paddingBottom = "0px"; |
56 | + mul.inc = 2; | |
52 | 57 | } |
53 | 58 | } else { |
54 | 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 @@ |
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 | 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 | 394 | /* Category */ |
364 | 395 | |
365 | 396 | #view-category { /* none */ } | ... | ... |
public/stylesheets/forms.css
... | ... | @@ -22,8 +22,11 @@ |
22 | 22 | text-indent: 5px; |
23 | 23 | padding: 2px 0px; |
24 | 24 | } |
25 | -.msie .formfield input { | |
25 | +.msie5 .formfield input, | |
26 | +.msie6 .formfield input { | |
26 | 27 | background-attachment: fixed; |
28 | +} | |
29 | +.msie .formfield input { | |
27 | 30 | padding-left: 2px; |
28 | 31 | } |
29 | 32 | .formfield textarea { | ... | ... |
public/stylesheets/menu.css
... | ... | @@ -151,6 +151,9 @@ body.category4 .linkSubMenu { background-image: url(/images/borda-esq-aba-vermel |
151 | 151 | right: 0px; |
152 | 152 | padding: 0px 0px 0px 10px; |
153 | 153 | } |
154 | +.msie #assets_menu { | |
155 | + right: -1px; | |
156 | +} | |
154 | 157 | |
155 | 158 | #assets_menu_layout_iten { |
156 | 159 | position: absolute; |
... | ... | @@ -169,6 +172,7 @@ body.category4 #assets_menu_layout_iten { background: url(/images/top-bar/assets |
169 | 172 | #assets_menu_list { |
170 | 173 | padding: 0px 0px 6px 5px; |
171 | 174 | background: url(/images/top-bar/assets-menu-bg-azul.gif) 0% 100%; |
175 | + Xborder-right: 1px solid #2A5896; | |
172 | 176 | } |
173 | 177 | body.category1 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-laranja.gif) } |
174 | 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 | 184 | padding: 0px; |
181 | 185 | overflow: hidden; |
182 | 186 | height: 56px; |
183 | - width: 135px; | |
187 | + max-width: 135px; | |
188 | + width: 136px; | |
184 | 189 | } |
185 | 190 | |
186 | 191 | .top_extra_menu li { |
... | ... | @@ -216,6 +221,11 @@ body.category4 .top_extra_menu a { color: #F79494 } |
216 | 221 | background: #3465A4; |
217 | 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 | 229 | body.category1 #user_box a:hover, |
220 | 230 | body.category1 .top_extra_menu a:hover { background: #F57900; color: #FFF } |
221 | 231 | body.category2 #user_box a:hover, |
... | ... | @@ -240,6 +250,11 @@ body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } |
240 | 250 | opacity: 0.7; |
241 | 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 | 258 | #user_box a img, |
244 | 259 | #user_box a:hover span, |
245 | 260 | .top_extra_menu a:hover span { |
... | ... | @@ -260,13 +275,13 @@ body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } |
260 | 275 | position: absolute; |
261 | 276 | top: 0px; |
262 | 277 | right: 0px; |
263 | - width: 200px; | |
278 | + width: 150px; | |
264 | 279 | } |
265 | 280 | |
266 | 281 | #open_search { |
267 | 282 | position: absolute; |
268 | 283 | top: 2px; |
269 | - left: 64px; | |
284 | + left: 14px; | |
270 | 285 | float: left; |
271 | 286 | } |
272 | 287 | #user_box #open_search:hover { | ... | ... |