Development :  K-Meleon Web Browser Forum
K-Meleon development related discussions. 
Pages: Previous1234
Current Page: 4 of 4
Re: Documentation / extensions
Posted by: JohnHell
Date: May 20, 2015 10:34PM

After this thread
http://kmeleonbrowser.org/forum/read.php?3,133657

I tested a little and looks like navDisableJS and navEnableJS are not available.




This is only a side note for me, but I think I was wrong when I said I didn't know the navToggleJS and pageToggleJS, in fact were the ones that Dorian told in the update as new implementations http://kmeleonbrowser.org/forum/read.php?8,131989

Getting old makes your head do tricks on memory LOL.


Options: ReplyQuote
Re: Documentation / extensions
Posted by: JamesD
Date: July 01, 2015 02:18PM

MacroLanguage2 has some new item for K-Meleon 75.

In March, Dorian added addtoolbar(), addbutton(), removebutton(), setbuttonimg(), setcmdicon(), addperm(), fileexists(), and $VERSION.

In June and with Dorian's permission, I have added logmsg(), settimer(), killtimer(), enablebutton(), checkbutton(), popupmenu() and time().

OnLoadOnce was also added, because I missed it in the original creation of MacroLanguage2.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: siria
Date: July 07, 2015 08:35AM

The markup for highlighting wiki changes is just a nightmare, instead of just highlighting changed words it marks whole chapters as "deleted", shows that part far above the original place under wrong headlines, and far below, even whole 'screen pages' below (but this time under correct headlines) the modified chapter appears again as "newly added". Sigh, very hard to figure out in that chaos what really was changed, even if just one character.

Anyway, just want to mention, the "OnLoadOnce" description sounds to me really misleading, especially listed along with those others that fire only at start and end of a session:
"Init, Setup, LoadOnce and Quit are only fired once a session.(1)"

OnLoadOnce is fired after every page load, not just once a session. The trick is that its values are deleted every time, and new ones get added all the time too, between page loads. Either created each time by normal OnLoad-Macros that contain "onloadonce" commands (e.g. only if a url-condition or whatever is true), or when a user manually fires such a macro.

The injectJS return-function claims: "Only in version 1.6"
The bug in 74 was fixed, so works again in KM75 too.

It also says "The value returned from injectJS() is limited to 4000 characters."
Wasn't it much tinier in 1.6, then increased since 75? Or was the small number in the old wiki wrong?

(Just noticed those two by chance, looking at those places directly not the whole page)



Edited 2 time(s). Last edit at 07/07/2015 08:50AM by siria.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: JamesD
Date: July 07, 2015 08:15PM

siria

It might be my method of updating that causes the history to appear as it does. I do not update in place. I copy the entire code to my PC, make changes, test in the sandbox, and then replace the entire code.

Some old code may not have been changed. My memory is getting to be as old as I. I need to do a maintenance update soon. I will try to have a look at the items which you pointed out.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: JamesD
Date: July 07, 2015 09:24PM

siria

I must not understand your thinking on the OnLoadOnce event. I loaded a session with two tabs in one window and one tab in a second window. I logged only one OnLoadOnce event. That is what I put in the docs.



EventOrder.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2)
#
# ---------- EventOrder.kmm
# ---------- code testing for order of events
# ---------- logmsg every event when it happens
#
# Dependencies        : main.kmm
# Resources           : -  
# Preferences         : -
# Author              : JamesD
# Version             : 2.2 2015_07_07
# -------------------------------------------------- 

_EventOrder_OnCloseTab {
logmsg("OnCloseTab Event Action", warning);
}
_EventOrder_OnOpenTab {
logmsg("OnOpenTab Event Action", warning);
} 
_EventOrder_OnLoad {
logmsg("OnLoad Event Action", warning);
} 
_EventOrder_OnLoadOnce {
logmsg("OnLoadOnce Event Action", warning);
}
_EventOrder_OnStartup {
logmsg("OnStartup Event Action", warning);
}
_EventOrder_OnInit {
logmsg("OnInit Event Action", warning);
}
_EventOrder_OnSetup {
logmsg("OnSetup Event Action", warning);
}
_EventOrder_OnWMAppExit {
logmsg("OnWMAppExit Event Action", warning);
}
_EventOrder_OnCloseWindow {
logmsg("OnCloseWindow Event Action", warning);
}
_EventOrder_OnOpenWindow {
logmsg("OnOpenWindow Event Action", warning);
}
_EventOrder_OnActivateWindow {
logmsg("OnActivateWindow Event Action", warning);
}
_EventOrder_OnQuit {
logmsg("OnQuit Event Action", warning);
}

# - - - - - - - - - - - - - - - - - - - - - - - - - -
$OnCloseTab=$OnCloseTab."_EventOrder_OnCloseTab;";
$OnOpenTab=$OnOpenTab."_EventOrder_OnOpenTab;"; 
$OnLoad=$OnLoad."_EventOrder_OnLoad;"; 
$OnLoadOnce=$OnLoadOnce."_EventOrder_OnLoadOnce;";
$OnStartup=$OnStartup."_EventOrder_OnStartup;";
$OnInit=$OnInit."_EventOrder_OnInit;";
$OnSetup=$OnSetup."_EventOrder_OnSetup;";
$OnWMAppExit=$OnWMAppExit."_EventOrder_OnWMAppExit;";
$OnQuit=$OnQuit."_EventOrder_OnQuit;";
$OnCloseWindow=$OnCloseWindow."_EventOrder_OnCloseWindow;";
$OnOpenWindow=$OnOpenWindow."_EventOrder_OnOpenWindow;";
$OnActivateWindow=$OnActivateWindow."_EventOrder_OnActivateWindow;";

$macroModules=$macroModules."EventOrder;";


Options: ReplyQuote
Re: Documentation / extensions
Posted by: siria
Date: July 07, 2015 09:25PM

Quote
JamesD
It might be my method of updating that causes the history to appear as it does. I do not update in place. I copy the entire code to my PC, make changes, test in the sandbox, and then replace the entire code.

I can assure you it's really the system itself and not your method. Am sure of that because my own last edits were marked just as messed, and I did edit in place. Even in sentences with just a few inserted words, no copy-paste no moving no anything, the "deleted chapters" were jumping way up under the wrong headlines.

But now I find it amazing that your whole-page-paste method does indeed show just the same way as it probably would the normal way! Well, great, in that case I can just as well use it too smiling smiley Never had dared, being afraid the whole page would then be marked. But obviously not.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: siria
Date: July 07, 2015 09:42PM

That logmsg is completely new to me, interesting thing grinning smiley

But you really consider OnLoadOnce to be far more complicated than it actually is:

Quote
siria
OnLoadOnce is fired after every page load, not just once a session. The trick is that its values are deleted every time, and new ones get added all the time too, between page loads. Either created each time by normal OnLoad-Macros that contain "onloadonce" commands (e.g. only if a url-condition or whatever is true), or when a user manually fires such a macro.

Look at your macro: When is it 'loading a value' into OnLoadOnce?
Exactly once, when the bottom lines of the macro are parsed, and this only happens when KM is started!
As I said (or meant), as soon as OnLoadOnce is executed, its values are automatically deleted. After the very first page load -poof- it's empty again:
$OnLoadOnce="" ! You do not add any new values anymore later, so it has nothing to do now, no message anymore, because the message-action was deleted!
If it gets a value again, it will execute it once at the following page load, but if that value is not your message-action, it will not show up in the console.
That's the whole point of "ONCE" - execute 1x and then forget, otherwise it would be the same as OnLoad command, that wouldn't make sense.

Do you know my helper macro "OnEventCheck"? It's useful to check the content of all those event strings.



Edited 1 time(s). Last edit at 07/07/2015 09:46PM by siria.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: siria
Date: July 07, 2015 10:09PM

Okay, try this (just hope there's no typo, haven't tested ;-)

$_testnr=1;

_EventOrder_OnLoad {
logmsg("OnLoad Event Action", warning);
$_testnr=$_testnr+1;
$_testnr==4 ? $OnLoadOnce=$OnLoadOnce."_EventOrder_nrZero";
alert($OnLoadOnce."\n\ntestnr: ".$_testnr,"$OnLoadOnce:");
}

_EventOrder_nrZero {
$_testnr=0;
alert($OnLoadOnce."\n\ntestnr: ".$_testnr,"$OnLoadOnce:");
}

Options: ReplyQuote
Re: Documentation / extensions
Posted by: JamesD
Date: July 08, 2015 01:03PM

siria

You are correct. I guess I was afflicted with tunnel vision on this one because this is not the first time that you have noted the fact that the $OnLoadOnce variable is set to "" after each run.

I will include a correct description on my maintenance update or you can make the change yourself.

Now I have to re-check the code because I am up to six on the alerts.

_EventOrder_OnLoad {
logmsg("OnLoad Event Action", warning);
$_eventorder_testnr=$_eventorder_testnr+1;
$_eventorder_testnr==4 ? $OnLoadOnce=$OnLoadOnce."_EventOrder_nrZero";
alert($OnLoadOnce."\n\ntestnr: ".$_eventorder_testnr,"$OnLoadOnce:");
}

_EventOrder_nrZero {
$_eventorder_testnr=0;
alert($OnLoadOnce."\n\ntestnr: ".$_eventorder_testnr,"$OnLoadOnce:");
}

_EventOrder_OnStartup {
logmsg("OnStartup Event Action", warning);
}
_EventOrder_OnInit {
logmsg("OnInit Event Action", warning);

$_eventorder_testnr=1;
}

And my preview said 'seven'.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: JamesD
Date: July 08, 2015 02:38PM

siria

Please check the sandbox http://kmeleonbrowser.org/wiki/SandBox and let me know if I have it right now.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: rodocop
Date: July 08, 2015 04:37PM

sorry, folks,

but I have one more question about docs.
Is there present any documentation about new skinning system, mainly describing skin.cfg structure and syntax?

I'm going to create some new modern-looking skins so I want to make them compatible with new system.

I understand that all new skins can share default toolbars.cfg if no own present. But I cannot fully clarify to myself - what skin.cfg does?

I guess it defines default sizing for skin and... [what else?] and [how?].

Also does anyone know - was it implemented to make skin remember its current toolband settings by skin.js or not?

Thank you in advance.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: rodocop
Date: July 08, 2015 04:43PM

By the way,
do you know that new K-Meleon could be called from macros like any other application without XPCOM error what happened with KM 1.x?

Do you remember, James, our cmd-sufferings? ;-) They are gone now. You can call one K-Meleon (75, sure) from another (this could be any build able to call apps by macros).

I understand that rare user does really need this, but I should share this discovery grinning smiley

P.S. Now I'm sure there will be new version of KM Twin!



Edited 2 time(s). Last edit at 07/08/2015 04:45PM by rodocop.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: JohnHell
Date: July 08, 2015 06:23PM

Quote
rodocop
sorry, folks,

but I have one more question about docs.
Is there present any documentation about new skinning system, mainly describing skin.cfg structure and syntax?

[...]

I understand that all new skins can share default toolbars.cfg if no own present. But I cannot fully clarify to myself - what skin.cfg does?

I guess it defines default sizing for skin and... [what else?] and [how?].


The size in the skin.cfg is to tell the size of the icons in the defined source image. One is set by default; per image is set if that image has different sizing for the icons.

The role of skin.cfg is to tell what icon is used for a command.

A discussion here:


http://kmeleonbrowser.org/forum/read.php?2,131277

A colored explanation I did for the structure understanding:



Options: ReplyQuote
Re: Documentation / extensions
Posted by: JamesD
Date: July 08, 2015 06:56PM

rodocop

I had planned something about skins, and the files which control/define them. I just have not found the time to do. Unfortunately, I don't see any time for this in the near term.

I had no idea we could now call K-Meleon from K-Meleon.

Skin.cfg is a non-strict file of type 'json'. The following is a defination of json that I found on the net somewhere.


JavaScript Object Notation

http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf


Insignificant whitespace is allowed before or after any token. The whitespace characters are: character
tabulation (U+0009), line feed (U+000A), carriage return (U+000D), and space (U+0020). Whitespace is not
allowed within any token, except that space is allowed in strings.

tokens structural

[ U+005B left square bracket
{ U+007B left curly bracket
] U+005D right square bracket
} U+007D right curly bracket
: U+003A colon
, U+002C comma

tokens literal

true U+0074 U+0072 U+0075 U+0065
false U+0066 U+0061 U+006c U+0073 U+0065
null U+006E U+0075 U+006C U+006C


6 Objects
An object structure is represented as a pair of curly bracket tokens surrounding zero or more name/value pairs.
A name is a string. A single colon token follows each name, separating the name from the value. A single
comma token separates a value from a following name.
{ : } value string
object
,

7 Arrays
An array structure is a pair of square bracket tokens surrounding zero or more values. The values are
separated by commas. The order of the values is significant.

Numbers

Numbers are base 10 without leading zeros. Numbers may be preceded with a + or - symbol

Strings are a series of code points enclosed with " quotation marks


Skin.cfg sets the size and assigns commands to images.

In the code below, the first four lines say the size is 21x21 because that is the size of my throbber. Line 5 says there will be at least one list. Lines 6 and 31 define a single list pair. Line 7 and lines 8 through 30 are list items and while 'images' is small enough to fit on one line, 'commands' requires many lines.

Everything is pairs in the form of name : value. Images has three pairs while commands only has one. That one pair for commands, lists the commands, sometimes multiple, which are associated with each image on the tools0.bmp file. The assignment is from left to right. Lines 13 and 14 are for a single image so they are within brackets. Some images in tools0.bmp have no command assigned, so they require placeholders in the form "",.

I hope this makes sense. I rushed it.


{
  "version":1,
	"width":21,
	"height":21,
	"lists": [
    {
      "images":[ { "name": "tools0.bmp", "width":16, "height":16 } ],
      "commands": [
        "navBack",
        "navForward",
        "navStop",
        "navReload",
        ["macros(Home)", "navHome"],
        ["navSearch","macros(Search)"],
        "filePrint",
        ["bookmarks(Edit)", "favorites(Edit)", "hotlist(Edit)", 
         "bookmarks(Add)", "bookmarks(AddLink)",
         "favorites(AddLink)", "hotlist(AddLink)"],
        "",
        "",
        "",
        "",
        "macros(Places_History)",
        ["macros(Mail_ReadMail)", "&Mail And News"],
        "",        
        "",
        ["macros(Go_Selected)", "navGo"],
        "macros(Go_Up)",
        "appExit"
      ] 
    },


Options: ReplyQuote
Re: Documentation / extensions
Posted by: rodocop
Date: July 08, 2015 07:43PM

Great, folks!
Thank you both!

Options: ReplyQuote
Re: Documentation / extensions
Posted by: JamesD
Date: July 08, 2015 11:39PM

Quote
siria
It also says "The value returned from injectJS() is limited to 4000 characters."
Wasn't it much tinier in 1.6, then increased since 75? Or was the small number in the old wiki wrong?

I think it is 4096 per this from source dated March this year.

	Value injectJS(FunctionData* data)
	{
		checkArgs(__FUNCTION__, data, 1, 2);
		
		int bTopWindow;

		if (strcmp(data->getstr(2), "frame")==0)
			bTopWindow = 0;
		else if (strcmp(data->getstr(2), "alltabs")==0)
			bTopWindow = 2;
		else if (strcmp(data->getstr(2), "hidden")==0)
			bTopWindow = -1;
		else
			bTopWindow = 1;
		
		char result[4096];
		kPlugin.kFuncs->InjectJS2(data->getstr(1), bTopWindow, result, 4096, data->c.hWnd);
		return result;
	}


Options: ReplyQuote
Re: Documentation / extensions
Posted by: siria
Date: July 09, 2015 01:08AM

@James, have edited the sandbox.

Since we do have an old and new page for macrolanguage, lets use it and finally clean up that confusing obsolete KM1.1 stuff in the new version! Layers and macros.cfg aren't used anymore anyway, and the current syntax is already complex and long enough to make it hard for readers, needs no additional confusion. Under the top headline can be links from one version to the other, that should suffice. But if users look up help for macrolanguage they only want to know what is usable NOW, and not during the age of dinosaurs ;-)

That skin stuff is important, but rather complicated too and would IMO deserve a separate thread. Preferably as sticky in the graphics forum, because that's where it has the best chance to be found smiling smiley
And some day in the wiki too of course, am just afraid it would be buried alive there like most other pages, sigh.

Quote
rodocop
I understand that all new skins can share default toolbars.cfg if no own present.
Yeah and IMO that's a major disaster sad smiley
When I play with a new app and try out customizing, I do not expect that there is absolutely NO way to reset the buttons to default again, not even when creating a new profile or installing another skin.
It would be okay if that one and only default file would be read-only, and when a user starts to customize buttons it would get automagically copied into the current skin folder. But it shouldn't be possible to accidentally mess with default template files. Only INtentionally, that's of course different :cool:

Options: ReplyQuote
Re: Documentation / extensions
Posted by: JamesD
Date: July 09, 2015 12:24PM

New maintenance update of MacroLanguage 2 is in the sandbox for review.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: rodocop
Date: July 09, 2015 02:06PM

JohnHell,
you gave the link to the image page like to the image itself. When using PostImage copy the 'Thumbnail for forums'
or you can make it yourself replacing
[ img ]http://postimg.cc/image/k2fq63f4f/[ /img ]
with
[ url=http://postimg.cc/image/k2fq63f4f/ ][ img ]http://link-to-the-thumbnail[ /img ][ /url ]

//spaces added to show the code, not images //

By the way, thank you once again for this picture.



Edited 2 time(s). Last edit at 07/09/2015 04:30PM by rodocop.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: rodocop
Date: July 09, 2015 05:47PM

Well, now I understand new skinning system.

The background:
- Dorian's first thread about new skinning system
(just curious - why he doesn't change skin.cfg format to more human readable like he guessed here)
- 'Converting/creating skins for new KM75 method' by JamesD

Just one question: where the menuicons for Default skin are defined now? And how-to add them to other skins? Am I right that it could be done:
- by menuicons.cfg
- by skin.cfg
- by kmm with setcmdicon
- some other way used by Default???

Options: ReplyQuote
Re: Documentation / extensions
Posted by: JamesD
Date: July 09, 2015 06:07PM

Quote
rodocop
Just one question: where the menuicons for Default skin are defined now? And how-to add them to other skins? Am I right that it could be done:
- by menuicons.cfg
- by skin.cfg
- by kmm with setcmdicon
- some other way used by Default???

In the Default skin, they are in 'icons.png' and are assigned in 'skin.cfg'. A separate 'menuicons.cfg' file does not exist.

    {
      "images": "icons.png",
      "commands": [
        "goHome",
        "saveImageAs",
        "editFind",
        "openManageProfiles",
        "goAboutPlugins",
        "appExit",
        "filePrintSetup",
        "",
        "",
        "fileOpen",
        "goFAQ",
        "macros(kTabs_ReloadAll)",
        "goManual",
        "appAbout",
        [
          "privacy(ClearCache)", 
          "privacy(ClearCookies)",
          "privacy(ClearHistory)",
          "privacy(ClearSignon)",
          "macros(kPrivacy_ClearAll)",          
          "privacy(ClearMRU)",
          "macros(JS_killApplets)"
        ],
        "macros(JS_killFlash)"
      ]		
    },


Options: ReplyQuote
Re: Documentation / extensions
Posted by: JamesD
Date: July 09, 2015 06:38PM

rodocop

One odd quirk that I found would work in skin.cfg file is that I could add a comment without causing a problem. I have only used it in 'images'.

      "images":[ { "name": "tools0.bmp", "width":16, "height":16, "comment":"Main Bar" } ],

'Comment' is not an item for which the code parser is looking, so it and the 'value', "Main Bar", are ignoired so far.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: siria
Date: July 09, 2015 09:20PM

From what little I grasped about new skin system so far, icon pics are not assigned to menu-lines, buttons and toolbars anymore: that means not to positions. They are now linked directly to commands. Wherever that command shows up, it will automatically show its icon.
The downside is that buttons and menuicons inevitably have also the same icon size.
Unless different sizes are now possible in the latest release? Sure hope that will be possible some day.



Edited 1 time(s). Last edit at 07/09/2015 09:21PM by siria.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: JamesD
Date: July 10, 2015 06:06PM

MacroLanguage2 has had the maintenance update applied.

1. Title change
2. Link to old version (MacroLanguage) added
3. OnLoadOnce information fixed (includes event order/cascade)
4. InjectJS() information fixed
5. Minor bug fixes applied

The sandbox is clear.

Options: ReplyQuote
Re: Documentation / extensions
Posted by: JamesD
Date: October 02, 2015 12:42AM

MacroLanguage2 - Added nine new statements for K-Meleon 75.1

Two new sections:
Interface to:  The File System
               The Network

The fileexists() statement is moved from the operating system section to 
the file system section. It is joined by the appendfile(), copyfile(),
deletefile(), mkdir(), renamefile(), and writefile() statements.


The pluginexist() statement is added to the K-Meleon plugins section.

The date() statement is added to the operating system section.

The download() statement is added to the network section. 


Options: ReplyQuote
Re: Documentation / extensions
Posted by: luk3Z
Date: December 24, 2019 09:25AM

K-Meleon Quick Reference (old but helpful):
http://krypton.x10host.com/lizard/commands.html

__________________________________________
How to install Firefox addons in KM 76 RC:
http://kmeleonbrowser.org/forum/read.php?9,141979
Icons for Goanna KM/SM:
http://kmeleonbrowser.org/forum/read.php?10,150634
K-Meleon Quick Reference:
http://kmeleonbrowser.org/docs.php
Basilisk/KM/SM xpi converter:
https://www.addonconverter.fotokraina.com/
Best regards.

Options: ReplyQuote
Pages: Previous1234
Current Page: 4 of 4


K-Meleon forum is powered by Phorum.