Menu

#1057 individuals.php javascript sets opacity, hardcoded

v4.2.3
open-remind
Veit
None
5
2010-01-04
2006-08-20
Jeff Adams
No

I'm calling this a "bug" because it means the themes
don't have 100% control over the look-and-feel... You
may decide this is more of a feature request.

I was trying to create a "high-contrast" version of the
cloudy theme, because I have a user with poor eyesight.

In individual.php, in the tabswitch method, there's the
following lines of javascript:

...
// empty tabs
for (i=0; i<tabid.length; i++) {
var elt = document.getElementById('door'+i);
if (document.getElementById('no_tab'+i)) { // empty ?
if (<?php if (userCanEdit(getUserName())) echo
'true'; else echo 'false';?>) {
elt.style.display='block';
elt.style.opacity='0.4';
elt.style.filter='alpha(opacity=40)';
}
else elt.style.display='none'; // empty and not
editable ==> hide
//if (i==3 && <?php if
($SHOW_SOURCES>=getUserAccessLevel(getUserName())) echo
'true'; else echo 'false';?>) elt.style.display='none';
// no sources
if (i==4 && <?php if (!$MULTI_MEDIA) echo 'true';
else echo 'false';?>) elt.style.display='none'; // no
multimedia
if (i==6) elt.style.display='none'; // hide researchlog
// ALL : hide empty contents
if (n==0)
document.getElementById(tabid[i]).style.display='none';
}
else elt.style.display='block';
}
// current door
for (i=0; i<tabid.length; i++) {
document.getElementById('door'+i).className='door
optionbox rela';

//document.getElementById('door'+i).className='tab_cell_inactive';
}
document.getElementById('door'+n).className='door
optionbox';
//document.getElementById('door'+n).className='tab_cell_active';
...

IMHO, this should instead be more like:

...
// empty tabs
for (i=0; i<tabid.length; i++) {
var elt =
document.getElementById('door'+i);
if
(document.getElementById('no_tab'+i)) { // empty ?
if (<?php if
(userCanEdit(getUserName())) echo 'true'; else echo
'false';?>) {
elt.style.display='block';

elt.className='tab_cell_inactive_empty';
}
else elt.style.display='none';
// empty and not editable ==> hide
// ALL : hide empty contents
if (n==0)
document.getElementById(tabid[i]).style.display='none';
}
else {
elt.style.display='block';
elt.className='tab_cell_inactive';
}
}
// current door

document.getElementById('door'+n).className='tab_cell_active';
...

This is using "active", "inactive" and "inactive_empty"
css styles instead of just setting the opacity (In my
case, I didn't want opacity to decrease because it
makes the text hard to read).

I tested this (with my updated css) on mozilla,
firefox, and safari and it seemed to work. Obviously
IE would be a good test but I'm on a Mac and MS has
ceased supporting IE on Mac.

Discussion

  • Christophe B.

    Christophe B. - 2006-08-31
    • assigned_to: nobody --> opus27
     
  • Greg Roach

    Greg Roach - 2008-11-17
    • milestone: --> 896571
     
  • Greg Roach

    Greg Roach - 2009-06-12

    Veit - assigning to you, as you are working in this area.

     
  • Greg Roach

    Greg Roach - 2009-06-12
    • assigned_to: opus27 --> volschin
     
  • Veit

    Veit - 2010-01-04
    • status: open --> open-remind
     
  • Veit

    Veit - 2010-01-04

    Has to be done in line with the new tab menu. I will check if its fixed with this.

     
  • Veit

    Veit - 2010-01-04
    • milestone: 896571 --> v4.2.3
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.