Here is a small modif (more context menu entries), and the possibility to change the server + translation file :
savePHF.kmm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
# Save the current page with PHF K-Meleon Forums by disrupted, JujuLand -------------------------------------------------
#
# Dependencies : none
# Resources : external phf server
# Preferences : extension.phf.server
#
# -------------------------------------------------------------------------------------------------
# Public -----------------------------------------------------------------------
$PHFserver="extension.phf.server";
$PHFdefault="
http://www.greywyvern.com/code/php/phf?phf=";
$PHFservice=getpref(STRING,$PHFserver);
$PHFservice==""?setpref(STRING,$PHFserver,$PHFdefault) :0;
$PHFservice==""?$PHFservice=getpref(STRING,$PHFserver) :0;
# ------------------------------------------------------------------------------
phfsave{
menugrayed=(hostname($URL)==""?true: (substr($URL,0,6)=="about:"?true:false)) ;
#menugrayed=(substr($URL,0,7)=="chrome:"?true:false);
setclipboard($TITLE.".phf.html");
open($PHFservice.$URL);
}
phfserver{
macroinfo=_("Specify the PHF server URL");
$_tit=_("PHF server Configuration"); $_txt=_("Enter the PHF server URL:");
$_server=getpref(STRING,$PHFserver);
$_server=prompt($_txt,$_tit,$_server);
$_server==""?delpref(STRING,$PHFserver): setpref(STRING,$PHFserver,$_server);
}
phf_BuildMenu{
setmenu(OpenSave,macro,"Save page As P&HF ...",phfsave,3);
setmenu(DocumentSave,macro,"Save page As P&HF ...",phfsave,2);
setmenu(Misc,macro,"PHF &Server",phfserver,0);
setmenu(Misc,separator,1);
setaccel("CTRL SHIFT S","macros(phfsave)");
}
$OnInit=$OnInit."phf_BuildMenu;";
# --------------------------------------------------------------------
$macroModules=$macroModules."savePHF;";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
savePHF.kml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# LANGUAGE DEFINITION FILE
#--------------------------------------------------------
# Added by savePHF Extension (don't edit this comment)
#--------------------------------------------------------
Specify the PHF server URL=Spécifier l'adresse du serveur PHF
PHF server Configuration=Configuration du serveur PHF
Enter the PHF server URL:=Entrez l'adresse du serveur PHF:
Save page As P&HF ...=Enregistrer la page en P&HF ...
PHF &Server=&Serveur PHF
#--------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[edit]
added an accel "Ctrl Shift S"
modified the treatment of the URL server. If leaved empty, reset to greywyvern.com server.
Unfortunately, I thought have found the way in my first tests to change the default name with the real title of the page, but I was perhaps wrong, it doesn't modify the name of the generated file.
Also, disrupted,
I think that this doesn't work and isn't needed. Don't you think so ?
$pendphf=($TITLE.".phf.html");
$savedir=getpref(STRING,"kmeleon.download.dir");
$findthefucker=($savedir.$pendphf);
#menugrayed=(substr($URL,0,7)=="chrome:"?true:false);
not tested with chrome address, if we must block it (in all the test I have made, I have no menu bar avalaible)
[/edit]
[edit 2]
confirmed:
$pendphf=($TITLE.".phf.html");
$savedir=getpref(STRING,"kmeleon.download.dir");
$findthefucker=($savedir.$pendphf);
and
$HOST = hostname( $URL );
not needed, but I think use it another way :drool:
[/edit 2]
[edit 3]
Just add this in phfsave to give the possibility to change the name (paste)
setclipboard($TITLE.".phf.html");
[/edit 3]
A+
Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0
Web:
http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr
Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc
Edited 8 time(s). Last edit at 07/22/2009 09:05PM by JujuLand.