K-Meleon
KMeleonWiki > Resources > MacroLibrary > KmmCloneLayers
Submitted by: desga2
Note: this macro requires the deprecated layers Kplugin for pseudo-tabs; layers are deprecated. The latest official versions of K-Meleon and all active development natively support true tabs.
Notes:
This macro do clones from your current layer. Two new options are added in your Layers and Document context menus:
Clone Layer => This option open a new clone layer in background.
Reproduce Layer... => This option prompt you how many clones of your current layer you like and open it in background.
Open your User Macro Folder (Edit > Configuration > User-Defined Macros) or your Macro Folder (Edit > Configuration > Macros) and create the following text file(s):
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
# ---------- Clone Layers -----------------------------------------------------
#
# Dependencies : $kLayers
# Resources : -
# Preferences : -
#
# -----------------------------------------------------------------------------
$_clones = 0;
CloneLayer{
# Not work open layer in background with this: openbg($URL); = opennew($URL);
#pluginmsg(layers, "OpenURL", $URL);
pluginmsg(layers, "OpenURLBg", $URL);
$_clones = $_clones - 1;
}
# ----- PRIVATE
_Clone_X_Layers{
$_clones = prompt("Insert the number of clones for this layer:", "Reproduce this layer");
while($_clones > 0) &CloneLayer;
}
_CloneLayers_BuildMenu{
# LayerButtonPopup
$kLayers==true?setmenu("LayerButtonPopup",separator,1):0;
$kLayers==true?setmenu("LayerButtonPopup",macro,"Clone Layer","CloneLayer",2):0;
$kLayers==true?setmenu("LayerButtonPopup",macro,"Reproduce Layer...","_Clone_X_Layers",3):0;
# DocumentPopup
$kLayers==true?setmenu("DocumentPopup",separator,1):0;
$kLayers==true?setmenu("DocumentPopup",macro,"Clone Layer","CloneLayer",2):0;
$kLayers==true?setmenu("DocumentPopup",macro,"Reproduce Layer...","_Clone_X_Layers",3):0;
}
$OnInit=$OnInit."_CloneLayers_BuildMenu;";
# -----------------------------------------------------------------------------
$macroModules=$macroModules."CloneLayers;";