1
irmtfan
how can i change the direction of tootip in layersmenu.js ???
  • 2004/11/22 15:55

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


i want in admin when i take mouse to a module icon the menu open from right to left in mouse over.
this is original file:

// PHP Layers Menu 1.0.7 (c) 2001, 2002 Marco Pratesi 

DOM = (document.getElementById) ? 0;
NS4 = (document.layers) ? 0;
IE4 = (document.all) ? 0;
var 
loaded 0;    // to avoid stupid errors of Microsoft browsers
Konqueror = (navigator.userAgent.indexOf("Konqueror") > -1) ? 0;
// We need to explicitly detect Konqueror
// because Konqueror 3 sets IE4 = 1 ... AAAAAAAAAARGHHH!!!
Opera5 = (navigator.userAgent.indexOf("Opera 5") > -|| navigator.userAgent.indexOf("Opera/5") > -|| navigator.userAgent.indexOf("Opera 6") > -|| navigator.userAgent.indexOf("Opera/6") > -1) ? 0;

// it works with NS4, Mozilla, NS6, Opera 5 and 6, IE
currentY = -1;
function 
grabMouse(e) {
    if ((
DOM && !IE4) || Opera5) {
        
currentY e.clientY;
    } else if (
NS4) {
        
currentY e.pageY;
    } else {
        
currentY event.y;
    }
    if (
DOM && !IE4 && !Opera5 && !Konqueror) {
        
currentY += window.pageYOffset;
    } else if (
IE4 && DOM && !Opera5 && !Konqueror) {
        
currentY += document.body.scrollTop;
    }
}
if ((
DOM || NS4) && !IE4) {
    
document.captureEvents(Event.MOUSEDOWN Event.MOUSEMOVE);
}
document.onmousemove grabMouse;

function 
popUp(menuName,on) {
    if (
loaded) {    // to avoid stupid errors of Microsoft browsers
        
if (on) {
//            moveLayers();
            
if (DOM) {
                
document.getElementById(menuName).style.visibility "visible";
                
document.getElementById(menuName).style.zIndex 1000;
            } else if (
NS4) {
                
document.layers[menuName].visibility "show";
                
document.layers[menuName].zIndex 1000;
            } else {
                
document.all[menuName].style.visibility "visible";
                
document.all[menuName].style.zIndex 1000;
            }
        } else {
            if (
DOM) {
                
document.getElementById(menuName).style.visibility "hidden";
            } else if (
NS4) {
                
document.layers[menuName].visibility "hide";
            } else {
                
document.all[menuName].style.visibility "hidden";
            }
        }
    }
}

function 
setleft(layer,x) {
    if (
DOM) {
        
document.getElementById(layer).style.left x;
        
document.getElementById(layer).style.left 'px';
    } else if (
NS4) {
        
document.layers[layer].left x;
    } else {
        
document.all[layer].style.pixelLeft x;
    }
}

function 
settop(layer,y) {
    if (
DOM) {
        
document.getElementById(layer).style.top y;
        
document.getElementById(layer).style.top 'px';
    } else if (
NS4) {
        
document.layers[layer].top y;
    } else {
        
document.all[layer].style.pixelTop y;
    }
}

function 
setwidth(layer,w) {
    if (
DOM) {
        
document.getElementById(layer).style.width w;
        
document.getElementById(layer).style.width 'px';
    } else if (
NS4) {
//        document.layers[layer].width = w;
    
} else {
        
document.all[layer].style.pixelWidth w;
    }
}

function 
moveLayerY(menuNameordinatae) {
    if (
loaded) {    
    
// to avoid stupid errors of Microsoft browsers
    //alert (ordinata);
    // Konqueror: ordinata = -1 according to the initialization currentY = -1
    // Opera: isNaN(ordinata), currentY is NaN, it seems that Opera ignores the initialization currentY = -1
        
if (ordinata != -&& !isNaN(ordinata)) {    // The browser has detected the mouse position
            
if (DOM) {
                
// attenzione a "px" !!!
                
if (&& e.clientY) { // just use the pos of the mouseOver event if we have it
                    
document.getElementById(menuName).style.top e.clientY 'px';
                } else {
                    
appoggio parseInt(document.getElementById(menuName).style.top);
                    if (
isNaN(appoggio)) appoggio 0;
                    if (
Math.abs(appoggio ordinata_margin ordinata) > thresholdY)
                        
document.getElementById(menuName).style.top = (ordinata ordinata_margin) + 'px';
                }

            } else if (
NS4) {
                    if (
Math.abs(document.layers[menuName].top ordinata_margin ordinata) > thresholdY)
                        
document.layers[menuName].top ordinata ordinata_margin;
            } else {
                if (
Math.abs(document.all[menuName].style.pixelTop ordinata_margin ordinata) > thresholdY)
                    
document.all[menuName].style.pixelTop ordinata ordinata_margin;
            }
        }
    }
}


and i change lines from setleft function to this:

function setleft(layer,x) {
    if (
DOM) {
        
document.getElementById(layer).style.right x;
        
document.getElementById(layer).style.right 'px';
    } else if (
NS4) {
        
document.layers[layer].left x;
    } else {
        
document.all[layer].style.pixelLeft x;
    }
}


so this works only with mozilla firefox not by IE or opera
please help me with code
many thanks

2
irmtfan
Re: how can i change the direction of tootip in layersmenu.js ???
  • 2004/11/23 16:18

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


is there anyone know about java script to help me?
works fine with firefox but not IE nor Opera

3
irmtfan
Re: how can i change the direction of tootip in layersmenu.js ???
  • 2004/11/23 21:13

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


bump

4
ajaxbr
Re: how can i change the direction of tootip in layersmenu.js ???
  • 2004/11/23 21:29

  • ajaxbr

  • Quite a regular

  • Posts: 276

  • Since: 2003/10/25


AFAICS it's sniffing for browsers, then using the correct bit setleft function (DOM, NS or else). So I'd suggest replacing document.layers[layer].left = x; and document.all[layer].style.pixelLeft = x; with document.layers[layer].right = x; and document.all[layer].style.pixelRight = x;

Good luck

5
irmtfan
Re: how can i change the direction of tootip in layersmenu.js ???
  • 2004/11/23 21:41

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


i do that not work
because also IE and opera go to the DOM in if
btw is there any other code for IE atleast
i personally dont use IE but you know all thing must be compatible with this browser

6
ajaxbr
Re: how can i change the direction of tootip in layersmenu.js ???
  • 2004/11/23 22:33

  • ajaxbr

  • Quite a regular

  • Posts: 276

  • Since: 2003/10/25


Can you post a screenshot of this working?

2nd suggestion: revert that file to its original content, open cp_functions.php and find $abscissa_step = 90;, try changing that value to -90.


Edit: also, take a look at /cache/adminmenu.php (exists in your server after install/first use of admin)

7
irmtfan
Re: how can i change the direction of tootip in layersmenu.js ???
  • 2004/11/24 5:15

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


sorry for my delay i have to go to asleep last night
and these are screen shots:
first with Firefox and everything ok

Resized Image
second with IE and my problem:
Resized Image

i want these for persian users so i release a new version of farsi.xoops.2.0.9RC version and this is only problem i have now for release a final version
i try your second suggestion and does not work
and i can not change a file in cache directory to solve this because it must be release for public

and many thanks for your patiance and helps ajaxbr

8
ajaxbr
Re: how can i change the direction of tootip in layersmenu.js ???
  • 2004/11/24 18:28

  • ajaxbr

  • Quite a regular

  • Posts: 276

  • Since: 2003/10/25


Hmm, was it working in FF before you changed the .js file (because FF is much better with Right To Left languages, I think)?

Are you testing this in a remote, production server?

Anyway, that value (and the one below) does seem to be an important part of this issue. But I believe both those values will be used to generate adminmenu.php only, so to check if they are working or not you'd have to add or remove a module.

You're welcome, thanks for your efforts to improve XOOPS for RTL languages

9
irmtfan
Re: how can i change the direction of tootip in layersmenu.js ???
  • 2004/11/25 6:13

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Quote:
Hmm, was it working in FF before you changed the .js file (because FF is much better with Right To Left languages, I think)

no after that change it works with firefox

Quote:
to check if they are working or not you'd have to add or remove a module


yes i install a new module and work with firefox

Quote:
You're welcome, thanks for your efforts to improve XOOPS for RTL languages


10
ajaxbr
Re: how can i change the direction of tootip in layersmenu.js ???
  • 2004/11/28 23:24

  • ajaxbr

  • Quite a regular

  • Posts: 276

  • Since: 2003/10/25


Bump?

Login

Who's Online

338 user(s) are online (301 user(s) are browsing Support Forums)


Members: 0


Guests: 338


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits