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

# ---------- adblockplus(special update-no k-plugin)----------------

$_tool_path=getfolder(RootFolder)."\\Tools";
$adblockplus_enabled="extensions.adblockplus.enabled";
$adblockplus_Firstrun="extensions.adblockplus.firstrun";
$adblockplus_FlashJava="extensions.adblockplus.frameobjects";
$adblockplus_placeholders="extensions.adblockplus.fastcollapse";
$adblockplus_Count="extensions.adblockplus.savestats";
$adblockplus_EditSite="extensions.adblockplus.EditSite";
$adblockplus_BlockItem="extensions.adblockplus.Blockitem";
$adblockplus_BlockitemType="extensions.adblockplus.BlockitemType";


adblockplusFilters{
$OpenURL="chrome://adblockplus/content/ui/filters.xul";
&OpenURL_InNewWindow;

}

adblockplusItems{

setpref(STRING,$adblockplus_EditSite, $URL);
open("about:adblockplus");
}

abDisable{
menuchecked=getpref(BOOL,$adblockplus_enabled);
togglepref(BOOL,$adblockplus_enabled);
 $abstatusbar=sub("%s",getpref(BOOL,$adblockplus_enabled)?"disabled":"enabled","adblock plus %s");
statusbar($abstatusbar);
}

adOptionsFlashJava{
menuchecked=getpref(BOOL,$adblockplus_FlashJava);
togglepref(BOOL,$adblockplus_FlashJava);
}
adOptionsplaceholders{
menuchecked=getpref(BOOL,$adblockplus_placeholders);
togglepref(BOOL,$adblockplus_placeholders);
}

adOptionsCount{
menuchecked=getpref(BOOL,$adblockplus_Count);
togglepref(BOOL,$adblockplus_Count);
}

adblockplus_image{
menugrayed=(hostname($URL)=="");
setpref(STRING,$adblockplus_BlockItem, $ImageURL);
setpref(STRING,$adblockplus_BlockitemType, "image");
$OpenURL="chrome://adblockplus/content/ui/KMcomposer.xul"; 
&OpenURL_InNewWindow;
}

_adblockplus_BuildMenu{
setmenu("&Tools",popup,"Adblock Plus",6);
setmenu("Adblock Plus",macro,"Enable everywhere",abDisable);
setmenu("Adblock Plus",macro,"Filter preferences",adblockplusFilters);
setmenu("Adblock Plus",separator,-1);

setmenu("Adblock Plus",macro,"Live Block items on this page",adblockplusItems);
setmenu("Adblock Plus",separator,-1);
setmenu("Adblock Plus",popup,"Options",6);
setmenu("Options",macro,"Show tabs on Flash and Java",adOptionsFlashJava);
setmenu("Options",separator,-1);
setmenu("Options",macro, "Show placeholders of blocked elements",adOptionsplaceholders);
setmenu("Options",separator,-1);
setmenu("Options",macro,"Count filter hits",adOptionsCount);

setmenu(ImageProperties,macro,"Adblock Image",adblockplus_image);


}

adblockplus_BuildToolbar{
$abptip=_("Toggle Adblockplus|Right-click for Options");
pluginmsg(toolbars,"AddToolbar","Adblock Plus,16,16","");
pluginmsg(toolbars,"AddButton","Adblock Plus,adblockplus,macros(abDisable),Adblock Plus,".$abptip.",16,16,adblockplus.bmp[1],adblockplus.bmp[0]","");
} 

adblockplus_sync{
$__c="CheckButton"; $__m=",macros(pref_Toggle";
$__toolbar="Adblock Plus";
pluginmsg(toolbars,$__c,$__toolbar.$__m."Popups),".(getpref(BOOL,$adblockplus_enabled)?1:0));
}

adblockplus_firstrun{
$abfirstrun=getpref(BOOL,$adblockplus_Firstrun);
	if($abfirstrun){
	setpref(BOOL,$adblockplus_Firstrun, false);
	$OpenURL="chrome://adblockplus/content/ui/firstRun.xul";
	&OpenURL_InNewWindow;

	}
}


$OnInit=$OnInit."_adblockplus_BuildMenu;";
$OnStartup=$OnStartup."adblockplus_firstrun;";
$OnSetup=$OnSetup."adblockplus_BuildToolbar;";
# ---------------------------------------------------------------
$macroModules=$macroModules."adblockplus;";
