General :  K-Meleon Forum
General discussion about K-Meleon. 
Pages: Previous12
Current Page: 2 of 2
Re: Help needed with pluginmsg for toolbars
Posted by: desga2
Date: December 07, 2008 05:58AM

Quote
JamesD
What would be used to make the HOT images? Do we just change the brightness of the background or something like that?

To create or modify icons (skins) I use this tools:
IrfanView
IcoFx
Pixelformer

(Also some people recommended XnView but this is a big size tool)

Quote
JamesD
One other thing is to find a way to update the icon if the user changes default engine during a session. I don't think I want to explain to users how to add an item to the macro that changes default engine to call this macro. An option would be to check the current default engine against a pref with engine used at startup. Would have to do this on all $OnLoad events. Hopefully this "compare" would not take too many resources. Something like "CHECK; IF DIFFERENT THEN FIX : ELSE NOTHING".

All search functions are in search.kmm (LOOK IT) in K-Meleon Macro folder.
You can use it or add your code to search.kmm and create a new search.kmm file to replace to original macro file.

I think that you can detect engine name or part of search engine url.

For example you have a Google icon for "Google Search" and "Google Images":
With index() function you can detect "Google" string in name or url.

$I = index( s, t );

K-Meleon in Spanish



Edited 1 time(s). Last edit at 12/07/2008 05:58AM by desga2.

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: JamesD
Date: December 07, 2008 08:26AM

@ desga2

I got the InfranView program. I made a small panorama view. http://www.perigee.net/~jmd8421r/SearchIconTool.bmp

I just did some screen captures to the icons that I used. Is there some way to do a general change to the background or something in order to make a copy to use as HOT? I guess I would use this one as COLD.

Maybe I will try to do the whole list or maybe just part. I have not decided yet. I did get the ones like Google and Yahoo to use one icon for all their engines. Check against the substr().

I put _SearchIcon_ChangeCheck in the kmm file to pick up on a change to the general search engine.

SearchIcon.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#  
# ---------- SearchIcon.kmm
# ---------- K-Meleon Macro Language  Display Search Engine Icons in Search Button  ---
#
# Dependencies        : - main.kmm Search.kmm 
# Resources           : - 
# Preferences         : - "k-meleon.SearchIcon.currentengine"
#                     : - "kmeleon.general.searchEngineName"
# Version             : - 0.3   2008-12-06
# By                  : - JamesD and desga2
# --------------------------------------------------------------------------------
_SearchIcon_RunCode{
	$_SearchIconSearchName = getpref(STRING,"kmeleon.general.searchEngineName") ;
	setpref(STRING,"k-meleon.SearchIcon.currentengine", $_SearchIconSearchName) ;
	if ( substr($_SearchIconSearchName,0,6) == "Yahoo!") $_SearchIconbmp =  "SearchIconTool.bmp[3]";
	if ($_SearchIconSearchName == "MSN Search") $_SearchIconbmp = "SearchIconTool.bmp[1]" ;
	if ( substr($_SearchIconSearchName,0,5) == "Wikip") $_SearchIconbmp = "SearchIconTool.bmp[2]" ;
	if (substr($_SearchIconSearchName,0,6) == "Google") $_SearchIconbmp =  "SearchIconTool.bmp[0]" ;
	$_SearchIconTag =  "&Search Buttons, macros(Search), COLD,". $_SearchIconbmp  ;
	pluginmsg(toolbars, "SetButtonImage", $_SearchIconTag);
	$_SearchIconTag =  "&Search Buttons, macros(Search), HOT,". $_SearchIconbmp  ;
	pluginmsg(toolbars, "SetButtonImage", $_SearchIconTag);	
	}

_SearchIcon_ChangeCheck{
	if (getpref(STRING,"kmeleon.general.searchEngineName") != getpref(STRING,"k-meleon.SearchIcon.currentengine") &_SearchIcon_RunCode ; 
}
	
$OnLoad=$OnLoad."_SearchIcon_ChangeCheck;";	
$OnStartup=$OnStartup."_SearchIcon_RunCode;";
$macroModules=$macroModules."SearchIcon;";


Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: desga2
Date: December 07, 2008 08:18PM

Quote
JamesD
I just did some screen captures to the icons that I used. Is there some way to do a general change to the background or something in order to make a copy to use as HOT? I guess I would use this one as COLD.

This is a question of your artist sense. To simplifying you can use same icon image to COLD and HOT. Or generate a different file for each state:
SearchIconTool_cold.bmp
SearchIconTool_hot.bmp

To HOT state some skins use same icons with more brightness (this is the most simple option, you can do it with IrfanView), others skins use a similar icon but with a white border or some different color (more complicated because you need edit the icon, you need use the others icon tools i indicated in before post).

For example this is the image that i created for my test: (COLD,HOST,DEAD)


You can begin tried with the first option, in IrfanView go to Image -> Enhance colors ... and play a little with values; brightness, contrast, gamma correction, saturation and color balance (RGB), until the outcome looks good.

K-Meleon in Spanish



Edited 3 time(s). Last edit at 12/07/2008 08:44PM by desga2.

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: desga2
Date: December 07, 2008 08:34PM

I think that you can subs your OnLoad function:
_SearchIcon_ChangeCheck{
	if (getpref(STRING,"kmeleon.general.searchEngineName") != getpref(STRING,"k-meleon.SearchIcon.currentengine") &_SearchIcon_RunCode ; 
}
	
$OnLoad=$OnLoad."_SearchIcon_ChangeCheck;";

To add this line in search.kmm file (K-Meleon\macros\):
Search_Engine{
macroinfo=_("Search the Web using the specified engine");
menuchecked=(getpref(STRING,$_Search_pref_Engine.$ARG.".url")==getpref(STRING,$_Search_pref_DefaultURL));
$_n=$ARG; &_Search;
&_SearchIcon_RunCode;
}

K-Meleon in Spanish

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: JamesD
Date: December 07, 2008 09:04PM

Yes, changing the line in search.kmm file works very well. I think I like it better than checking on every onload event. I doubt that I have much artist sense. I will try some color enhance for the HOT icons. I will let you know how that works out.

Thanks for the excellent advice.

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: JamesD
Date: December 08, 2008 01:45AM

I have uploaded a new SearchIconTool.bmp file. http://www.perigee.net/~jmd8421r/SearchIconTool.bmp
This goes in /skins/default folder.

It is organized with COLD icons indexed as even numbers and HOT icons indexed as odd numbers. It works with this new version of the macro.
Quote
desga2
To add this line in search.kmm file (K-Meleon\macros\):

Search_Engine{
macroinfo=_("Search the Web using the specified engine");
menuchecked=(getpref(STRING,$_Search_pref_Engine.$ARG.".url")==getpref(STRING,$_Search_pref_DefaultURL));
$_n=$ARG; &_Search;
&_SearchIcon_RunCode;
}
Add the line of code as described above.


SearchIcon.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#  
# ---------- SearchIcon.kmm
# ---------- K-Meleon Macro Language  Display Search Engine Icons in Search Button  ---
#
# Dependencies        : - main.kmm Search.kmm 
# Resources           : - 
# Preferences         : - "kmeleon.general.searchEngineName"
# Version             : - 0.4   2008-12-07
# By                  : - JamesD and desga2
# --------------------------------------------------------------------------------
_SearchIcon_RunCode{
	$_SearchIconSearchName = getpref(STRING,"kmeleon.general.searchEngineName") ;
	if ( substr($_SearchIconSearchName,0,6) == "Yahoo!") $_SearchIconIndex =  6;
	if ($_SearchIconSearchName == "MSN Search") $_SearchIconIndex = 2 ;
	if ( substr($_SearchIconSearchName,0,5) == "Wikip") $_SearchIconIndex = 4 ;
	if (substr($_SearchIconSearchName,0,6) == "Google") $_SearchIconIndex =  0 ;
	$_SearchIconTag =  "&Search Buttons, macros(Search), COLD, SearchIconTool.bmp[". $_SearchIconIndex ."]" ;
	pluginmsg(toolbars, "SetButtonImage", $_SearchIconTag);
	$_SearchIconTag =  "&Search Buttons, macros(Search), HOT, SearchIconTool.bmp[". $_SearchIconIndex +1 ."]" ;
	pluginmsg(toolbars, "SetButtonImage", $_SearchIconTag);	
	}

$OnStartup=$OnStartup."_SearchIcon_RunCode;";
$macroModules=$macroModules."SearchIcon;";



Edited 1 time(s). Last edit at 12/08/2008 01:54AM by JamesD.

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: desga2
Date: December 08, 2008 03:51AM

Hey! Good work with HOT icons, I like it. At the end you found your artist sense. smiling smiley

Quote
JamesD
It is organized with COLD icons indexed as even numbers and HOT icons indexed as odd numbers.
grinning smiley

Can you tell me if zero is an even or odd number?
A lot of time studing in the University and nobody can tell me it. tongue sticking out smiley

Remember that image index start with zero and zero isn't even and isn't odd number.
grinning smiley

K-Meleon in Spanish

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: JamesD
Date: December 08, 2008 04:11AM

@ desga2

I don't have to believe in systems where the first thing is numbered zero. I am forced to use them. Discussions on what zero is caused me to take accounting instead of engineering.

Next job is getting more icons for more search engines. Do you know if there is a limit on how long a panorama can be?

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: desga2
Date: December 08, 2008 04:06PM

Quote
JamesD
Next job is getting more icons for more search engines. Do you know if there is a limit on how long a panorama can be?

I don't know if panorama file have some limit, but i don't think it.
I saw panorama icons in bmp files of 1200 pixels of wide.
I think you can found over 20 search engines (the most usual), with 2 icons (cold,hot) for each, you have a panorama file 640 pixels of wide. (This is an usual file size)

K-Meleon in Spanish



Edited 1 time(s). Last edit at 12/08/2008 04:08PM by desga2.

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: JamesD
Date: December 08, 2008 07:37PM

I have edited the PluginCommands page http://kmeleon.sourceforge.net/wiki/PluginCommands and changed the incorrect line for pluginmsg(toolbars, "SetButtonImage"...
I removed the extra quotes.

toolbars

  $bChecked = pluginmsgex(toolbars, "IsButtonChecked", "<ToolbarName>, <ButtonID>", INT);
  $bEnabled = pluginmsgex(toolbars, "IsButtonEnabled", "<ToolbarName>, <ButtonID>", INT);
  pluginmsg(toolbars, "CheckButton", "<ToolbarName>, <ButtonID>, [0|1]");
  pluginmsg(toolbars, "EnableButton", "<ToolbarName>, <ButtonID>, [0|1]");
  pluginmsg(toolbars, "SetButtonImage", <ToolbarName>, <ButtonID>, [HOT|COLD|DEAD], Path/to/new/image.bmp[0]);
  pluginmsg(toolbars, "AddToolbar", "<ToolbarName>, <ButtonWidth>, <ButtonHeight>","");
  pluginmsg(toolbars, "AddButton", "<ToolbarName>, <ButtonName>, <Command>, <MenuName>, <TooltipText>, <ButtonWidth>, <ButtonHeight>, hot.bmp[0], cold.bmp[0], dead.bmp[0]","");

I have not used the other commands so I do not know if they are correct or not.

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: desga2
Date: December 08, 2008 08:14PM

Before documentation is correct, I changed again to retored it. smiling smiley

pluginmsg(toolbars, "SetButtonImage", "<ToolbarName>, <ButtonID>, [HOT|COLD|DEAD], Path/to/new/image.bmp[0]");

I try to explain it again:

pluginmsg(<string1>, <string2>, <string3>);

<string1> = "toolbars" (in this first string quotes can be omited)
<string2> = "SetButtonImage"
<string3> = One string with rest of toolbar button parameters: (note like all strings this big string must be between quotes)
"<ToolbarName>, <ButtonID>, [HOT|COLD|DEAD], Path/to/new/image.bmp[0]"

Each string (string1, 2 and 3) must be between quotes because is a string.
Substrigs (string3 parameters) in string3 NOT must be between quotes.
When you have problems to see it if you must or not type between quotes you can subs the string for a var with string value (because in this case ever must be between quotes).

This is that we are doing in this macro.

I hope you can understand better now. smiling smiley

K-Meleon in Spanish



Edited 3 time(s). Last edit at 12/08/2008 08:18PM by desga2.

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: JamesD
Date: December 08, 2008 09:16PM

@ desga2

I don't understand.

This from code that did not work. I am putting a quote around string 3.
$_SnippetTag =  "\"" . "&Search Buttons,.....
This is from current code which works.
$_SearchIconTag =  "&Search Buttons, macros(Search),...
The "\"". is gone and this code works. Did I not remove a quote?
Removing the "\"" from start and finish of string was all it took to get the code working.

Sorry if I am a little slow to understand this.

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: JamesD
Date: December 08, 2008 10:15PM

I have gotten icons for the following search engines. For some like Yahoo I just match for the first few letters in the name to get all the variations of Yahoo search.

lable	          actual	chars
AllTheWeb	AlltheWeb.com	
AltaVista	AltaVista	
AOL	        AOL	          3
ASK	        Ask.com	
GigaBlast	Gigablast	
Google	        Google	          6
HotBot	        HotBot	
Lycos	        Lycos	
MSN	        MSN Search	
Wikipedia	Wikip	          5
Yahoo 	        Yahoo!	          6

If there is another engine that should be included, please post here.

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: desga2
Date: December 09, 2008 03:57AM

Quote
JamesD
This from code that did not work. I am putting a quote around string 3.

$_SnippetTag = "\"" . "&Search Buttons,.....

You must difference two case for use double quotes:

1) Quotes for a string to used in a function.
2) Quotes for a string to an assignement.

In old documentation:
alert( MESSAGE [, TITLE [, ICON]] );

But this should be update to new 1.5 macro system:
alert( "MESSAGE" [, "TITLE" [, "ICON"]] );

This only indicate that the 3 elemets are strings.
But not indicate that ever must have quotes, only when the real/pure string is used needed it.
But i only need that you look this: alert("MESSAGE");
"MESSAGE" => indicated the concept of string. A text between double quotes.
If you like use "example string":

WRONG => alert(""example string"");
When you code this you are coding:
alert("<empty string>"example string"<empty string>");
And K-Meleon macro interpreter says you: what the hell is example string!

RIGHT => alert("example string");

Some simple examples:

# This is the case indicated above (1), real/pure string:
alert("This is a simple string");

# For K-Meleon this is really a simple string:
alert("This ". "is " . "a " . "fragmented " . "string");
# Conversion: "This is a fragmented string"

2) Using vars assignement with string:

$var0 = "Simple string in var";
alert($var0);
# Var replacement by K-Meleon macro interpreter: alert("Simple string in var");
# You can see that when you use a var not includes quotes because this is implicit in var if this is string type. Remember you already wrote quotes in the string assignement.
You don't like/need this:
WRONG => alert("$var0");

$var1 = "This ";
$var2 = "is ";
$var3 = "a var ";
$var4 = "string";
alert($var1 . $var2 . $var3 . $var4);
# You can see that when you use vars unions not includes quotes because this is implicit in var if this is string type. Remember you already wrote quotes in the string assignement.

When you use the union of strings K-Meleon macro interpreter only read first and end quote of conjunction:
# Look K-Meleon conversion of before sentence:
#alert("This ""is ""a var ""string");

Only blue quotes are interpreted (not showed) as string element indicator, red quotes are deleted/ignored.

Again with your code example:
$_SnippetTag = "[b]"[/b]" . "&Search Buttons,.....

This is a string assignation of two strings union. What K-Meleon really saved in var:

$_SnippetTag = "<quote>&Search Buttons,.....
# <quote> is really a visible character double quote, not a string indicator, because K-Meleon have the first double quote that found for this (in blue).

Your problem is that you really are indicating "&Search Buttons and there aren't any toolbar named "&Search Buttons.

You can tried a macro with some examples using alert() function because this is more easy form to can see really what quotes are or aren't visibles.

K-Meleon in Spanish

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: JujuLand
Date: December 09, 2008 05:12AM

Quote
WRONG => alert(""example string"");

This sample is really wrong tongue sticking out smiley

alert("Title", "Text"); (or perhaps the contrary, don't remember).

A+


Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:24.0) Gecko/20140105 Ubuntu/12.04 K-Meleon/74.0

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




Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: JamesD
Date: December 09, 2008 05:50AM

@ desga2

Thanks for the info. Give me a little time to study and test.

On first reading, I think it is just the new way writing documentation to indicate string that I did not understand. That being so does it mean that all the documentation in MacroLanguage and/or MacroLanguage2,
http://kmeleon.sourceforge.net/wiki/MacroLanguage and http://kmeleon.sourceforge.net/wiki/MacroLanguage2 must be re-written?

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: JamesD
Date: December 10, 2008 04:22AM

Quote
desga2
In old documentation:
alert( MESSAGE [, TITLE [, ICON]] );

But this should be update to new 1.5 macro system:
alert( "MESSAGE" [, "TITLE" [, "ICON"]] );

I did not know that the documentation for plugins followed a different style from the documentation for the MacroLanguage. Everything I wrote for the third part of the statement became a literal. No wonder it did not work.

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: desga2
Date: December 10, 2008 04:33AM

It isn't a different style really, with 1.5 we changed way to use strings and since 1.5 strings requires quotes. (This and case sensitive are main problems to update macros from 1.1 to 1.5)
MacroLanguage documetation is very old Macro syntax (for compatibility reason with old versions before 1.1) and plugins documentation is most recent (since 1.1 and 1.5 versions).

K-Meleon in Spanish

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: JamesD
Date: December 17, 2008 09:40PM

SearchIcon.kmm has been added to the MacroLibrary http://kmeleon.sourceforge.net/wiki/KmmSearchIcon

Options: ReplyQuote
Re: Help needed with pluginmsg for toolbars
Posted by: jsnj
Date: March 08, 2009 09:58AM

Hey Guys,

Love your macro. I just stumbled upon it recently. When I concocted the search button macro for 0.9, this was one thing that wasn't available. I think the changing icon makes a big difference and is a great asset. Haven't really been in the "macro business" for a few years now smiling smiley, and there's more to learn with the new stuff, but I made a variation of searchicon that I think opens it up a bit more. This version doesn't rely on one big panorama. Instead, each search engine has its own 32,16 bitmap consisting of a cold & hot image. The search engine name and it's corresponding bitmap name are also the same. And if the search engine is not in the list, the icon defaults to the search icon of the theme. This would mean that all skins/themes would have to standardize to a 32,16 search.bmp. What I like about the separate bitmaps is that it allows themers to include matching search icons in their themes. They could include all or just some like the most popular ones Google & Yahoo.

I also included the possibilty for separate search engine modules to hook into searchicon.kmm. Even though it's cool that we can add our own engines through cut & pasting into the preferences xul window, ideally end users would like and have come to expect a quick click & install way to add engines. Macro modules combined with a variation of alain's km ext setup would allow that.

Anyway, below is the macro along with a CNET search engine macro module. I based the CNET search engine macro on the code written into search.kmm to accomodate search9. search9 doesn't have to be engaged though. The CNET url address doesn't post here within the macro properly, so replace it with this minus the parenthesis:

(http://www.cnet.com/1770-5_1-0.html?query=)

There might be an easier template for both of these macros. Let me know. Comments, ideas, suggestions, criticisms?



# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- SearchIcon.kmm
# ---------- K-Meleon Macro Language Display Search Engine Icons in Search Button ---
#
# Dependencies : - main.kmm Search.kmm KM ver 1.5.0 or later
# Resources : -
# Preferences : - "kmeleon.general.searchEngineName"
# Version : -
# By : - JamesD and desga2 and jsnj
# --------------------------------------------------------------------------------

_SearchIcon_RunCode{

#-- Get the currently chosen search engine's name
#-- and assign that name to the variable "$_SearchIconName"

$_SearchIconName = getpref(STRING,"kmeleon.general.searchEngineName") ;

#-- For search engines with multiple versions such as Google (Scroogle, Boogle, etc...)
#-- search within the name for a common sequence of letters such as "oogle"
#-- and assign them the same search icon name so that they can share the same image

$_n=index($_SearchIconName,"AOL"); $_n == -1 ? 0:$_SearchIconName = "AOL";
$_n=index($_SearchIconName,"oogle"); $_n == -1 ? 0:$_SearchIconName = "Google";
$_n=index($_SearchIconName,"Internet Movie D"); $_n == -1 ? 0:$_SearchIconName = "IMDB";
$_n=index($_SearchIconName,"LEO"); $_n == -1 ? 0:$_SearchIconName = "LEO";
$_n=index($_SearchIconName,"Viv"); $_n == -1 ? 0:$_SearchIconName = "Viv";
$_n=index($_SearchIconName,"Internet Archive"); $_n == -1 ? 0:$_SearchIconName = "Wayback";
$_n=index($_SearchIconName,"Webshots"); $_n == -1 ? 0:$_SearchIconName = "Webshots";
$_n=index($_SearchIconName,"Wikip"); $_n == -1 ? 0:$_SearchIconName = "Wikipedia";
$_n=index($_SearchIconName,"Yahoo"); $_n == -1 ? 0:$_SearchIconName = "Yahoo!";

#-- Assume the chosen search engine is not in the list below
#-- by setting the variable "$_SearchNameNew" to 1

$_SearchNameNew = 1;

#-- Recognize the search engines in the following list
#-- by setting the variable $_SearchNameNew to "0"

if ($_SearchIconName == _("A9.com")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Acronym Finder")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("AlltheWeb.com")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("AltaVista")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Amazon.com")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Answers.com")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("AOL")) $_SearchNameNew = 0;
if ($_SearchIconName == _("Ask.com")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Astalavista.box.sk")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Del.icio.us")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Dictionary.com")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Dogpile")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("eBay.com")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Find Travel To")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("GameFAQs Search")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Gigablast")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Google")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("HotBot")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("HowStuffWorks")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("IMDB")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Ixquick Metasearch")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Jux2")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("K-Meleon Forums Search")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("LEO")) $_SearchNameNew = 0;
if ($_SearchIconName == _("Lycos")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Mamma Metasearch")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("MetaCrawler")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("MobyGames")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("MSN Search")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Merriam-Webster Online Dictionary")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("OneLook Dictionary Search")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Open Directory (dmoz.org)")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Search.com")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("SnapFiles")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Viv")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Wayback")) $_SearchNameNew = 0;
if ($_SearchIconName == _("Webshots")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Weather.com")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Wikipedia")) $_SearchNameNew = 0 ;
if ($_SearchIconName == _("Yahoo!")) $_SearchNameNew = 0 ;


#### --------- Add other defined search engines above ------------------------

#-- For search macro modules to hook into this macro.

if ($_SearchIconName == $_SearchName) $_SearchNameNew = 0;


#-- If the search engine name is found in the list above, then do nothing
#-- otherwise set the search icon name to "search".
#-- Then start the macro named "_SearchIconButtons"

$_SearchNameNew == 0 ? 0: $_SearchIconName="search" ; &_SearchIconButtons;
}

_SearchIconButtons{
$_SearchIconTag = "&Search Buttons, macros(Search), COLD,". $_SearchIconName.".bmp[0]" ;
pluginmsg(toolbars, "SetButtonImage", $_SearchIconTag);
$_SearchIconTag = "&Search Buttons, macros(Search), HOT,". $_SearchIconName.".bmp[1]" ;
pluginmsg(toolbars, "SetButtonImage", $_SearchIconTag);
}


$OnStartup=$OnStartup."_SearchIcon_RunCode;";
$macroModules=$macroModules."SearchIcon;";

_________________________________________________


# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- search_CNET.kmm
#
# Dependencies : - main.kmm, Search.kmm, SearchIcon.kmm, KM ver 1.5.x
# By : - jsnj
# --------------------------------------------------------------------------------

_CNET{
$_SearchName = "CNET"; $_Search_EngineName = "CNET";
$_Search_EngineURL = "http://www.cnet.com/1770-5_1-0.html?query=";;
&_Search_Init; index($macroModules,";SearchIcon;")>-1?&_SearchIcon_RunCode:0;
}

_CNETSync{
setcheck("macros(_CNET)", getpref(STRING, $sen) == "CNET" ? true:false);
}

_CNETMenu{
setmenu(_Search_Engines,macro,"CNET","_CNET",1);
}
_CNET_OnInit{
index($macroModules,";Search;")>-1?&_CNETMenu:0;
}
$OnInit=$OnInit."_CNET_OnInit;";

_CNET_Init{
$sen=$_Search_pref_DefaultName; &_CNETSync;
$_SearchIconName = getpref(STRING,"kmeleon.general.searchEngineName") ;
if ($_SearchIconName == _("CNET")) $_SearchName = "CNET";
# hook into search.kmm's menu sync
$_Search_SyncMenu=$_Search_SyncMenu."_CNETSync;";
}
_CNET_OnSetup{
index($macroModules,";Search;")>-1?&_CNET_Init:0;
}
$OnSetup=$OnSetup."_CNET_OnSetup;";

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

Attachments: cnet.bmp (1.6 KB)  
Options: ReplyQuote
Pages: Previous12
Current Page: 2 of 2


K-Meleon forum is powered by Phorum.