General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Clear my doubts
Posted by: JohnHell
Date: March 10, 2009 01:36AM

Hi guys, I was editing the zoom macro for my needs today and... well, it is those of one mysteries with javascript that I'll never understand, but maybe with your help I'll do, who knows...

Well, the thing is about that variables, or elements, or as you wish to call, that have a value, but, even if it doesn't match with the conditional expression, the script still continues working.

In the Zoom in and out images macro there is a value for "zoom". The first time, it's ok, it matches and so, the script can be executed, but... why the next times it's executed when that element already has a value that, in my head (and with alert checks), doesn't match at all with the expected condition?

Let's have a look to "getAttribute('zoom')". Ok, the first time it's null, so, the script can run. Then, that isn't being reset anywhere (I post the other macros used), so, why the hell it continues zooming out and in?????

Another doubt is why that value is divided by 10 inside "_Zoom_hndlImage".

The code is reformatted to avoid page distortion.

_Zoom_Image{
$_Zoom_doitImg="
if(getAttribute('zoom')==null){
setAttribute('initW',width);
setAttribute('initH',height);
setAttribute('zoom',1)
}
var iz=".$_Zoom_By.";
setAttribute('zoom',getAttribute('zoom')*iz);
iz=getAttribute('zoom');
width=bz*iz*getAttribute('initW');
height=bz*iz*getAttribute('initH')";
&_Zoom_hndlImage;
}

_Zoom_hndlImage{
$JS_doit="var b=getElementsByTagName('body')[0];
if(b){var bz=(b.getAttribute('zoom')==null)?1 : (b.getAttribute('zoom')/10);
for(var j=0,i=images;j<i.length;j++)
with(i[j])if(urlencode(src)=='".urlencode($ImageURL)."'){".$_Zoom_doitImg."}}";
&JS_hndlDoc;
}

JS_hndlDoc{
# Same as JS_hndlDocs, but only for the current frame.
injectJS("(function(){".$JS_func.$_JS_urlencode."with(document){".$JS_doit."}".$JS_last."})()","frame");
$JS_doit=""; $JS_func=""; $JS_last=""; $JS_fail="";
}



Edited 3 time(s). Last edit at 03/10/2009 01:39AM by JohnHell.

Options: ReplyQuote
Re: Clear my doubts
Posted by: JohnHell
Date: March 12, 2009 03:53PM

At this moment it's clear no one it's going to help me, but, no one has any remote idea of what I was requesting/talking about? Or you just pass me by :/

Options: ReplyQuote
Re: Clear my doubts
Posted by: desga2
Date: March 12, 2009 04:38PM

Sorry JohnHell, I'm busy preparing my next system with linux (a used computer donated by a friend).
When i have some time to do some tests about your questions I would ask your questions. smiling smiley

K-Meleon in Spanish

Options: ReplyQuote
Re: Clear my doubts
Posted by: Arrow
Date: March 13, 2009 02:47AM

Way over my head grinning smiley

Good luck though!



Edited 1 time(s). Last edit at 03/13/2009 02:47AM by Arrow.

Options: ReplyQuote
Re: Clear my doubts
Posted by: foobarly
Date: March 13, 2009 10:32AM

Sorry, no can do. I only go as far as batch files... sad smiley

Options: ReplyQuote
Re: Clear my doubts
Posted by: JohnHell
Date: March 13, 2009 09:08PM

Thank you, but don't worry, do whatever is more important to you, but if do something with this topic... I hope you answer instead asking tongue sticking out smiley

EDIT, this was for desga, thanks for the others too winking smiley



Edited 1 time(s). Last edit at 03/13/2009 09:09PM by JohnHell.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.