Fullsize picture resizes Firefox window Fullsize picture resizes Firefox window
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Fullsize picture resizes Firefox window

Started by menachem, February 01, 2007, 10:42:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

menachem

Hello,

I did some searches on the forum but didn't find this issue, so here it goes.

I am running Coppermine 1.4.10.

I have firefox setup to open links and popups in new tabs, so when I click on the intermediate sized picture to get the full size picture it opens up in a new tab instead of in a popup window. When the fullsize picture is opened in a new tab, it resizes my whole Firefox window (the height is made smaller on the top and bottom of the window). If I click on a second image to see the fullsize picture, it once again gets smaller by the same amount.

[You can try it out here if you need to see what I am talking about].

Is there a way to make the fullsize picture not resize the window when it is opened?

Thanks,
Menachem

Nibbler

Modify the adjust_popup() function in scripts.js. Either alter it to suit you or nullify it

function adjust_popup() {}

menachem

Quote from: Nibbler on February 01, 2007, 10:47:04 PM
Modify the adjust_popup() function in scripts.js. Either alter it to suit you or nullify it

function adjust_popup() {}

Thank you very much. I was able to get it to work by commenting out the following lines in adjust_popup():
window.resizeTo(fixedW, fixedH);
window.resizeTo(w,h);
window.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);

Is there a way to set it up so that the popup is still adjusted when the browser is Internet Explorer, but not when the browser is Firefox? I know enough javascript to be dangerous, but not enough to be useful.

Thanks,
Menachem

Nibbler

Search the web for some browser detection code and hack it in.

menachem

Thank you very much.

Should anyone need to know how I did it, I adapted what it said in this tutorial in order to detect whether I was using Internet Explorer or not.

The function now looks like this:
function adjust_popup()
{
browsername=navigator.appName;
        var w, h, fixedW, fixedH, diffW, diffH;
        if (document.documentElement && document.body.clientHeight==0) {     // Catches IE6 and FF in DOCMODE
                fixedW = document.documentElement.clientWidth;
                fixedH = document.documentElement.clientHeight;
if (browsername.indexOf("Microsoft")!= -1) {
                window.resizeTo(fixedW, fixedH);
}
//window.resizeTo(fixedW, fixedH);
                diffW = fixedW - document.documentElement.clientWidth;
                diffH = fixedH - document.documentElement.clientHeight;
                w = fixedW + diffW + 16; // Vert Scrollbar Always On in DOCMODE.
                h = fixedH + diffH;
                if (w >= screen.availWidth) h += 16;
        } else if (document.all) {
                fixedW = document.body.clientWidth;
                fixedH = document.body.clientHeight;
if (browsername.indexOf("Microsoft")!= -1) {
                window.resizeTo(fixedW, fixedH);
}
                //window.resizeTo(fixedW, fixedH);
                diffW = fixedW - document.body.clientWidth;
                diffH = fixedH - document.body.clientHeight;
                w = fixedW + diffW;
                h = fixedH + diffH;
                if (h >= screen.availHeight) w += 16;
                if (w >= screen.availWidth)  h += 16;
        } else {
                fixedW = window.innerWidth;
                fixedH = window.innerHeight;
if (browsername.indexOf("Microsoft")!= -1) {
                window.resizeTo(fixedW, fixedH);
}
                //window.resizeTo(fixedW, fixedH);
                diffW = fixedW - window.innerWidth;
                diffH = fixedH - window.innerHeight;
                w = fixedW + diffW;
                h = fixedH + diffH;
                if (w >= screen.availWidth)  h += 16;
                if (h >= screen.availHeight) w += 16;
        }
        w = Math.min(w,screen.availWidth);
        h = Math.min(h,screen.availHeight);
if (browsername.indexOf("Microsoft") != -1) {
        window.resizeTo(w,h);
        window.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
}

}


Thanks again for all your help,
Menachem