General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Pages: 123Next
Current Page: 1 of 3
Java Script On/Off button + mailtux
Posted by: bellgamin
Date: April 24, 2010 09:01PM

I usually leave Java Script (JS) turned on but there are certain sites (such as CBS news sites) where JS screws up the display. To turn JS off, I now must do
Tools>Privacy>Block Java Script.

It would be very handy if the Tool Bar had a toggle button for easily turning JS on & off. Is such a thing available?



Edited 1 time(s). Last edit at 05/07/2010 08:55PM by JujuLand.

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: siria
Date: April 24, 2010 09:28PM

Sure - is on my beloved Privacy Bar by default smiling smiley
But guess the Policy Manager could probably turn on/off JS automatically on certain sites. If you don't use it, you probably can add this manually in the hostperm.1 in the profile folder, but they say it doesn't work for all scripts...
http://kb.mozillazine.org/Hostperm.1#script

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: JamesD
Date: April 24, 2010 11:12PM

I use flip_PM.kmm along with policy manager. See this thread. http://kmeleonbrowser.org/forum/read.php?9,91203,98982#msg-98982

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: Fred
Date: April 25, 2010 02:43AM

A separate Javascript button is very useful.
You need two button icons.
Go to
http://www.techlogica.us/icons/free/16x16.php
and download the free icons zip.
http://www.techlogica.us/download.php?id=freeicons
Check the zip with a virus scanner.
Unzip the zip file.
There will be a folder BMP.
Inside there are 16 pixel buttons.
Rename
16_button_red.bmp to JShot.bmp
16_button_green.bmp to JScold.bmp
and copy and paste the two buttons into the folder
of the skin that you use, for example
/skins/Phoenity.
Open the file toolbars.cfg inside the skins folder
/skins/Phoenity and open it in Notepad.
At the bottom before the line
# EXAMPLE-----------------
put in the following:

Javascript button{
JavaScript {
macros(pref_ToggleJavaScript)
Block JavaScript
JScold.bmp
JShot.bmp
}
}

and in the menu of Notepad press "Save" to save the edited
file back to its origin.

Open Notepad again to write the necessary macro "jsbutton.kmm"

Copy and paste the following :

_pref_SyncButtons{
$__c="CheckButton"; $__m=",macros(pref_Toggle";
# Javascript button (make sure the toolbar name is correct):
$__toolbar="Javascript button";
pluginmsg(toolbars,$__c,$__toolbar.$__m."JavaScript),".(getpref(BOOL,$pref_JavaScript)?0:1));
}
$OnLoad=$OnLoad."_pref_SyncButtons;";
$OnStartup=$OnStartup."_pref_SyncButtons;";
$pref_JavaScript="javascript.enabled";
pref_ToggleJavaScript{
menuchecked=!getpref(BOOL,$pref_JavaScript);
togglepref(BOOL,$pref_JavaScript); &_pref_SyncButtons;
statusbar(sub("%s",!getpref(BOOL,$pref_JavaScript)?$off:$on,_("JavaScript execution %s")));
}

And save the file as "All Files", not as "Text"
to name it jsbutton.kmm . The ending must be .kmm, not .kmm.txt .
Put this file into the folder "macros" inside the
K-Meleon main folder.

After a browser restart you should have a button for javascript,
red for enabled. green for disabled.

Fred

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: bellgamin
Date: April 25, 2010 08:32AM

@JamesD- I tried your suggestion but nothing happened. So I undid all of the changes. I guess I need really step-by-step instructions such as those provided by Fred. Sorry.

@Fred- It works, but with one minor glitch. The button is there, and it does toggle between JS on/off. However, the button stays red all the time except when I float my cursor over it, during which time it temporarily turns green. But it stays red, no matter whether JS is on, when my cursor doesn't float above it.

I checked & re-checked to ensure I had followed your instructions to the letter. I could find no errors (not surprising because I did cut&paste every step of the way).

If there is a fix, please let me know. However, I am VERY happy with this JS quick-change button even as it is.

Many many thanks for this!!! (^_^)

Aloha,
Bellgamin



Edited 1 time(s). Last edit at 04/25/2010 08:33AM by bellgamin.

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: siria
Date: April 25, 2010 08:55AM

Hmm, must admit am riddling a bit about the jsbutton.kmm....
Isn't that function included anyway in main.kmm, as well as icons?
Or the privacy button wouldn't work either...?
And why create two new toolbars with that button, one manually in toolbars.cfg, the other via additional macro..?
But perhaps he's using a special version of KM, that doesn't have the privacy bar included by default, no idea.



Edited 2 time(s). Last edit at 04/25/2010 09:24AM by siria.

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: JujuLand
Date: April 25, 2010 04:29PM

Here is the macros I use. I have adapted it, because it is used under Linux, but I think it must work. I have clean the source of functions just needed for Linux.

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- JavaScript helper button -----------------------------------------
#
# Dependencies	: none
# Resources	: -
# Preferences	: none
#
# ---------------------------------------------------------------------------------------------------

# Public variable
$_JavaScriptHelper_Tooltip=_("Reload the page with JavaScript or disable JavaScript");
# --------------------------------------------------------------------------------------------------

_ReloadPageWithJavaScript{
menuchecked=(getpref(BOOL,"javascript.enabled")==false);
macroinfo=$_JsHelper_Tooltip;
togglepref(BOOL,"javascript.enabled");
&_pref_SyncButtons; &_JavaScriptHelper_SyncButtons;
$URLBAR=$URL;
getpref(BOOL,"javascript.enabled")?id(ID_NAV_GO):0;
}

_Auto_disable_Javascript{
macroinfo=_("Disable Javascript automatically or not during OnInit() and OnQuit()");
menuchecked=(getpref(BOOL,"extensions.jshelper.auto.disableJS"));
togglepref(BOOL,"extensions.jshelper.auto.disableJS");
getpref(BOOL,"extensions.jshelper.auto.disableJS")?setpref(BOOL,"javascript.enabled",false):0;
&_pref_SyncButtons;&_JavaScriptHelper_SyncButtons;
}

_JavaScriptHelper_SyncButtons{
$__c="CheckButton"; $__m=",macros(_ReloadPageWithJavaScript";$_jspref="javascript.enabled";
$__toolbar="JavaScriptHelper";
pluginmsg(toolbars,$__c,$__toolbar.$__m."),".(getpref(BOOL,$_jspref)?1:0));
}

# ---------------------------------------------------------------------------------------------------

_JavaScriptHelper_BuildMenu{
setmenu("_Config_General",separator,"blabla");
setmenu("_Config_General",popup,"&JavaScript Helper",0);
setmenu("JavaScript Helper",macro,"Reload page with &JavaScript",_ReloadPageWithJavaScript);
setmenu("JavaScript Helper",separator,"baba");
setmenu("JavaScript Helper",macro,"&Automatically disabling JavaScript",_Auto_disable_Javascript);
}

_JavaScriptHelper_OnInit{
getpref(BOOL,"extensions.jshelper.auto.disableJS")?setpref(BOOL,"javascript.enabled",false):0;
}

_TuxHelper_OnQuit{
getpref(BOOL,"extensions.jshelper.auto.disableJS")?setpref(BOOL,"javascript.enabled",false):0;
}

_JavaScriptHelper_BuildToolbar{
$Large=(index(readfile(getfolder("SkinFolder")."\\..\\skins.ini"),getpref(STRING,"kmeleon.general.skinsCurrent")."=1")>-1);
$Large ? pluginmsg(toolbars,"AddToolbar","JavaScriptHelper,24,24",""):pluginmsg(toolbars,"AddToolbar","JavaScriptHelper,16,16","");
$Large ? pluginmsg(toolbars,"AddButton","JavaScriptHelper,JavaScript_Helper,macros(_ReloadPageWithJavaScript),Reload page with &JavaScript,".$_JavaScriptHelper_Tooltip.",24,24,"."jsHelper_large.bmp[2],"."jsHelper_large.bmp[1]",""):0;
$Large ? 0:pluginmsg(toolbars,"AddButton","JavaScriptHelper,JavaScript_Helper,macros(_ReloadPageWithJavaScript),Reload page with &JavaScript,".$_JavaScriptHelper_Tooltip.",16,16,"."jsHelper.bmp[2],"."jsHelper.bmp[1]","");
}

# ---------------------------------------------------------------------------------------------------
$OnInit=$OnInit."_JavaScriptHelper_BuildMenu;_JavaScriptHelper_OnInit;";
$OnSetup=$OnSetup."_JavaScriptHelper_BuildToolbar;";
$OnQuit=$OnQuit."_JavaScriptHelper_OnQuit;";
# ---------------------------------------------------------------------------------------------------
$macroModules=$macroModules."JavaScriptHelper;";

It's in fact a macrofile named TuxHelper, which includes other functions fon Linux. I give the source too for fred or other Linux users.

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- Tux needed functions for some special reason -----------------------------------------
#
# Dependencies	: none
# Resources	: -
# Preferences	: none
#
# ---------------------------------------------------------------------------------------------------

# Public variable
$tux=substr(readfile("Z:\\etc\\group"),0,1);
$_TuxHelper_Tooltip=_("Reload the page with JavaScript or disable JavaScript");

# Keep various Linux OS info to make K-Meleon Linux userString
# As i haven't been succefull when trying to launch uname from here and keeping infos, you'll must to update
# the values here
$_uname_s="Linux";
$_uname_m="686";

# same remark for gecko version and date
$_gecko_v="1.8.1.21";
$_gecko_d="20090331";

# Continue here without problem, except 
$_tuxvers=readfile("Z:\\boot\\grub\\menu.lst");$_tuxvers=substr($_tuxvers,length($_tuxvers)-400);
$_tuxvers=substr($_tuxvers,index($_tuxvers,"title")+7);
$_tuxvers=sub(" ","/",substr($_tuxvers,0,index($_tuxvers,",")));
# Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.8.1.21) Gecko/20090331 Ubuntu/8.10 (Intrepid) K-Meleon/1.5.3 
$_tuxString="Mozilla/5.0 (X11; ".getpref(STRING,"general.useragent.security")."; ".$_uname_s." ".$_uname_m."; ".getpref(STRING,"general.useragent.locale")."; rv:".$_gecko_v.") Gecko/".$_gecko_d." ".$_tuxvers." ".getpref(STRING,"general.useragent.vendor")."/".getpref(STRING,"general.useragent.vendorSub");
$_rg=1;$_string="";

# ---------------------------------------------------------------------------------------------------

Win2TuxConvert{
$_err=0;$_drive="";
substr($_URL,0,8)=="resource"?$_URL="file:///".getfolder(RootFolder).substr($_URL,11):0;
$_local=$tux.(substr($_URL,0,8)=="file:///"?"1":"");
length($_local)==2?$_URL=substr($_URL,8):0;
length($_local)==2?$_drive=substr($_URL,0,2):0;
length($_local)==2?(substr($_drive,0,1)=="Z"?$_drive="":0):0;
substr($_drive,1,1)==":"?$_drive=substr(getpref(STRING,"extensions.tuxhelper.drive.".substr($_drive,0,1),0,2)):0;
length($_local)==2?(length($_drive)>2?$_URL=$_drive.substr($_URL,2):0):0;
$_URL=gsub("\\","/","file://".$_URL);
$_URL=gsub(" ","%20",$_URL);
}

# ---------------------------------------------------------------------------------------------------

OpenMailto{
menugrayed=substr($LinkURL,0,7)!="mailto:";
macroinfo=_("Open the current mailto link with mail client");
$tux==""?0:exec(getpref(STRING,"kmeleon.plugins.macros.mail.mailClient")." ".$LinkURL);
}

# ---------------------------------------------------------------------------------------------------
_Km_wineReg{
menuchecked=(readreg(HKCR,".kmm\\Content Type")!="");
macroinfo=_("Register file types to open css, kmm, and kml files");
$tux!=""?exec(getfolder(RootFolder)."\\tools\\Km_wineReg.exe"):0;
}

_Km_Linux{
menuchecked=(getpref(STRING,"general.useragent.override")==$_tuxString);
$_rg=1;$_string="";
while (getpref(STRING,"kmeleon.privacy.useragent".$_rg.".name")!="K-Meleon Linux") &_UserStringWhile;
$_string==""?0:&_TuxUserStrings;
setpref(STRING,"general.useragent.override",$_tuxString);
#&_UserAgent_SyncMenu;&_UserAgent;
}

_UserStringWhile{
getpref(STRING,"kmeleon.privacy.useragent".$_rg.".name")==""?$_string="K-Meleon Linux":0;
getpref(STRING,"kmeleon.privacy.useragent".$_rg.".name")==""?setpref(STRING,"kmeleon.privacy.useragent".$_rg.".name","K-Meleon Linux"):0;
$_string==""?$_rg=$_rg+1:0;
}

_TuxUserStrings{
setpref(STRING,"kmeleon.privacy.useragent".$_rg.".string",$_tuxString);
$_rg=$_rg+1;
setpref(STRING,"kmeleon.privacy.useragent".$_rg.".name","Opera 9.23");
setpref(STRING,"kmeleon.privacy.useragent".$_rg.".string","Opera/9.23 (Windows NT 5.1; U; en)");
alert(_("Due to macro limitations, it's not possible to upgrade UserString menu")."\n\n"._("UserStrings have been set, but you need to restart K-Meleon")."\n"._("to see the modifications"),_("Warning"));
}

_MailtoError{
menuchecked=(getpref(BOOL,"network.protocol-handler.external.mailto")==true);
macroinfo=(getpref(BOOL,"network.protocol-handler.external.mailto")==true?_("Show the mailto error message"):_("Hide the mailto error message"));
getpref(BOOL,"network.protocol-handler.external.mailto")==true?delpref("network.protocol-handler.expose.mailto"):setpref(BOOL,"network.protocol-handler.expose.mailto",false);
getpref(BOOL,"network.protocol-handler.external.mailto")==true?delpref("network.protocol-handler.warn-external.mailto"):setpref(BOOL,"network.protocol-handler.warn-external.mailto",false);
getpref(BOOL,"network.protocol-handler.external.mailto")==true?delpref("network.protocol-handler.external.mailto"):setpref(BOOL,"network.protocol-handler.external.mailto",true);
}

_ReloadPageWithJavaScript{
menuchecked=(getpref(BOOL,"javascript.enabled")==false);
macroinfo=$_TuxHelper_Tooltip;
togglepref(BOOL,"javascript.enabled");
&_pref_SyncButtons; &_TuxHelper_SyncButtons;
$URLBAR=$URL;
getpref(BOOL,"javascript.enabled")?id(ID_NAV_GO):0;
}

_Auto_disable_Javascript{
macroinfo=_("Disable Javascript automatically or not during OnInit() and OnQuit()");
menuchecked=(getpref(BOOL,"extensions.tuxhelper.auto.disableJS"));
togglepref(BOOL,"extensions.tuxhelper.auto.disableJS");
getpref(BOOL,"extensions.tuxhelper.auto.disableJS")?setpref(BOOL,"javascript.enabled",false):0;
&_pref_SyncButtons;&_TuxHelper_SyncButtons;
}

_apt_OpenLink{
macroinfo=_("Install a Debian/Ubuntu software package");
menugrayed=(substr($LinkURL,0,6)!="apt://");
exec("z:\\usr\\bin\\gnome-terminal -x sudo apturl ".$LinkURL);
}

_TuxHelper_SyncButtons{
$__c="CheckButton"; $__m=",macros(_ReloadPageWithJavaScript";$_jspref="javascript.enabled";
$__toolbar="TuxHelper";
pluginmsg(toolbars,$__c,$__toolbar.$__m."),".(getpref(BOOL,$_jspref)?1:0));
}

# ---------------------------------------------------------------------------------------------------

_TuxHelper_BuildMenu{
setmenu("_Config_General",separator,"blabla");
setmenu("_Config_General",popup,"Tu&x Helper",0);
setmenu("Tu&x Helper",macro,"Reload page with &JavaScript",_ReloadPageWithJavaScript);
setmenu("Tu&x Helper",separator,"baba");
setmenu("Tu&x Helper",macro,"&Automatically disabling JavaScript",_Auto_disable_Javascript);
setmenu("Tu&x Helper",macro,"&Registring Km extensions",_Km_wineReg);
setmenu("Tu&x Helper",separator,"bibi");
setmenu("Tu&x Helper",macro,"Hide the mailto error message",_MailtoError);
setmenu("Tu&x Helper",separator,"bobo");
setmenu("Tu&x Helper",macro,"&Set userString to 'K-Meleon under Linux'",_Km_Linux);
# Mailto for Linux & Debian/Ubuntu package
setmenu(LinkSave,separator,"begin");
setmenu(LinkSave,macro,"Open Mailto Lin&k...",OpenMailto);
setmenu(LinkSave,macro,"&Install a Debian/Ubuntu software package",_apt_OpenLink);
setmenu(LinkSave,separator,"end");
}

_TuxHelper_OnInit{
setpref(BOOL,"kmeleon.plugins.macros.modules.ie.load",false);
getpref(BOOL,"extensions.tuxhelper.auto.disableJS")?setpref(BOOL,"javascript.enabled",false):0;
getpref(STRING,"extensions.tuxhelper.drive.C")==""?$_message1=_("The path of the pseudo discs must to be declared in prefs.")."\n"._("For example, for drive C :")."\n\n"._("preftype = [string]")."\n"._("prefname = [extensions.tuxhelper.drive.C] (warning, C is upcased)")."\n"._("prefvalue = [/home/<user>/.wine/disc_c] (where <user> is obviously the linux username)")."\n\n":0;
getpref(STRING,"extensions.tuxhelper.drive.C")==""?$_message2=_("A sample pref has been created to help you to set this pref.")."\n\n"._("You must add as prefs as you use pseudo drives (except Zsmiling smiley.")."\n\n":0;
getpref(STRING,"extensions.tuxhelper.drive.C")==""?$_message3=_("To set these prefs : menu Edit > Config > Browser Configuration")."\n"._("Enter then tuxhelper in the search bar to restrict the display and to see the sample, right-click then to create prefs.")."\n\n"._("Once, the prefs are set, the message won't be displayed again.")."\n\n"._("You can open Wine Setup (Drives Tab) to see the drives and path.")."\n"._("Warning, the C disk path must be like the sample pref, not the one in Drives tab!!!"):0;
getpref(STRING,"extensions.tuxhelper.drive.C")==""?alert($_message1.$_message2.$_message3,_("Warning"),EXCLAIM):0;
getpref(STRING,"extensions.tuxhelper.drive.C")==""?setpref(STRING,"extensions.tuxhelper.drive.<letter>","/home/<user>/.wine/disc_c"):0;
}

_TuxHelper_OnQuit{
setpref(BOOL,"kmeleon.plugins.macros.modules.ie.load",false);
getpref(BOOL,"extensions.tuxhelper.auto.disableJS")?setpref(BOOL,"javascript.enabled",false):0;
getpref(STRING,"extensions.tuxhelper.drive.C")!=""?(getpref(STRING,"extensions.tuxhelper.drive.<letter>")!=""?delpref("extensions.tuxhelper.drive.<letter>"):0):0;
}

_TuxHelper_BuildToolbar{
$Large=(index(readfile(getfolder("SkinFolder")."\\..\\skins.ini"),getpref(STRING,"kmeleon.general.skinsCurrent")."=1")>-1);
$Large ? pluginmsg(toolbars,"AddToolbar","TuxHelper,24,24",""):pluginmsg(toolbars,"AddToolbar","TuxHelper,16,16","");
$Large ? pluginmsg(toolbars,"AddButton","TuxHelper,Tux_Helper,macros(_ReloadPageWithJavaScript),Reload page with &JavaScript,".$_TuxHelper_Tooltip.",24,24,"."tuxhelper_large.bmp[2],"."tuxhelper_large.bmp[1]",""):0;
$Large ? 0:pluginmsg(toolbars,"AddButton","TuxHelper,Tux_Helper,macros(_ReloadPageWithJavaScript),Reload page with &JavaScript,".$_TuxHelper_Tooltip.",16,16,"."tuxhelper.bmp[2],"."tuxhelper.bmp[1]","");
}

# ---------------------------------------------------------------------------------------------------
$OnInit=$OnInit."_TuxHelper_BuildMenu;_TuxHelper_OnInit;";
$OnSetup=$OnSetup."_TuxHelper_BuildToolbar;";
$OnQuit=$OnQuit."_TuxHelper_OnQuit;";
# ---------------------------------------------------------------------------------------------------
$macroModules=$macroModules."TuxHelper;";

I hope having correctly simplificate the macro files, but I haven't test it.

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



Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: forever
Date: April 25, 2010 05:51PM

you just need F7 to enable or disable Javascript

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: Fred
Date: April 25, 2010 06:20PM

@siria and forever

Th separate javascript button ise useful, if you
want this function only, because the privacy bar
uses a whole new bar line, It also indicates if
javascript is disabled or not, which F7 alone
does not do.

Thanks to jujuland for his extensive macro.

To make my simpler macro work correctly, the
macro for the privacy bar from the file main.kmm
must be inserted into the jsbutton.kmm macro,
because else it collides with checking the
buttons for the privacy bar.

The correct macro jsbutton is as follows :

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- Javascript button ----------------------------
#
# Dependencies : -
# Resources : -
# Preferences : -
#
# ----------------------------------------------------------------------


_pref_SyncButtons{
$__c="CheckButton"; $__m=",macros(pref_Toggle";
# Javascript button (make sure the toolbar name is correct):
$__toolbar="Javascript button";
pluginmsg(toolbars,$__c,$__toolbar.$__m."JavaScript),".(getpref(BOOL,$pref_JavaScript)?0:1));
# Privacy Bar (make sure the toolbar name is correct):
$__toolbar="&Privacy Bar";
pluginmsg(toolbars,$__c,$__toolbar.$__m."Animation),".(getpref(STRING,$pref_Animation)=="none"?1:0));
pluginmsg(toolbars,$__c,$__toolbar.$__m."Colors),".(getpref(BOOL,$pref_Colors)?0:1));
pluginmsg(toolbars,$__c,$__toolbar.$__m."Cookies),".(getpref(INT,$pref_Cookies)==2?1:0));
pluginmsg(toolbars,$__c,$__toolbar.$__m."Images),".(getpref(INT,$pref_Images)==1?0:1));
pluginmsg(toolbars,$__c,$__toolbar.$__m."Java),".(getpref(BOOL,$pref_Java)?0:1));
pluginmsg(toolbars,$__c,$__toolbar.$__m."JavaScript),".(getpref(BOOL,$pref_JavaScript)?0:1));
pluginmsg(toolbars,$__c,$__toolbar.$__m."Popups),".(getpref(BOOL,$pref_Popups)?1:0));
pluginmsg(toolbars,$__c,$__toolbar.$__m."Referer),".(getpref(INT,$pref_Referer)==0?1:0));
# Main Bar (make sure the toolbar name is correct):
$__toolbar="&Main Bar";
pluginmsg(toolbars,$__c,$__toolbar.$__m."Popups),".(getpref(BOOL,$pref_Popups)?1:0));
}
$OnLoad=$OnLoad."_pref_SyncButtons;";
$OnStartup=$OnStartup."_pref_SyncButtons;";
$pref_JavaScript="javascript.enabled";
pref_ToggleJavaScript{
menuchecked=!getpref(BOOL,$pref_JavaScript);
togglepref(BOOL,$pref_JavaScript); &_pref_SyncButtons;
statusbar(sub("%s",!getpref(BOOL,$pref_JavaScript)?$off:$on,_("JavaScript execution %s")));
}
# -----------------------------------------------------------------------
$macroModules=$macroModules."jsbutton;";


Save as jsbutton.kmm and put it into the folder "macros"
inside the K-Meleon main folder.
If the button should not work correctly, create a new
separate profile, to look if it works there.

Fred

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: JujuLand
Date: April 25, 2010 06:41PM

Fred,

here is a macro to replace mail function which doesn't work under Linux.It uses also Tuxhelper for some details.

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- Mail And News Functionality adapted for Linux ---------------------------------------------------------
#
# Dependencies	: main.kmm ($macroPrefBranch, JS)
# Resources	: -
# Preferences	: kmeleon.plugins.macros.mailClient
#		  kmeleon.plugins.macros.newsClient
#
# ------------------------------------------------------------------------------------------------------------------

Mail_SendPageURL{
macroinfo=_("Send a link to the current page by mail");
$JS_doit="location='mailtomoody smileysubject='+encodeURIComponent(title)+'&body='+encodeURIComponent(URL)";
$TITLE==""?$_title=$URL:$_title=$TITLE;
$tux==""?&JS_hndlTop:exec(getpref(STRING,"kmeleon.plugins.macros.mail.mailClient")." mailtomoody smileysubject=".$_title."&body=".$URL);
}
Mail_SendLinkURL{
macroinfo=_("Send the current link by mail");
$tux==""?$JS_doitLink="j=a.length;location='mailtomoody smileybody='+encodeURIComponent(href)":0;
$tux==""?&JS_hndlLink:exec(getpref(STRING,"kmeleon.plugins.macros.mail.mailClient")." mailtomoody smileysubject=".$LinkURL."&body=".$LinkURL);
}
Mail_SendImageURL{
macroinfo=_("Send a link to the current image by mail");
$tux==""?$JS_doitImage="a=false;location='mailtomoody smileysubject='+encodeURIComponent((title)?titlesad smiley(alt)?alt:document.title))+'&body='+encodeURIComponent(src)":0;
$tux==""?$JS_doitInput=$JS_doitImage:0;
$tux==""?&JS_hndlImage:exec(getpref(STRING,"kmeleon.plugins.macros.mail.mailClient")." mailtomoody smileysubject=Image >> ".$ImageURL."&body=".$ImageURL);
}
Mail_SendFrameURL{
macroinfo=_("Send a link to the current frame by mail");
$tux==""?$JS_doit="location='mailtomoody smileysubject='+encodeURIComponent(title)+'&body='+encodeURIComponent(URL)":0;
$tux==""?&JS_hndlDoc:exec(getpref(STRING,"kmeleon.plugins.macros.mail.mailClient")." mailtomoody smileysubject=".$TITLE."&body=".$LinkURL);
}
Mail_SendSelection{
macroinfo=_("Send the selected text by mail");
$tux==""?$JS_doit="if(window.getSelection())location='mailtomoody smileysubject='+encodeURIComponent(title)+'&body='+encodeURIComponent(window.getSelection())":0;
$SelectedText==""?0:&Mail_ExecSelect;
}
Mail_ExecSelect{
$TITLE==""?$_title=$URL:$_title=$TITLE;
$tux==""?&JS_hndlDoc:exec(getpref(STRING,"kmeleon.plugins.macros.mail.mailClient")." mailtomoody smileysubject=".$_title."&body=".$SelectedText);
}

# ------------------------------------------------------------------------------------------------------------------
$macroModules=$macroModules."Mail;";

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 1 time(s). Last edit at 04/25/2010 06:41PM by JujuLand.

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: Fred
Date: April 25, 2010 08:02PM

@ Jujuland

Thank you for your macros.
It seems that Mail.kmm needs TuxHelper.kmm
to build the menu.
The personal problem to use it for me seems to be that
TuxHelper is looking for an installed Linux version
on a harddisk, while I am using various Linux distros
working uninstalled from RAM.
I am trying to look up the parts of the macros that
I can use in my personal way of using Linux,
Your good ideas when writing the macros can probably
help me to make more functions available in new personal
macros, also for the NX versions, where extensions do
not work.
Thanks again for your work,

Fred

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: JujuLand
Date: April 25, 2010 08:14PM

In fact, the problem could perhaps be the way used to be sure we're using linux.

I have choosen to test /etc/groups because I thought it was a file used by all linux distro, but I perhaps fail ???

Just a part which only works on debian/Ubuntu/other? is the way to handle deb files.

I don't know the way you use Linux installed in ram, and can't give you things to change in this case. But I presume that the system structure is the same ?

There is not &a lot of path in the structure, and I suppose it's not a hard job to modify it.

Tell me the problems you encounter, and I will help you if I can. But I'm aware of a way to keep the few infos I'm not able to keep to generate linux userstring.

I'm aware also of a way to make mailto to work. I have tried to enter manually all the registry keys I have found but it doesn't work. If you have an idea...

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



Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: bellgamin
Date: April 25, 2010 08:16PM

Quote
Fred
Save as jsbutton.kmm and put it into the folder "macros"
inside the K-Meleon main folder.
If the button should not work correctly, create a new
separate profile, to look if it works there.

Fred
I saved the revised jsbutton.kmm. The change had no evident effect on what I reported earlier.

I then created a new profile, per your suggestion. Still no effect. The button insists on remaining red unless the cursor is floated over it.

However, the JS status (enabled or disabled) shows at the bottom info bar each time I press the button so that is just fine. I much prefer using this single button to using the long Privacy bar.

Too bad the Privacy bar couldn't be located in the bar at the bottom. That bar has plenty of unused room on its right side.

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: Fred
Date: April 26, 2010 05:30AM

@ bellgamin

The javascript button should actually work now,
I have tested it in XP and in Linux, I don't
know why it does not work for you.

@ Jujuland

I have written little macro OpenMailto.kmm, which can
be used in all Linux distros to send mail opening
Evolution, Sylpheed or Thunderbird , which seem
to be the most used mail apps.
It can be changed using the path for other mail apps.


# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ----------OpenMailto for Linux ----------------------------
#
# Dependencies : -
# Resources : -
# Preferences : -
#
# ----------------------------------------------------------------------

OpenMailto1{
macroinfo=_("Open the current mailto link with mail client");
alert(_("Copy and paste link"));
$mailclient1 = "Z:\\usr\\bin\\xterm -e /usr/bin/evolution";
exec($mailclient1);
}

OpenMailto2{
macroinfo=_("Open the current mailto link with mail client");
$mailclient2 = "Z:\\usr\\bin\\xterm -e /usr/bin/sylpheed --compose ";
exec($mailclient2 .$LinkURL);
}

OpenMailto3{
macroinfo=_("Open the current mailto link with mail client");
alert(_("Copy and paste link"));
$mailclient3 = "Z:\\usr\\bin\\xterm -e /usr/bin/thunderbird -compose to=";
exec($mailclient3 .$LinkURL);
}
_OpenMailto_BuildMenu{
# Mailto for Linux & Debian/Ubuntu package
setmenu(LinkSave,separator,"begin");
setmenu(LinkSave,macro,"Open Mailto Lin&k with Evolution",OpenMailto1);
setmenu(LinkSave,macro,"Open Mailto Lin&k with Sylpheed",OpenMailto2);
setmenu(LinkSave,macro,"Open Mailto Lin&k with Thunderbird",OpenMailto3);
setmenu(LinkSave,separator,"end");
}

$OnInit=$OnInit."_OpenMailto_BuildMenu;";

# -----------------------------------------------------------------------
$macroModules=$macroModules."OpenMailto;";

Regards
Fred

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: JujuLand
Date: April 26, 2010 07:18AM

Hum, I think I don't have correctly explain the problem I have with mailto.

When we click on a mailto link, we have an error message saying that this protocol isn't implemented, or something like this.

I have also made a contextual macro that does the trick, , but I ought to make the normal way to work. Your macro is interesting only if you use more than one client.

In the version I give, the macro uses the mail declared in pref, and must work with all the clients. The only thing needed is to give the good path z:\usr\bin\....

In fact mailto uses registry keys as HKLM\Clients\mail for example, but many others and probably uses windows dll, and it's probably what is missing...

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 1 time(s). Last edit at 04/26/2010 07:19AM by JujuLand.

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: Zoohooter
Date: April 26, 2010 06:12PM

@bellgamin
curious what system are you using? I just completed Fred's initial instructions and it worked like like a charm red=enabled green=disabled. XP Home SP3 KM 1.5.4

@Fred
Thanks Fred! Great additionsmiling smiley I was using F7 but if you forgot whether it was on or not, you had to press it and look at the bottom of the screen. This way you just glance above to see. I really did not like having the privacy bar in view because of all of the other buttons that take up a lot of real estate and had the same restriction as F7. Thanks again.

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: Davep
Date: April 26, 2010 06:42PM

Quote
Zoohooter
@bellgamin
curious what system are you using? I just completed Fred's initial instructions and it worked like like a charm red=enabled green=disabled. XP Home SP3 KM 1.5.4

Works great for me too. W2K SP4

bellgamin,
I did notice that if you leave your pointer/cursor hovering over the button after changing the on/off status, the colour does not change, until you move the pointer away from the button.

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: siria
Date: April 26, 2010 09:43PM

Strongly agree about the visibility!

And can understand that people have different tastes and not everyone may like the built-in broad JS button.
But still it's the easiest way to get such a button, so I'd just like to make a little summary of *build-in* stuff, for later reading newbies perhaps, who must really think by now this were horribly complicated :O Which is not!

- How to get the build-in "privacy" toolbar visible, with javascript button (and others):
View > Toolbars > Privacy Bar

- Want to shorten the toolbar to 1 button?
Edit > Configuration > Toolbars (=toolbars.cfg in skin folder)
Search for "Privacy Bar", and put #-comment-signs at all lines of other privacy buttons to hide. Save and restart. That's all, if you don't mind the broad button with text "javascript" on it!


- Want to also change the button image, e.g. to one with the same size as "normal" buttons?
There it gets a bit more complicated, because all buttons inside one toolbar must have the same size, so better create a separate toolbar for this... follow instructions above from Fred... ;-)

Quote
bellgamin
I saved the revised jsbutton.kmm. The change had no evident effect on what I reported earlier.

Strange... Are you really 100% sure that your new toolbar name in toolbars.cfg is exactly "Javascript button"??
And the new macro has the ending .kmm not .kmm.txt, and is in a macros folder?

Because it's your change in toolbars.cfg that *creates* that button, while the only purpose of this additional kmm-file is showing the red or green state, so it would be somehow pointless if you don't really use its function ;-)

Quote
Fred
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- Javascript button ----------------------------

_pref_SyncButtons{
$__c="CheckButton"; $__m=",macros(pref_Toggle";
# Javascript button (make sure the toolbar name is correct):
$__toolbar="Javascript button";
pluginmsg(toolbars,$__c,$__toolbar.$__m."JavaScript),".(getpref(BOOL,$pref_JavaScript)?0:1));

# Privacy Bar (make sure the toolbar name is correct):
$__toolbar="&Privacy Bar";
pluginmsg(toolbars,$__c,$__toolbar.$__m."Animation),".(getpref(STRING,$pref_Animation)=="none"?1:0));
pluginmsg(toolbars,$__c,$__toolbar.$__m."Colors),".(getpref(BOOL,$pref_Colors)?0:1));
pluginmsg(toolbars,$__c,$__toolbar.$__m."Cookies),".(getpref(INT,$pref_Cookies)==2?1:0));
pluginmsg(toolbars,$__c,$__toolbar.$__m."Images),".(getpref(INT,$pref_Images)==1?0:1));
pluginmsg(toolbars,$__c,$__toolbar.$__m."Java),".(getpref(BOOL,$pref_Java)?0:1));
pluginmsg(toolbars,$__c,$__toolbar.$__m."JavaScript),".(getpref(BOOL,$pref_JavaScript)?0:1));
pluginmsg(toolbars,$__c,$__toolbar.$__m."Popups),".(getpref(BOOL,$pref_Popups)?1:0));
pluginmsg(toolbars,$__c,$__toolbar.$__m."Referer),".(getpref(INT,$pref_Referer)==0?1:0));
# Main Bar (make sure the toolbar name is correct):
$__toolbar="&Main Bar";
pluginmsg(toolbars,$__c,$__toolbar.$__m."Popups),".(getpref(BOOL,$pref_Popups)?1:0));
}

$OnLoad=$OnLoad."_pref_SyncButtons;";
$OnStartup=$OnStartup."_pref_SyncButtons;";
$pref_JavaScript="javascript.enabled";

pref_ToggleJavaScript{
menuchecked=!getpref(BOOL,$pref_JavaScript);
togglepref(BOOL,$pref_JavaScript); &_pref_SyncButtons;
statusbar(sub("%s",!getpref(BOOL,$pref_JavaScript)?$off:$on,_("JavaScript execution %s")));
}


# -----------------------------------------------------------------------
$macroModules=$macroModules."jsbutton;";

To explain what this does technically:

It copies and overrules the same macro command "_pref_SyncButtons" from main.kmm, with the purpose to include the red lines in this macro, so that firing this macro also updates the pressed state of that additional new toolbar. The very same effect as if those lines were added directly inside the main.kmm.

Every time the javascript button is pressed, the macro "pref_ToggleJavaScript" is started (bold in gray above), which then toggles the javascript pref, puts a text in the status bar, and fires the macro "_pref_SyncButtons" (on top above), which updates the button image states. Which now include the new toolbar.

By the way copying and overruling the gray parts too doesn't really seem needed to me, since they don't change anything from the original in main.kmm...

-------

Thinking about it, one could also just open toolbars.cfg and rename the original "&Privacy Bar" to anything else ("Privacy Bar renamed"?), then copy its javascript button lines above it, and name this new toolbar "&Privacy Bar". Then no additional macro files are needed, since the original main.kmm toggles the pressed state of this one, instead of the renamed "real" Privacy Bar. Which then would have the problem of not staying pressed, while the new button works fine :cool:
Would look this way:

&Privacy Bar(64,13){

%ifplugin macros

JavaScript{
macros(pref_ToggleJavaScript)|&Privacy
Block JavaScript. Press F7 to toggle.
privhot.bmp[5]
privcold.bmp[5]

}

%endif
}

Privacy Bar Renamed(64,13){
...etc....

Have added the Privacy Menu on right-click :cool:
The images can be any name of course (red.bmp/green.bmp?), and the size as well, as long as it's written instead of the old size above (64,13 in Phoenity Skin).



Edited 1 time(s). Last edit at 04/26/2010 09:50PM by siria.

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: Fred
Date: April 26, 2010 09:47PM

@ Jujuland

I have used mailto in Windows again after quite
a while that I did not use it, and realized that
it seems to call up Outlook Express with no way
to change that, as far as I can see. It is also
not in about:config . I tried to make a new pref
for network.protocol-handler.app.mailto
with a different mail client, but it did not work.
Changing the mail client does not change the
behaviour of mailto. I think that this is not good
in Windows already.
So why is it necessary in Linux to call up the
registry and calling up the system data.
Would it not be easier to give just the
possibility to set a mail client in prefs
and to make a macro to call up the client
using the pref kmeleon.plugins.macros.mail.mailClient
to start the selected mail client ?
This would be an easier task, and would also be
usable for all distros alike.

Fred

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: JujuLand
Date: April 27, 2010 04:59PM

Fred,

Yes it's easier to have just a context menu to open a new mail using the declared mail client, but it's not exactly the same thing that clicking on a mailto link to open it.

But It works under Windows, even it can perhaps use a dll iof Outlook express or windows mail.

Don't bother, the contextual menu works.

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



Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: Fred
Date: April 27, 2010 08:10PM

I have improved my Openmailto macro for Linux a bit, adding a part
to open a mailto-link with a configured arbitrary
mail client, and adding a SendMail entry for the
menu Tools/Mail and News.

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ----------OpenMailto for Linux ----------------------------
#
# Dependencies : -
# Resources : -
# Preferences : -
#
# ----------------------------------------------------------------------
_Mail_tolink{
$_client=getpref(STRING,$_pref); $_client==""?macros($_macro):0; $_client==""?0: (index($_client,"://")==-1?exec($_client)yawning smileypennew($_client .$LinkURL));
}
Mail_SendMail{
macroinfo=_("Open your client for sending mail");
$_pref=$_Mail_pref_mailClient; $_macro="Mail_ConfigureMail"; &_Mail_tolink;
}
OpenMailto1{
macroinfo=_("Open the current mailto link with Evolution");
$mailurl=gsub("mailto:","",$LinkURL);
$tmp = setclipboard($mailurl);
alert("Paste address in clipboard into Evolution");
$mailclient1 = "Z:\\usr\\bin\\xterm -e /usr/bin/evolution";
exec($mailclient1);
}

OpenMailto2{
macroinfo=_("Open the current mailto link with Sylpheed");
$mailclient2 = "Z:\\usr\\bin\\xterm -e /usr/bin/sylpheed --compose ";
exec($mailclient2 .$LinkURL);
}

OpenMailto3{
macroinfo=_("Open the current mailto link with Thunderbird");
$mailurl=gsub("mailto:","",$LinkURL);
$tmp = setclipboard($mailurl);
alert("Paste address in clipboard into Thunderbird");
$mailclient3 = "Z:\\usr\\bin\\xterm -e /usr/bin/thunderbird -compose to=";
exec($mailclient3 .$LinkURL);
}
OpenMailto4{
macroinfo=_("Open the current mailto link with mail client");
$mailurl=gsub("mailto:","",$LinkURL);
$tmp = setclipboard($mailurl);
alert("Paste address in clipboard into Mailclient");
$_pref=$_Mail_pref_mailClient; $_macro="Mail_ConfigureMail"; &_Mail_tolink;
}

_OpenMailto_BuildMenu{
# Mailto and SendMail for Linux
setmenu(LinkSave,separator,"begin");
setmenu(LinkSave,macro,"Open Mailto Lin&k with Evolution",OpenMailto1);
setmenu(LinkSave,macro,"Open Mailto Lin&k with Sylpheed",OpenMailto2);
setmenu(LinkSave,macro,"Open Mailto Lin&k with Thunderbird",OpenMailto3);
setmenu(LinkSave,macro,"Open Mailto Lin&k with Mailclient",OpenMailto4);
setmenu(LinkSave,separator,"end");
setmenu(_Mail_Mail,macro,"Send &Mail",Mail_SendMail);
}

$OnInit=$OnInit."_OpenMailto_BuildMenu;";

# -----------------------------------------------------------------------
$macroModules=$macroModules."OpenMailto;";



Fred

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: bellgamin
Date: April 28, 2010 05:50AM

Quote
siria
Strange... Are you really 100% sure that your new toolbar name in toolbars.cfg is exactly "Javascript button"??
And the new macro has the ending .kmm not .kmm.txt, and is in a macros folder?
THANKS!!!

Mea culpa Mea culpa! I had failed to follow Fred's instructions to make it .kmm & not .kmm.txt.

I have fixed that gaffe & now it works perfectly!

@Fred- Manifold apologies.



Edited 1 time(s). Last edit at 04/28/2010 05:53AM by bellgamin.

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: JujuLand
Date: April 29, 2010 07:58AM

@ Fred,

There is a problem with the name of the kmmfiles. They are executed in a certain order. Trying to install it from the code I send didn't work.

The first reason was obvious : the smiley replacing the characters ) and :

The second reason was the name I used.

The first was named TuxHelper.kmm, and the second TuxMail.kmm
I saw it with kko (there is a few time), it seems there is a bug.
Renaming the second tuxmail.kmm, makes it work.
The name of the module has no importance (it's here mail to refere to the original module which is load previously), but it would be better to change it to tuxmail

$macroModules=$macroModules."tuxmail;";

So, there is no need of your macro to choose the mail client, it uses the one declared in the mail path pref.
Just necessary if you use more than one mail client on the same install (??)

[Edit]

It works on a machine, but not on the other.
So, I have changed the way to make it work.
Just copy the PRIVATE part of mail.kmm in tuxmail.kmm
Launch K-Meleon and disable mail.kmm, so, the order has no more importance, and it works fine...

[/edit]


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 2 time(s). Last edit at 04/29/2010 10:42AM by JujuLand.

Attachments: tuxmail.kmm (2.4 KB)  
Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: Fred
Date: April 29, 2010 07:56PM

@ Jujuland

Thanks for the info.
I will try to use it after doing the necessary changes.
It is annoying that the smileys appear constantly
because the code tag does not work anymore.

Regards

Fred

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: JujuLand
Date: April 29, 2010 08:29PM

Here are the files which works on my Ubuntu 8.10 (the one I post in the thread)

Look at two last posts

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



Attachments: TUXhelper.kmm (9.5 KB)  
Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: Fred
Date: April 29, 2010 11:16PM

Thank you for the two files.
I had to add the Private part of mail.kmm to tuxmail.kmm ,
The configuration of tuxhelper in about:config is
not ideal, because the drive letter can not be modified,
only the username. There is also an error in the sample,
because it should be drive_c , not disc_c .
I think it would be easier to modify prefs.js .
The file main.kmm must also be in macros, to make it
possible to configure the mail client.
Left clicking on a mailto link still is not possible,
but I think that you wanted to open it by right click,
and this is working ok, although the link itself
is not in the compose window. In Sylpheed, the command line
would demand an option --compose at the end, but this seems
not to be supported here, the browser crashes.
The javascript toggle function works ok.

Fred

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: JujuLand
Date: April 30, 2010 07:15AM

Quote
Fred
I had to add the Private part of mail.kmm to tuxmail.kmm

Yes, and curiously, on the first computer I made it, it wasn't necessary, but the names were important.

Quote
Fred
The configuration of tuxhelper in about:config is
not ideal, because the drive letter can not be modified, only the username.

Yes, but it's the simpliest, because keeping registries values to add pref is more complicated ... for the developper smiling smiley

Quote
Fred
There is also an error in the sample, because it should be drive_c, not disc_c

You're right, and I see a smiley string which is also present, in the starting message.

Quote
Fred
I think it would be easier to modify prefs.js

Isn't it what we do ???, and even it's a bit less easy to do it wfrom within K-Meleon, it's easier for basic users.
To disable, when setted, the starting message, from within K-Meleon, just blank it.

Quote
Fred
The file main.kmm must also be in macros, to make it possible to configure the mail client.

Probably, but for most of users, it's like this. If you haven't this file, you have probably to set it manually in prefs.js

Quote
Fred
Left clicking on a mailto link still is not possible, but I think that you wanted to open it by right click, and this is working ok

Yes, and that's why I tried to implement it just modifying the registry, not to have to right-click which isn't a logical action to do.

Quote
Fred
although the link itself is not in the compose window.

When sending links ? or other send actions ?

Quote
Fred
In Sylpheed, the command line would demand an option --compose at the end

Send me an example of the complete string.

Quote
Fred
but this seems not to be supported here, the browser crashes

It crashes when adding --compose ?

Quote
Fred
The javascript toggle function works ok

Just mising here the buttons to put in skins/default

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 1 time(s). Last edit at 04/30/2010 07:17AM by JujuLand.

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: Fred
Date: April 30, 2010 03:05PM

Concerning about:config , I know that it would be easier
to set the pref there, if only the string would have to be changed,
but there is no modify option for the part
extensions.tuxhelper.drive.<drive> to change that.
It would need creating a whole new pref line to do that.
So I think changing the pref in prefs.cfg would be easier
for simple users.
Concerning putting the mailto link directly into the
Compose window of the mail client, I realized that
Sylpheed did not work correctly generally when the
Compose window was opened in the distro that I was testing on.
and crashed therefore. It works correctly with the
Sylpheed clone Claws-mail.It needs the same
pref string
Z:\usr\bin\xterm -e /usr/bin/claws-mail --compose
to put the mailto address directly into the Compose
window.
I habe not yet found the correct --option for Evolution
and Thunderbird to do that, may be there is no
command-line option for that at all for them.

Fred

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: JujuLand
Date: April 30, 2010 09:10PM

I use Thunderbird, and I test again (on this page) the various things to send by mail :

page URL

Subject: Java Script On/Off button?
Content: http://kmeleonbrowser.org/forum/read.php?1,106259,106453#msg-106453

Selected text

Subject: Java Script On/Off button?
Content: I realized thatSylpheed did not work correctly

Link

Subject: http://www.phorum.org/
Content: http://www.phorum.org/

Just a funny link ('Supprimer le message' admin menu):

Subject: javascript:if(window.confirm('Êtes vous sûr de vouloir supprimer ce message ?')) window.location='http://kmeleonbrowser.org/forum/moderation.php?1,1,106453';;

Content: javascript:if(window.confirm('Êtes vous sûr de vouloir supprimer ce message ?')) window.location='http://kmeleonbrowser.org/forum/moderation.php?1,1,106453';;

I don't remember the structure of the command, but it's in the macro, just look for the way I use to make the commandline.

It would perhaps not too much difficult to be able to generate mail for the more use mail client: thunderbird, Evolution, claws, and perhaps some others, just by having as function as client to adapt the commandline.

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 1 time(s). Last edit at 04/30/2010 09:13PM by JujuLand.

Options: ReplyQuote
Re: Java Script On/Off button?
Posted by: Fred
Date: May 02, 2010 06:27PM

I have retested your Tuxhelper/tuxmail macros with claw-mail.

"Send link URL" works alright, but only if --compose is used
at the end of the mail client pref.
The link is in "subject" and also in the text area.
"Send Text" puts only the first word of the text into "subject", here "Java".
"Send Page as Link" puts only the first word of the page title
into "subject", here "Java".
"New Message" pops up "mailto is not a registered protocol",
even if this has been disabled.
"Read mail" works ok.
Two menus for "Mail and News" are in the Tools menu.

Fred

Options: ReplyQuote
Pages: 123Next
Current Page: 1 of 3


K-Meleon forum is powered by Phorum.