Right-click context menu : add "top of page" and "bottom of page"
Posted by: mhf
Date: September 02, 2009 06:52PM

I'd really like to try and code this myself if someone can point me to where I can find these commands : top of page and bottom of page.

I know you can do this with mouse gestures but I'm a context menu freak. smiling smiley

What I want to do is to add these commands to the right-click context menu when in a page so as to go instantly to either the top or the bottom of the page (as with ctrl-home and ctrl-end keys).

Any ideas ? Thanks in advance !



Edited 1 time(s). Last edit at 09/02/2009 06:52PM by mhf.

Re: Right-click context menu : add "top of page" and "bottom of page"
Posted by: JujuLand
Date: September 02, 2009 08:46PM

Quote
mhf
I know you can do this with mouse gestures but I'm a context menu freak.

For me, there is no such gesture which does it, just some gestures which use js function to scroll up, down, left or right.

You can use it, but it's not exactly what youre asking for.

A+


Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:31.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/75.0

Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr




Re: Right-click context menu : add "top of page" and "bottom of page"
Posted by: mhf
Date: September 02, 2009 11:47PM

Merci Jujuland, but effectively that's not what I'm looking for...

Re: Right-click context menu : add "top of page" and "bottom of page"
Posted by: mhf
Date: September 06, 2009 12:13AM

No help for me ?

I have seen that there is no corresponding command in Commands.text but surely this shouldn't be that difficult to code ?

Re: Right-click context menu : add "top of page" and "bottom of page"
Posted by: disrupted
Date: September 06, 2009 02:35AM

no, no commands.. i made something with js

pagetopend_go
http://kmext.sourceforge.net/macros/gopagetopend.7z

access from tab button context menu>page top|page end


# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#go to page top or page end

topgo{
$_jscurrent=getpref(BOOL,$pref_JavaScript);
setpref(BOOL,$pref_JavaScript, true);
injectJS("scroll(0,0)");
setpref(BOOL,$pref_JavaScript, $_jscurrent);
}

endgo{
$_jscurrent=getpref(BOOL,$pref_JavaScript);
setpref(BOOL,$pref_JavaScript, true);
injectJS("scroll(0,100000000000)");
setpref(BOOL,$pref_JavaScript, $_jscurrent);
}

topend_BuildMenu{
setmenu("TabButtonPopup",inline,endtop_go,2);
setmenu(endtop_go,macro,"Page Top",topgo);
setmenu(endtop_go,macro,"Page End",endgo);
}

$OnInit=$OnInit."topend_BuildMenu;";
# ------------------------------------------------------------------
$macroModules=$macroModules."topend_go;";


Re: Right-click context menu : add "top of page" and "bottom of page"
Posted by: mhf
Date: September 06, 2009 05:16AM

THANKS disrupted ! Although I would have preferred it in the right-click context menu in a page.



Edited 1 time(s). Last edit at 09/06/2009 05:19AM by mhf.

Re: Right-click context menu : add "top of page" and "bottom of page"
Posted by: kko
Date: September 06, 2009 02:25PM

Quote
mhf
I have seen that there is no corresponding command in Commands.text...

You just need to look at the tab "Manage Actions" in the mouse gestures configuration...

Quote
mhf
...but surely this shouldn't be that difficult to code ?

Indeed. Open Edit > Configuration > Menu and paste the following lines (you have to restart km to make this change take effect):

DocumentScrolling{
Scroll Up=macros(JS_scrollTop)
Scroll Down=macros(JS_scrollBottom)
}
!Document{
%ifplugin macros
!DocumentScrolling|DocumentOpenExternal
%endif
}


Re: Right-click context menu : add "top of page" and "bottom of page"
Posted by: mhf
Date: September 06, 2009 03:59PM

THANKS kko, that's perfect.

Quote
kko
You just need to look at the tab "Manage Actions" in the mouse gestures configuration...

...I never thought to look there ...!

K-Meleon forum is powered by Phorum.