home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 March / PCWorld_2005-03_cd.bin / komunikace / kmeleon / kmeleon09.exe / macros.cfg < prev    next >
Text File  |  2005-01-17  |  50KB  |  1,428 lines

  1. # MACROS DEFINITION FILE (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
  2.  
  3.  
  4. # ----ENGINES---- 
  5.  
  6. Google{
  7. &OldSearch; $search = "Google";
  8. $eng = "http://www.google.com/search?q="; 
  9. &SetSearch;
  10. }
  11.  
  12. Yahoo{
  13. &OldSearch; $search = "Yahoo";
  14. $eng = "http://search.yahoo.com/bin/search?p=";
  15. &SetSearch;
  16. }
  17.  
  18. Wikipedia{
  19. &OldSearch; $search = "Wikipedia"; 
  20. $eng = "http://en.wikipedia.org/wiki/";
  21. &SetSearch;
  22. }
  23.  
  24. Dictionaries{
  25. &OldSearch; $search = "Dictionaries (One Look)";
  26. $eng = "http://www.onelook.com/?w=";
  27. &SetSearch;
  28. }
  29.  
  30. KM{
  31. &OldSearch; $search = "K-Meleon Forums"; 
  32. $eng = "http://kmeleon.sourceforge.net/forum/search.php?f=3&globalsearch=1&match=1&date=0&fldsubject=1&fldbody=1&search="; 
  33. &SetSearch;
  34. }
  35.  
  36. URL{
  37. &OldSearch; $search = "URL"; $eng = ""; &Locked;
  38. }
  39.  
  40.  
  41. EngineSync{
  42. setcheck("macros(Google)", getpref(STRING, $sen) == "Google" ? true:false);
  43. setcheck("macros(Yahoo)", getpref(STRING, $sen) == "Yahoo" ? true:false);
  44. setcheck("macros(Wikipedia)", getpref(STRING, $sen) == "Wikipedia" ? true:false);
  45. setcheck("macros(Dictionaries)", getpref(STRING, $sen) == "Dictionaries (One Look)" ? true:false);
  46. }
  47.  
  48.  
  49. # ----SEARCH MACROS----
  50.  
  51. $se="kmeleon.general.searchEngine";
  52. $sl="kmeleon.general.searchLocked";
  53. $sen="kmeleon.general.searchEngineName";
  54. $so="kmeleon.general.searchOpen";
  55. $eng=getpref(STRING, $se) ;
  56. $search=getpref(STRING, $sen);
  57. $layers="kmeleon.plugins.layers.load";
  58. $layer=getpref(BOOL, $layers);
  59.  
  60. OldSearch{
  61. $oldeng=$eng; $oldsearch=$search; 
  62. }
  63.  
  64. SetSearch{
  65. getpref(BOOL,$sl)==false ? &Unlocked:&Locked; &Sync;
  66. }
  67. Unlocked{
  68. setpref(STRING,$sen,$search); setpref(STRING,$se,$eng); &Search;
  69. }
  70. Locked{
  71. &Search; $search=$oldsearch; $eng=$oldeng;
  72. }
  73. Search{
  74. $tmp=getclipboard(); setclipboard(); id(ID_EDIT_COPY); $word=getclipboard();
  75. $word=="" ? &URLBarSearch:$word==$URL ? &PromptSearch:&OpenSearch; setclipboard($tmp);
  76. }
  77. URLBarSearch{
  78. id(ID_SELECT_URL); id(ID_EDIT_COPY); $word=getclipboard();
  79. $word=="" ? $word=$URL:""; $word==$URL ? &PromptSearch:&OpenSearch;
  80. }
  81. PromptSearch{
  82. $search=="" ? $search="Google":0; 
  83. $search=="URL" ? $tip="Enter URL:":$tip="Search ".$search." for:";
  84. setclipboard($tmp); $word=prompt($tip,$search); $word==""?"": &OpenSearch;
  85. }
  86. OpenSearch{
  87. $how=getpref(INT, $so); $search!="Google"?"":&Umlauts;
  88. $how==0 ? open($eng.$word):$how==1 ? &SearchNew:$how==2 ? &SearchBack:0; 
  89. }
  90. Umlauts{
  91. $word=gsub("Σ","%C3%A4",$word); $word=gsub("÷","%C3%B6",$word);
  92. $word=gsub("ⁿ","%C3%BC",$word); $word=gsub("▀","%C3%9F",$word);
  93. $word=gsub("─","%C3%84",$word); $word=gsub("╓","%C3%96",$word);
  94. $word=gsub("▄","%C3%9C",$word);
  95. }
  96. SearchNew{
  97. &ResetURL; $layer==true ? pluginmsg(layers,"OpenURL",$eng.$word):opennew($eng.$word);
  98. }
  99. ResetURL{
  100. setclipboard($URL); id(ID_SELECT_URL); id(ID_EDIT_PASTE); id(ID_SELECT_URL);
  101. }
  102. SearchBack{
  103. &ResetURL; $layer==true ? pluginmsg(layers,"OpenURLBg",$eng.$word):OpenBg($eng.$word);
  104. }
  105.  
  106. SN0{
  107. setpref(INT,$so,0); &Sync;
  108. }
  109. SN1{
  110. setpref(INT,$so,1); &Sync; 
  111. }
  112. SN2{
  113. setpref(INT,$so,2); &Sync;
  114. }
  115.  
  116. SearchLock{
  117. $search==""? $search="Google":0; togglepref(BOOL,$sl); 
  118. getpref(BOOL,$sl)==true ? $how="LOCKED on: ".$search:$how="UNLOCKED";
  119. alert("The default Search Engine is now ".$how."\n\n\nTo set default engine:\n\n1. Unlock\n2. Click desired engine from menu\n3. Lock","Search Button",INFO);
  120. &Sync;
  121. }
  122.  
  123. AddEng{
  124. $theurl="http://kmeleon.sourceforge.net/wiki/index.php?id=Search+Engines";
  125. $layer=="true"? pluginmsg(layers,"OpenURL",$theurl):opennew($theurl);
  126. $loaded="MacMen";
  127. }
  128. MacMen{
  129. &Macros; &Menus; $loaded="";
  130. }
  131.  
  132. JSEnable {
  133. getpref(BOOL,$jscript)==false ? &JS:macros($macro);
  134. }
  135. JS{
  136. &JSToggle; macros($macro); &JSToggle;
  137. }
  138.  
  139. Highlight{
  140. $macro="Find"; &JSEnable; 
  141. }
  142. Find{
  143. open("javascript:(function(){var count=0, text, dv;text=prompt(%22Find and Highlight the following:%22, %22%22);if(text==null || text.length==0)return;dv=document.defaultView;function searchWithinNode(node, te, len){var pos, skip, spannode, middlebit, endbit, middleclone;skip=0;if( node.nodeType==3 ){pos=node.data.toUpperCase().indexOf(te);if(pos>=0){spannode=document.createElement(%22SPAN%22);spannode.style.backgroundColor=%22yellow%22;middlebit=node.splitText(pos);endbit=middlebit.splitText(len);middleclone=middlebit.cloneNode(true);spannode.appendChild(middleclone);middlebit.parentNode.replaceChild(spannode,middlebit);++count;skip=1;}}else if( node.nodeType==1&& node.childNodes&& dv.getComputedStyle(node, null).getPropertyValue(%22display%22)!=%22none%22){for (var child=0; child < node.childNodes.length; ++child){child=child+searchWithinNode(node.childNodes[child], te, len);}}return skip;}window.status=%22Searching for '%22+text+%22'...%22;searchWithinNode(document.body, text.toUpperCase(), text.length);window.status=%22Found %22+count+%22 occurrence%22+(count==1?%22%22:%22s%22)+%22 of '%22+text+%22'.%22;})();");
  144. }
  145.  
  146. Keyword{
  147. togglepref(BOOL,"keyword.enabled"); &Sync;
  148. }
  149.  
  150. CheckKey{
  151. $eng=getpref(STRING,"keyword.URL");
  152. }
  153. KeyEngBBN{
  154. $eng="http://www.google.com/search?gfns=1&q=";
  155. $string="BBN"; &KeyEng;
  156. }
  157. KeyEngIFL{
  158. $eng="http://www.google.com/search?btnI=1&q=";
  159. $string="IFL"; &KeyEng; 
  160. }
  161. KeyEngGoog{
  162. $eng="http://www.google.com/search?q=";
  163. $string="GOOG"; &KeyEng; 
  164. }
  165. KeyConfig{
  166. &CheckKey; $eng=prompt("Enter Keyword Autosearch Engine:","Keyword Autosearch",$eng)
  167. $eng==""?"":$string=""; $eng==""?"": &KeyEng;
  168. }
  169. KeyEng{
  170. setpref(STRING,"keyword.URL",$eng); setpref(STRING,"keyword.eng",$string); &Sync;
  171. alert("Keyword Autosearch Engine =  '".$eng."'\n\n\nKeyword engine will be updated when K-Meleon is restarted.","Keyword Autosearch Engine",INFO);
  172. }
  173.  
  174. $taf="accessibility.typeaheadfind";
  175.  
  176. TAF{
  177. togglepref(BOOL,$taf); &Sync;
  178. }
  179. TAFAuto{
  180. togglepref(BOOL,$taf.".autostart"); 
  181. $var=getpref(BOOL,$taf.".autostart")==true ? $bool=" - ENABLED. When a page loads, just typing will automatically start Find As You Type.":$bool = " - DISABLED ";
  182. $tip="Find As You Type Auto Start"; &Sync; &AlertTAF; 
  183. }
  184. TAFLinks{
  185. togglepref(BOOL,$taf.".linksonly"); 
  186. $var=getpref(BOOL,$taf.".linksonly")==true ? $bool=" - ENABLED. Only links will be searched for as you start typing. You can override this by pressing  /  for all text, or  '  for links only.":$bool=" - DISABLED ";
  187. $tip="Find As You Type Links Only"; &Sync; &AlertTAF; 
  188. }
  189. AlertTAF{
  190. alert($tip.$bool,$tip,INFO);
  191. }
  192.  
  193.  
  194. # ----IMAGE & ZOOM MACROS----
  195.  
  196. ImageInfo{
  197. $macro="ImgInfo"; &JSEnable;
  198. }
  199. ImgInfo {
  200. $FrameURL=""; $PageURL=$FrameURL;
  201. open("javascript: function chkframes(elem) { var rep; if (unescape(elem.location) == '".$PageURL."' || '".$PageURL."'=='') { rep=chkimg(elem); if (rep) return rep; } for (var f=0; f<elem.frames.length; f++) { rep=chkframes(elem.frames[f]); if (rep) return rep; } return; } function chkimg(elem){ if(elem.document.images.length>0){ var i; for(i=0;i<elem.document.images.length;i++){ if(unescape(elem.document.images[ i ].src) == '".$ImageURL."'){ return elem.document.images[i]; } } } } function XyZ() { var img=chkframes(window); if (img) { alert(\"* I M A G E   P R O P E R T I E S *\\r\\n\\r\\nURL:\\t\" + unescape(img.src) + \"\\r\\nWidth:\\t\" + img.width + \"\\r\\nHeight:\\t\" + img.height + \"\\r\\nALT:\\t\" + img.alt  + \"\\r\\nTitle:\\t\" + img.title); } } void(XyZ()); ");
  202. }
  203.  
  204. ImageCache{
  205. $i=index($ImageURL,"#");
  206. $addr=$i==-1 ? $ImageURL:substr($ImageURL,0,$i);
  207. $client=index($addr,"https://")==0 ? "HTTP-memory-only":"HTTP";
  208. $var="about:cache-entry?client=".$client."&sb=1&key=".$addr;
  209. index($addr,"http")==0 ? opennew($var):"";
  210. }
  211.  
  212. ZoomInImage{
  213. $macro="ZoomInImg"; &JSEnable;
  214. }
  215. ZoomInImg{
  216. $FrameURL=""; $PageURL=$FrameURL;
  217. open("javascript:function chkframes(elem) { var rep; if (unescape(elem.location) == '".$PageURL."' || '".$PageURL."'=='') { rep=chkimg(elem); if (rep) return rep; } for (var f=0; f<elem.frames.length; f++) { rep=chkframes(elem.frames[f]); if (rep) return rep; } return; } function chkimg(elem){ if(elem.document.images.length>0){ var i; for(i=0;i<elem.document.images.length;i++){ if(unescape(elem.document.images[ i ].src) == '".$ImageURL."'){ return elem.document.images[i]; } } } } function zoomImage(image, amt) { if(image.initialHeight == null) { /* avoid losing height information due to integer rounding while zooming out */ image.initialHeight = image.height; image.initialWidth = image.width; image.scalingFactor = 1; } image.scalingFactor *= amt; image.width = image.scalingFactor * image.initialWidth; image.height = image.scalingFactor * image.initialHeight; } function findIMG() { var img=chkframes(window); zoomImage(img,2); } void(findIMG());");
  218. }
  219.  
  220. ZoomOutImage{
  221. $macro="ZoomOutImg"; &JSEnable;
  222. }
  223. ZoomOutImg {
  224. $FrameURL=""; $PageURL=$FrameURL;
  225. open("javascript:function chkframes(elem) { var rep; if (unescape(elem.location) == '".$PageURL."' || '".$PageURL."'=='') { rep=chkimg(elem); if (rep) return rep; } for (var f=0; f<elem.frames.length; f++) { rep=chkframes(elem.frames[f]); if (rep) return rep; } return; } function chkimg(elem){ if(elem.document.images.length>0){ var i; for(i=0;i<elem.document.images.length;i++){ if(unescape(elem.document.images[ i ].src) == '".$ImageURL."'){ return elem.document.images[i]; } } } } function zoomImage(image, amt) { if(image.initialHeight == null) { /* avoid losing height information due to integer rounding while zooming out */ image.initialHeight = image.height; image.initialWidth = image.width; image.scalingFactor = 1; } image.scalingFactor *= amt; image.width = image.scalingFactor * image.initialWidth; image.height = image.scalingFactor * image.initialHeight; } function findIMG() { var img=chkframes(window); zoomImage(img,.5); } void(findIMG());");
  226. }
  227.  
  228. ZoomInImages{
  229. $macro="ZoomInImgs"; &JSEnable;
  230. }
  231. ZoomInImgs{
  232. open("javascript:(function(){ function zoomImage(image, amt) { if(image.initialHeight == null) { /* avoid losing height information due to integer rounding while zooming out */ image.initialHeight = image.height; image.initialWidth = image.width; image.scalingFactor = 1; } image.scalingFactor *= amt; image.width = image.scalingFactor * image.initialWidth; image.height = image.scalingFactor * image.initialHeight; } for (i=0; i<document.images.length; ++i) zoomImage(document.images[i], 1.1); })();");
  233. }
  234.  
  235. ZoomOutImages{
  236. $macro="ZoomOutImgs"; &JSEnable;
  237. }
  238. ZoomOutImgs{
  239. open("javascript:(function(){ function zoomImage(image, amt) { if(image.initialHeight == null) { /* avoid losing height information due to integer rounding while zooming out */ image.initialHeight = image.height; image.initialWidth = image.width; image.scalingFactor = 1; } image.scalingFactor *= amt; image.width = image.scalingFactor * image.initialWidth; image.height = image.scalingFactor * image.initialHeight; } for (i=0; i<document.images.length; ++i) zoomImage(document.images[i], .9092); })();");
  240. }
  241.  
  242. ZoomImageLinks{
  243. $macro="ZoomImgLinks"; &JSEnable;
  244. }
  245. ZoomImgLinks{
  246. open("javascript:{var hrefs=document.getElementsByTagName('A'),images='';for(idx=0;idx<hrefs.length;idx++){href=hrefs[idx].href.toUpperCase(); if(href.indexOf('.GIF')>-1||href.indexOf('.BMP')>-1||href.indexOf('.JPEG')>-1||href.indexOf('.JPG')>-1||href.indexOf('.PNG')>-1)images+='<img src='+hrefs[idx]+'><br><br>';}images='<html><body><center><h2>Images</h2><br><br>'+images+'</center></body></html>';document.write(images);document.close();}");
  247. }
  248.  
  249. ZoomInPage{
  250. $macro="ZoomInPg"; &JSEnable;
  251. }
  252. ZoomInPg{
  253. open("javascript:function zoomImage(image, amt) { if(image.initialHeight == null) {image.initialHeight = image.height; image.initialWidth = image.width; image.scalingFactor = 1; } image.scalingFactor *= amt; image.width = image.scalingFactor * image.initialWidth; image.height = image.scalingFactor * image.initialHeight; }function rZoomFont(n, node) {for ( var i = 0; i < node.childNodes.length; i++ ) {if (node.childNodes[i].nodeType == 1) rZoomFont(n, node.childNodes[i]);}startSize = getComputedStyle(node,'').getPropertyValue('font-size');startSize = Number(startSize.substr(0,startSize.length-2));lh = getComputedStyle(node,'').getPropertyValue('line-height');if (lh != 'normal') {lh = Number(lh.substr(0,lh.length-2)) * n + 'px';node.style.lineHeight = lh;}newSize = (startSize * n) + 'px';node.style.fontSize = newSize;}rZoomFont(1.1,document.getElementsByTagName('body')[0]); for (i=0; i<document.images.length; ++i) zoomImage(document.images[i], 1.1);");
  254. }
  255.  
  256. ZoomOutPage{
  257. $macro="ZoomOutPg"; &JSEnable;
  258. }
  259. ZoomOutPg{
  260. open("javascript:function zoomImage(image, amt) { if(image.initialHeight == null) {image.initialHeight = image.height; image.initialWidth = image.width; image.scalingFactor = 1; } image.scalingFactor *= amt; image.width = image.scalingFactor * image.initialWidth; image.height = image.scalingFactor * image.initialHeight; }function rZoomFont(n, node) {for ( var i = 0; i < node.childNodes.length; i++ ) {if (node.childNodes[i].nodeType == 1) rZoomFont(n, node.childNodes[i]);}startSize = getComputedStyle(node,'').getPropertyValue('font-size');startSize = Number(startSize.substr(0,startSize.length-2));lh = getComputedStyle(node,'').getPropertyValue('line-height');if (lh != 'normal') {lh = Number(lh.substr(0,lh.length-2)) * n + 'px';node.style.lineHeight = lh;}newSize = (startSize * n) + 'px';node.style.fontSize = newSize;}rZoomFont(0.9092,document.getElementsByTagName('body')[0]); for (i=0; i<document.images.length; ++i) zoomImage(document.images[i], .9092);");
  261. }
  262.  
  263. $zoom="kmeleon.general.zoomButtons";
  264.  
  265. ZoomSet{
  266. setpref(STRING,$zoom,$var); &Sync;
  267. alert("Zoom In/Out toolbar buttons will effect ".$what,Zoom Toolbar Buttons,INFO);
  268. }
  269. ZoomText{
  270. $var="text"; $what="text only."; &ZoomSet;
  271. }
  272. ZoomImages{
  273. $var="images"; $what="images only."; &ZoomSet;
  274. }
  275. ZoomPage{
  276. $var=""; $what="both images and text."; &ZoomSet;
  277. }
  278.  
  279. ZoomIn{
  280. $zi=getpref(STRING,$zoom); $zi==""? &ZoomInPage:&ZoomInCheck;
  281. }
  282. ZoomInCheck{
  283. $zi=="text"? id(ID_FONT_INCREASE):&ZoomInImages;
  284. }
  285.  
  286. ZoomOut{
  287. $zo=getpref(STRING,$zoom); $zo==""? &ZoomOutPage:&ZoomOutCheck;
  288. }
  289. ZoomOutCheck{
  290. $zo=="text"? id(ID_FONT_DECREASE):&ZoomOutImages;
  291. }
  292.  
  293.  
  294. # ----BOOKMARK MACROS---- 
  295.  
  296. FileBook{
  297. plugin(bookmarks,Add); plugin(bookmarks,Edit);
  298. }
  299. FileHot{
  300. plugin(hotlist,Add); plugin(hotlist,Edit);
  301. }
  302. FileFav{
  303. plugin(favorites,Add); plugin(favorites,Edit);
  304. }
  305.  
  306. FavToolbar{
  307. $tf="kmeleon.plugins.favorites.toolbarFolder";
  308. $folder=getpref(STRING,$tf); $folder==""? $folder="Links":""; 
  309. $folder=prompt("Enter the name of the folder to be displayed on your favorites toolbar.","Favorites Toolbar Folder",$folder);
  310. $folder==""?"":setpref(STRING,$tf,$folder);
  311. $folder==""?"":alert("Favorites Toolbar Folder will be  ' " .$folder." '  when K-Meleon is restarted","Favorites Toolbar Folder",INFO);
  312. }
  313. ChangeLinks{
  314. $tit="kmeleon.plugins.favorites.title";
  315. $favtit=getpref(STRING, $tit); $favtit==""? $favtit="Links":""; 
  316. $favtit=prompt("Enter the title to be displayed on your favorites toolbar.", "Toolbar Title     (Leave blank or click Cancel to remove title)", $favtit);
  317. setpref(STRING,$tit,$favtit);
  318. alert("Title change will be apparent when K-Meleon is restarted","Favorites Toolbar Title",INFO);
  319. }
  320.  
  321. Chevron{
  322. $chevron="kmeleon.plugins.".$plugin.".chevron"; togglepref(BOOL,$chevron);
  323. &Sync; getpref(BOOL,$chevron)==true ? $var="- ENABLED":$var="- DISABLED";
  324. alert("\nToolbar Chevron ".$var."\n\n\nChange will be visible when K-Meleon is restarted.","Toolbar Chevron",INFO);
  325. }
  326. BookChev{
  327. $plugin="bookmarks"; &Chevron;
  328. }
  329. FavChev{
  330. $plugin="favorites"; &Chevron;
  331. }
  332. HotChev{
  333. $plugin="hotlist"; &Chevron;
  334. }
  335.  
  336. $ol="ID_OPEN_LINK"; $nw="ID_OPEN_LINK_IN_NEW_WINDOW"; 
  337. $bw="ID_OPEN_LINK_IN_BACKGROUND"; $lo="layers(OpenURL)"; $bl="layers(OpenURLBg)";
  338. $book="kmeleon.plugins.bookmarks.openurl";
  339. $fav="kmeleon.plugins.favorites.openurl";
  340. $hot="kmeleon.plugins.hotlist.openurl";
  341.  
  342. openurl{
  343. setpref(STRING,"kmeleon.plugins.".$plugin.".openurl",$how); &Sync;
  344. }
  345.  
  346. OpenBook1{
  347. $plugin="bookmarks"; $how=$ol; &openurl;
  348. }
  349. OpenBook2{
  350. $plugin="bookmarks"; $how=$nw; &openurl;
  351. }
  352. OpenBook3{
  353. $plugin="bookmarks"; $how=$lo; &openurl;
  354. }
  355. OpenBook4{
  356. $plugin="bookmarks"; $how=$bl; &openurl;
  357. }
  358. OpenBook5{
  359. $plugin="bookmarks"; $how=$bw; &openurl;
  360. }
  361.  
  362. OpenFav1{
  363. $plugin="favorites"; $how=$ol; &openurl;
  364. }
  365. OpenFav2{
  366. $plugin="favorites"; $how=$nw; &openurl;
  367. }
  368. OpenFav3{
  369. $plugin="favorites"; $how=$lo; &openurl;
  370. }
  371. OpenFav4{
  372. $plugin="favorites"; $how=$bl; &openurl;
  373. }
  374. OpenFav5{
  375. $plugin="favorites"; $how=$bw; &openurl;
  376. }
  377.  
  378. OpenHot1{
  379. $plugin="hotlist"; $how=$ol; &openurl;
  380. }
  381. OpenHot2{
  382. $plugin="hotlist"; $how=$nw; &openurl;
  383. }
  384. OpenHot3{
  385. $plugin="hotlist"; $how=$lo; &openurl;
  386. }
  387. OpenHot4{
  388. $plugin="hotlist"; $how=$bl; &openurl;
  389. }
  390. OpenHot5{
  391. $plugin="hotlist"; $how=$bw; &openurl;
  392. }
  393.  
  394.  
  395. # ----GROUP MACROS----
  396.  
  397. $kg="kmeleon.group."; $URL="";
  398. $rl="ReplaceLayersInWindow";
  399. $al="AddLayersToWindow";
  400. $gl="GetLayersInWindow";
  401. $fn="FindNick"; $lc="";
  402. $gn="kmeleon.groupnames";
  403.  
  404. ReadNames{
  405. $names=getpref(STRING, $gn);
  406. }
  407. Checkname{
  408. $checkname="\n".$name."\n"; $exists=index($names,$checkname);
  409. }
  410.  
  411. SaveAsGroup{
  412. &ReadNames; $names==""? $names="\n":0;
  413. $group=pluginmsgex(layers,$gl,"",STRING);
  414. $name=prompt("Enter a Group Name to save these layers as:","Group Name?","");
  415. $name==""?"": &Checkname; 
  416. $name==""?"": $exists!=-1? &ConfirmGroup:&SaveGroup;
  417. }
  418. ConfirmGroup{
  419. confirm("Group Name exists. Overwrite?","Group Name  '" . $name . "'  Found",YESNO,EXCLAIM)=="YES"? setpref(STRING, $kg.$name,$group):&SaveAsGroup;
  420. }
  421. SaveGroup{  
  422. setpref(STRING,$gn,$names.$name."\n"); setpref(STRING,$kg.$name,$group);
  423. confirm("\nType  '" . $name . "'  in the URL Bar and press SHIFT+ENTER to open it only or ALT+ENTER to open it next to the current layers.\n\n\nOpen this Group everytime you start K-Meleon?","Group Saved As:  ".$name,YESNO)=="NO" ?"":&SetGroup;
  424. }
  425.  
  426. SavedGroups{
  427. &ReadNames; $names==""? $var="Folder": $var="Group";
  428. $names==""? $names="No Group Names Found" ."\n":0;
  429. $open=confirm($names."\n\nOpen a ".$var." now?", "Saved Groups")=="OK"? &OpenGroup:"";
  430. }
  431.  
  432. URLToGroup{
  433. $name=prompt("Enter a Group Name to add this URL to:","Group Name?","");
  434. getpref(STRING,$kg.$name); $group=getpref(STRING,$kg.$name);
  435. $name==""?"":$group==""? &NoGroup:&AddURL;
  436. }
  437. AddURL{
  438. setpref(STRING,$kg.$name,$group.$URL."\t");
  439. alert("The URL for  '".$TITLE."'  has been added to Group: ".$name,"Group:  '" . $name . "'  Updated",INFO);
  440. }
  441.  
  442. NoGroup{
  443. alert("No Group Found");
  444. }
  445.  
  446. LayersToGroup {
  447. $name=prompt("Enter a Group Name to add these layers to","Group Name?","");
  448. getpref(STRING,$kg.$name); $group=getpref(STRING,$kg.$name);
  449. $name==""?"": $group==""? &NoGroup:&AddLayers;
  450. }
  451. AddLayers{
  452. $curr=pluginmsgex(layers,"GetLayersInWindow","",STRING);
  453. setpref(STRING,$kg.$name,$group.$curr);
  454. alert("Layers added to Group: ".$name,"Group:  '".$name."'  Updated",INFO);
  455. }
  456.  
  457. DeleteGroup{
  458. &ReadNames; $names==""? &NoGroup:&ConfirmDelete;
  459. }
  460. ConfirmDelete{
  461. $open=confirm($names."\n\nDo you want to delete one of these groups?","Saved Groups",YESNO);
  462. $open=="NO"? "":&PromptDelete;
  463. }
  464. PromptDelete{
  465. $name=prompt("Enter Name of Group to Delete:","Group Name?","");
  466. $name==""?"": &Checkname;
  467. $name==""?"": $exists!=-1? &DeleteURLs:&NoGroup;
  468. }
  469. DeleteURLs{
  470. $names=sub($checkname,"\n",$names);
  471. setpref(STRING,$gn,$names); delpref($kg.$name); 
  472. alert("Group: '".$name."' deleted.","Group Deleted",INFO);
  473. }
  474.  
  475. PluginCheck{
  476. getpref(BOOL,"kmeleon.plugins.bookmarks.load")==false ? $hot=getpref(BOOL,"kmeleon.plugins.hotlist.load"):"";
  477. $hot==false ? $tip="Enter Group Name":$tip="Enter Group Name or Folder Nick";
  478. }
  479.  
  480. SetOnly{
  481. setpref(STRING,$og,"layers(ReplaceLayersInWindow)");
  482. }
  483. SetNext{
  484. setpref(STRING,$og,"layers(AddLayersToWindow)");
  485. }
  486. GroupOnly{
  487. $lc=$rl; &SetOnly; &OpenGroup; $lc=$al; &SetNext; 
  488. }
  489. OpenGroup{
  490. $old=getclipboard(); setclipboard(); id(ID_SELECT_URL); id(ID_EDIT_COPY);
  491. $name=getclipboard(); $name==""?$name=$URL:"";
  492. $name==$URL? &PromptGroup:&ChkGroup; setclipboard($old);
  493. }
  494. PromptGroup{ 
  495. &PluginCheck; $name=prompt($tip,"Group Name?","");
  496. $name==""?"":&ChkGroup;
  497. }
  498. ChkGroup{
  499. $group=getpref(STRING,$kg.$name); $group==""? &ChkFolder:&Group;
  500. }
  501. ChkFolder{
  502. $plugin="bookmarks"; $group=pluginmsgex($plugin,$fn,$name,STRING)==""? $plugin="hotlist":"";
  503. pluginmsgex($plugin,$fn,$name,STRING)==""? &ResetURL:&Folder;
  504. }
  505. Group{
  506. $lc==""? $lc=$al:""; pluginmsg(layers,$lc,$group);
  507. }
  508. Folder{
  509. setclipboard($name); id(ID_SELECT_URL); id(ID_EDIT_PASTE); id(ID_NAV_GO); &ResetURL;
  510. }
  511.  
  512. # STARTUP GROUP & LAST SESSION MACROS
  513.  
  514. $loaded=""; 
  515. $sg="kmeleon.general.startGroup";
  516. $sn="kmeleon.general.startGroupName";
  517. $sh="kmeleon.general.startHome";
  518. $og="kmeleon.general.opengroup";
  519. $gt="kmeleon.grouptemp";
  520. $kl="kmeleon.grouplast";
  521. $ln="ID_OPEN_LINK_IN_NEW_WINDOW|ID_OPEN_LINK_IN_BACKGROUND";
  522.  
  523. StartGroup{
  524. $oldname=getpref(STRING,$sn); &PluginCheck;
  525. $name=prompt($tip,"Startup Group Name?",$oldname);
  526. $name==""?"":$group=getpref(STRING,$kg.$name)==""? &FolderCheck:&SetGroup;
  527. }
  528. FolderCheck{
  529. $plugin="bookmarks"; $group=pluginmsgex($plugin,$fn,$name,STRING)==""? $plugin="hotlist":0;
  530. $group=pluginmsgex($plugin,$fn,$name,STRING)==""? &NoStart:&SetGroup;
  531. }
  532. SetGroup{
  533. setpref(INT,$sg,2); setpref(STRING,$sn,$name); setpref(BOOL,$sh,false); &Sync;
  534. }
  535. NoStart{
  536. &NoGroup; setpref(STRING,$sn,$oldname); &StartGroup;
  537. }
  538. StartLast{
  539. setpref(INT,$sg,3); setpref(BOOL, $sh, false); &Sync;
  540. }
  541. StartHome{
  542. setpref(INT,$sg,0); setpref(BOOL,$sh,true); &Sync;
  543. }
  544. StartBlank{
  545. setpref(INT,$sg,1); setpref(BOOL,$sh,false); &Sync;
  546. }
  547.  
  548. GroupStart{
  549. $oldclip=getclipboard(); $name=getpref(STRING,$sn); 
  550. id(ID_SELECT_URL); id(ID_EDIT_COPY); $theurl=getclipboard();
  551. $theurl=="about:blank"? &LayersCheck:"";
  552. setclipboard($oldclip); $loaded="";
  553. }
  554. LayersCheck{ 
  555. $layer=="true"? &StartLayers:&StartWindows;
  556. }
  557. StartLayers{
  558. $lc=$rl; &SetOnly; getpref(INT,$sg)==3 ? &OpenLast:&OpenStart;
  559. $lc=$al; &SetNext;
  560. }
  561. OpenLast{
  562. $group=getpref(STRING,$kl); $group==""?"":&Group;
  563. }
  564. OpenStart{
  565. $name=getpref(STRING,$sn); &ChkGroup;
  566. }
  567. StartWindows{
  568. setpref(STRING,$og,"ID_OPEN_LINK|ID_OPEN_LINK_IN_BACKGROUND"); 
  569. $name=getpref(STRING,$sn); getpref(INT,$sg)==3 ?"":&ChkFolder;
  570. setpref(STRING,$og,$ln);
  571. }
  572.  
  573. GetSetTemp{
  574. $group=pluginmsgex(layers,$gl,"",STRING); setpref(STRING,$gt,$group);
  575. }
  576. SetLast{
  577. $group=getpref(STRING, $gt); setpref(STRING,$kl,$group); 
  578. }
  579. OpenClosed{
  580. $lc=$rl; $group=getpref(STRING,$gt); $curr=pluginmsgex(layers,$gl,"",STRING);
  581. $group==$curr?"":$curr=""; $curr==""? &Group:"";
  582. }
  583.  
  584. ReloadAll{
  585. pluginmsg(layers,"AllLayersInWindow","ID_NAV_RELOAD");
  586. }
  587.  
  588. Home{
  589. getpref(INT,$sg)!=2 ? id(ID_NAV_HOME):&OpenStart;
  590. }
  591.  
  592.  
  593. # EVENT MACROS w/LAST SESSION & STARTUP GROUP SUPPORT
  594.  
  595. OnStartup{
  596. &SetLast;
  597. $layer=="true"? &SetNext:setpref(STRING,$og,$ln);
  598. getpref(INT,$sg)<2 ? "":$loaded="GroupStart"; &Sync;
  599. }
  600.  
  601. OnLoad{
  602. $loaded==""?"":macros($loaded); &GetSetTemp; &Sync;
  603. }
  604.  
  605. OnCloseGroup{
  606. &GetSetTemp;
  607. }
  608.  
  609. OnWMAppExit{
  610. &GetSetTemp;
  611. }
  612.  
  613. OnQuit{
  614. &SetLast; getpref(BOOL,$uar)!=true? &UA:""; 
  615. }
  616.  
  617.  
  618. # ----MAIL MACROS----
  619.  
  620. ReadClient{
  621. $mclient=getpref(STRING,"kmeleon.general.MailClient");
  622. $nclient=getpref(STRING,"kmeleon.general.NewsClient");
  623. }
  624. ParseMail{
  625. &ReadClient; $which="Mail"; $client=$mclient; $ex="hotmail.com";
  626. }
  627. ParseNews{
  628. &ReadClient; $which="News"; $client=$nclient; $ex="groups.google.com";
  629. }
  630. Mail{
  631. &ParseMail;
  632. $mclient==""? &ClientPath:$web=index($mclient,"http")==-1?exec($mclient):opennew($mclient);
  633. }
  634. News{
  635. &ParseNews;
  636. $nclient==""? &ClientPath:$web=index($nclient,"http")==-1?exec($nclient):opennew($nclient);
  637. }
  638. ClientPath{
  639. &ReadClient; $client==""?$client="C:\\Program Files\\Outlook Express\\msimn.exe":0;
  640. $client=prompt("Enter path or full URL (e.g. http://".$ex. ") of your client.",$which." Client Path",$client);
  641. $client==""?"":setpref(STRING,"kmeleon.general.".$which."Client",$client);
  642. $client==""?"":alert("\n".$which." Client =  '".$client."'\n\n\nClick on the ".$which." button to go your ".$which.".",$which." Client Set",INFO);
  643. }
  644. MCFG{
  645. &ParseMail; &ClientPath;
  646. }
  647. NCFG{
  648. &ParseNews; &ClientPath;
  649. }
  650.  
  651. Compose{
  652. $old=getclipboard(); open("mailto:"); &ResetURL; setclipboard($old);
  653. }
  654.  
  655. EmailURL{
  656. $old=getclipboard(); open("mailto:?subject=".gsub("&","%26",$TITLE)."&body=".gsub("&","%26",$URL));
  657. &ResetURL; setclipboard($old);
  658. }
  659. EmailImageURL{
  660. $old=getclipboard(); open("mailto:?subject=".gsub("&","%26",$TITLE)."&body=".gsub("&","%26",$IMAGEURL));
  661. &ResetURL; setclipboard($old);
  662. }
  663. EmailFrameURL{
  664. $old=getclipboard(); open("mailto:?subject=".gsub("&","%26",$TITLE)."&body=".gsub("&","%26",$FRAMEURL));
  665. &ResetURL; setclipboard($old);
  666. }
  667. EmailText{
  668. $macro="EmailTxt"; &JSEnable;
  669. }
  670. EmailTxt{
  671. open("javascript:(function(){var sel=document.getSelection();if(sel)self.location=\"mailto:?subject=\"+document.title+\"&body=\"+escape(sel)})()");
  672. }
  673.  
  674.  
  675. # ----PRIVACY MACROS---- 
  676.  
  677. $animation="image.animation_mode";
  678. $colors="browser.display.use_document_colors";
  679. $cookies="network.cookie.cookieBehavior";
  680. $images="network.image.imageBehavior";
  681. $java="security.enable_java";
  682. $jscript="javascript.enabled";
  683. $popups="dom.disable_open_during_load";
  684. $referer="network.http.sendRefererHeader";
  685.  
  686. AniToggle {
  687. togglepref(STRING,$animation,"normal","none"); &Sync;
  688. getpref(STRING,$animation)=="none"?$tip="BLOCKED":$tip="ALLOWED";
  689. statusbar("Animation ".$tip);
  690. }
  691.  
  692. CToggle{
  693. togglepref(BOOL,$colors); &Sync;
  694. getpref(BOOL,$colors)==false ? $tip="BLOCKED":$tip="ALLOWED";
  695. statusbar("Page Colors ".$tip);
  696. }
  697.  
  698. CKToggle {
  699. togglepref(INT,$cookies,2,0); &Sync;
  700. getpref(INT,$cookies)==2 ? $tip="BLOCKED":$tip="ALLOWED";
  701. statusbar("Cookies ".$tip);
  702. }
  703.  
  704. PBToggle{
  705. togglepref(BOOL,$popups); &Sync;
  706. getpref(BOOL,$popups)==true ? $tip="BLOCKED":$tip="ALLOWED";
  707. statusbar("Popups ".$tip);
  708. }
  709.  
  710. JToggle{
  711. togglepref(BOOL,$java); &Sync;
  712. getpref(BOOL,$java)==false ? $tip="BLOCKED":$tip="ALLOWED";
  713. statusbar("Java ".$tip);
  714. }
  715.  
  716. JSToggle{
  717. togglepref(BOOL,$jscript); &Sync; 
  718. getpref(BOOL,$jscript)==false ? $tip="BLOCKED":$tip="ALLOWED";
  719. statusbar("JavaScript ".$tip);
  720. }
  721.  
  722. ImgToggle {
  723. togglepref(INT,$images,2,0); &Sync;
  724. getpref(INT,$images)==2 ? $tip="BLOCKED":$tip="ALLOWED";
  725. statusbar("Images ".$tip);
  726. }
  727.  
  728. RefToggle {
  729. togglepref(INT,$referer,2,0); &Sync;
  730. getpref(INT,$referer)==2 ? $tip="ALLOWED":$tip="BLOCKED";
  731. statusbar("Referer ".$tip);
  732. }
  733.  
  734. $ua="general.useragent.override"; $uas="";
  735. $pu="kmeleon.privacy.useragent"; $ps=".string";
  736. $uar="kmeleon.privacyUA.noReset";
  737.  
  738. UA{
  739. delpref($ua); &Sync;
  740. }
  741. UA1{
  742. $uas=getpref(STRING,$pu."1".$ps); &SetUA;
  743. }
  744. UA2{
  745. $uas=getpref(STRING,$pu."2".$ps); &SetUA;
  746. }
  747. UA3{
  748. $uas=getpref(STRING,$pu."3".$ps); &SetUA;
  749. }
  750. UACust{
  751. $uas=getpref(STRING,$ua);
  752. $uas=prompt("Enter the User Agent string to identify K-Meleon as:","Custom User Agent",$uas);
  753. $uas==""?"":&SetUA;
  754. }
  755. SetUA{
  756. setpref(STRING,$ua,$uas); &Sync;
  757. }
  758. ResetUA{
  759. togglepref(BOOL,$uar); &Sync;
  760. }
  761.  
  762. ClearAll{
  763. plugin(privacy,ClearCache); plugin(privacy,ClearCookies); 
  764. plugin(privacy,ClearHistory); plugin(privacy,ClearMRU);
  765. plugin(privacy,ClearSignon);
  766. }
  767.  
  768. KillFlash{
  769. $old=getclipboard(); $macro="KillFlsh"; &JSEnable; &ResetURL; setclipboard($old);
  770. }
  771. KillFlsh{
  772. open(" javascript: (function(){var d=document; function K(N,t) { var b = d.createElement('div'); b.style.width=N.width; b.style.height=N.height; b.innerHTML='<del>' + t + '</del>'; N.parentNode.replaceChild(b,N); } function Z(t) { var T = d.getElementsByTagName(t), i; for (i=T.length-1;i+1;--i) K(T[ i ],t); } Z('object'); Z('embed');})(); (function(){document.close();})(); ");
  773. }
  774.  
  775. KillApplets{
  776. $old=getclipboard(); $macro="KillApp"; &JSEnable; &ResetURL; setclipboard($old);
  777. }
  778. KillApp{
  779. open(" javascript: (function(){var d=document; function K(N,t) { var b = d.createElement('div'); b.style.width=N.width; b.style.height=N.height; b.innerHTML='<del>' + t + '</del>'; N.parentNode.replaceChild(b,N); } function Z(t) { var T = d.getElementsByTagName(t), i; for (i=T.length-1;i+1;--i) K(T[ i ],t); } Z('applet');})(); (function(){document.close();})(); ");
  780. }
  781.  
  782.  
  783. # ----LAYER MACROS----
  784.  
  785. $catch="kmeleon.plugins.layers.catchOpen";
  786. $mode="kmeleon.general.mode";
  787. $flip="dom.disable_window_flip";
  788.  
  789. LayersOnly{
  790. $var="LAYERS ONLY"; setpref(BOOL,$layers,true); setpref(BOOL,$catch,true);
  791. $bool=true; $menu=false; &Scripts; setpref(STRING,$mode,$var); &Sync; 
  792. alert("All new windows will open in layers. If switching from Windows Only mode, you'll need to restart K-Meleon for Layers  Only mode to take effect.","Browsing Mode:  ".$var,INFO);
  793. }
  794.  
  795. LayersWindows{
  796. $var=""; setpref(BOOL,$layers,true);
  797. setpref(BOOL,$catch,false); setpref(STRING,$mode,$var); &Sync; 
  798. alert("You will now be able to browse using layers and multiple windows. If switching from Windows Only mode, you'll need to  restart K-Meleon for Layers and Windows mode to take effect.","Browsing Mode:  Layers & Windows", INFO);
  799. }
  800.  
  801. WindowsOnly{
  802. $var="WINDOWS ONLY"; $quest=confirm("\nWindows Only mode will disable the layers plugin. Groups and Sessions will not be  available, only Folder Groups for Bookmarks & Hotlist plugin users.\n\n\nDo you want to disable the layers plugin?","Browsing Mode:  ".$var,YESNO,EXCLAIM);
  803. $quest=="NO"?"":&SetWO; 
  804. }
  805. SetWO{
  806. setpref(BOOL,$layers,false); setpref(BOOL,$catch,false); setpref(STRING,$mode,$var); &Sync; 
  807. alert("Restart K-Meleon for Windows Only mode to take effect.","Browsing Mode:  ".$var,INFO);
  808. }
  809.  
  810. BlockScripts{
  811. $bool=true; $menu=false; &Scripts; &Sync; 
  812. alert("Sites are now BLOCKED from hiding toolbars, resizing the browser and disabling context menus.",Scripts,INFO);
  813. }
  814. AllowScripts{
  815. $bool=false; $menu=true; &Scripts; &Sync;
  816. alert("Sites are now ALLOWED to hide toolbars, resize the browser and disable context menus.",Scripts, INFO);
  817. }
  818. Scripts{
  819. setpref(BOOL,$flip,$bool); 
  820. setpref(BOOL,"dom.disable_window_move_resize",$bool);
  821. setpref(BOOL,"dom.disable_window_open_feature.*",$bool); 
  822. setpref(BOOL,"dom.disable_window_open_feature.minimizable",$bool);
  823. setpref(BOOL,"dom.disable_window_open_feature.titlebar",$bool); 
  824. setpref(BOOL,"dom.disable_window_open_feature.close",$bool);
  825. setpref(BOOL,"dom.disable_window_open_feature.toolbar",$bool); 
  826. setpref(BOOL,"dom.disable_window_open_feature.location",$bool);
  827. setpref(BOOL,"dom.disable_window_open_feature.directories",$bool); 
  828. setpref(BOOL,"dom.disable_window_open_feature.personalbar",$bool);
  829. setpref(BOOL,"dom.disable_window_open_feature.menubar",$bool);
  830. setpref(BOOL,"dom.disable_window_open_feature.scrollbars",$bool);
  831. setpref(BOOL,"dom.disable_window_open_feature.resizable",$bool);
  832. setpref(BOOL,"dom.disable_window_open_feature.status",$bool);
  833. setpref(BOOL,"dom.disable_window_status_change",$bool);
  834. setpref(BOOL,"dom.event.contextmenu.enabled",$menu);
  835. }
  836.  
  837. $num="kmeleon.plugins.layers.numbers";
  838. $style="kmeleon.plugins.layers.style";
  839.  
  840. LayerAlert{
  841. alert("Some changes will only be fully apparent when the next layer is opened.","Layer Appearance Change Completed",INFO);
  842. }
  843. Enumerate{
  844. togglepref(BOOL,$num); &Sync; &LayerAlert;
  845. }
  846. Style{
  847. setpref(INT,$style,$int); &Sync; &LayerAlert;
  848. }
  849. Pressed{
  850. $int=2; &Style;
  851. }
  852. Pressed+{
  853. $int=10; &Style;
  854. }
  855. Buttons{
  856. $int=6; &Style;
  857. }
  858. Buttons+{
  859. $int=14; &Style;
  860. }
  861.  
  862. LayersTitle{
  863. $lt="kmeleon.plugins.layers.title";
  864. $var=getpref(STRING, $lt); $var==""?$var="Layers:":"";
  865. $var=prompt("Enter layer bar title:","Layer Bar Title     ( To remove title, leave blank or Cancel )",$var);
  866. setpref(STRING,$lt,$var);
  867. alert("Layer bar title = ".$var."\n\nChange will be visible when K-Meleon is restarted.","Layer Bar Title",INFO);
  868. }
  869.  
  870. LayerWidth{
  871. $max="kmeleon.plugins.layers.maxWidth";
  872. $min="kmeleon.plugins.layers.minWidth";
  873. $maxwid=getpref(INT,$max); $minwid=getpref(INT,$min);
  874. $maxwid==0 ? $maxwid=35:"";
  875. $maxwid=prompt("Enter Maximum Width:",Maximum Width,$maxwid);
  876. $maxwid==""?"":setpref(INT,$max,$maxwid);
  877. $maxwid==""?"":$minwid=prompt("Enter Minimum Width:",Minimum Width,$minwid);
  878. $maxwid==""?"":$minwid==""?"":setpref(INT,$min,$minwid);
  879. $maxwid==""?"":$minwid==""?"":alert("Maximum = ".$maxwid."\nMinimum = ".$minwid,"Layer Bar Button Width",INFO);
  880. }
  881.  
  882. $onClose="kmeleon.plugins.layers.onCloseOption";
  883. $onOpen="kmeleon.plugins.layers.onOpenOption";
  884.  
  885. SetCloseRight{
  886. setpref(INT,$onClose,2); &Sync;
  887. }
  888. SetCloseLeft{
  889. setpref(INT,$onClose,1); &Sync;
  890. }
  891. SetCloseLast{
  892. setpref(INT,$onClose,0); &Sync;
  893. }
  894. SetOpenNext{
  895. setpref(INT,$onOpen,1); &Sync;
  896. }
  897. SetOpenLast{
  898. setpref(INT,$onOpen,0); &Sync;
  899. }
  900.  
  901. $confirm="kmeleon.plugins.layers.confirmClose";
  902.  
  903. ConfirmToggle{
  904. togglepref(BOOL,$confirm); &Sync;
  905. getpref(BOOL,$confirm)==false ? $tip="DISABLED":$tip="ENABLED";
  906. statusbar("Confirm before close ".$tip);
  907. }
  908.  
  909. Selected{
  910. $old=getclipboard(); setclipboard(); id(ID_EDIT_COPY); $add=getclipboard();
  911. }
  912.  
  913. New{
  914. &Selected; setclipboard($URL); id(ID_SELECT_URL); id(ID_EDIT_PASTE); 
  915. $add==""? &Open:(getpref(STRING,$ou)!="ID_OPEN_LINK"? &PasteSel:&OpenNew);
  916. }
  917. Open{
  918. $layer==true ? plugin(layers,Open):id(ID_NEW_BROWSER); setclipboard($old);
  919. }
  920. OpenNew{
  921. &ResetURL; setclipboard($add);
  922. $layer==true ? pluginmsg(layers,OpenURL,"about:blank"):opennew("about:blank"); 
  923. $loaded="go"; 
  924. }
  925.  
  926. PasteSel{
  927. setclipboard($add); $add==""?id(ID_NAV_GO): &go; setclipboard($old); 
  928. }
  929.  
  930. go{
  931. &PasteGo; setclipboard($old); $loaded="";
  932. }
  933.  
  934.  
  935. # ----URL BAR MACROS---- 
  936.  
  937. SelectGo{
  938. &Selected; &PasteSel;
  939. }
  940.  
  941. Copy{
  942. id(ID_SELECT_URL); id(ID_EDIT_COPY);
  943. }
  944.  
  945. PasteGo{
  946. id(ID_SELECT_URL); id(ID_EDIT_PASTE); id(ID_NAV_GO);  
  947. }
  948.  
  949. PasteSearch{
  950. id(ID_SELECT_URL); id(ID_EDIT_PASTE); &Search;
  951. }
  952.  
  953. ResetURLBar{
  954. $old = getclipboard(); &ResetURL; setclipboard($old);
  955. }
  956.  
  957. $ou="kmeleon.general.openurl";
  958.  
  959. URLBar{
  960. setpref(STRING,$ou,$var); &Sync
  961. }
  962. URLInCurr{
  963. $var="ID_OPEN_LINK"; &URLBar;
  964. }
  965. URLInLayer{
  966. $var="layers(OpenURL)"; &URLBar;
  967. }
  968. URLInNew{
  969. $var="ID_OPEN_LINK_IN_NEW_WINDOW"; &URLBar;
  970. }
  971. URLInBgLayer{
  972. $var="layers(OpenURLBg)"; &URLBar;
  973. }
  974. URLInBg{
  975. $var="ID_OPEN_LINK_IN_BACKGROUND"; &URLBar;
  976. }
  977.  
  978. OpenInNew{
  979. $old=getpref(STRING,$ou); $layer==true? &URLInLayer:&URLInNew;
  980. id(ID_NAV_GO); setpref(STRING,$ou,$old);
  981. }
  982.  
  983. up_directory {
  984. $var=dirname($URL); $var=="."?"":open($var);
  985. }
  986.  
  987. top_level {
  988. $macro="top"; &JSEnable;
  989. }
  990. top{
  991. open("javascript:location.pathname = ""; void 0");
  992. }
  993.  
  994. $dom="kmeleon.general.domComplete"; 
  995.  
  996. ctrl_enter{
  997. $var="0"; &GetComplete; &Domain;
  998. }
  999. ctrl_alt_enter{
  1000. $var="1"; &GetComplete; &Domain;
  1001. }
  1002. ctrl_shift_enter{
  1003. $var="2"; &GetComplete; &Domain;
  1004. }
  1005.  
  1006. GetComplete{
  1007. $prefix=getpref(STRING,$dom.$var.".prefix");  
  1008. $prefix==""? $prefix="http://www.":"";
  1009. $suffix=getpref(STRING,$dom.$var.".suffix");
  1010. $var=="0"?($suffix==""?$suffix=".com":"";):"";
  1011. $var=="1"?($suffix==""?$suffix=".net":"";):""; 
  1012. $var=="2"?($suffix==""?$suffix=".org":"";):"";
  1013. }
  1014.  
  1015. Domain{
  1016. $old=getclipboard(); setclipboard(); id(ID_SELECT_URL); id(ID_EDIT_COPY);
  1017. $theurl=getclipboard(); $theurl==""? &ResetURL: &Complete; setclipboard($old);
  1018. }
  1019. Complete{
  1020. $fullurl=$prefix.$theurl.$suffix;
  1021. setclipboard($fullurl); id(ID_EDIT_PASTE); id(ID_NAV_GO); 
  1022. }
  1023.  
  1024. CEConfig{
  1025. $var="0"; &GetComplete; $tip="Ctrl + Enter"; &DomConfig;
  1026. }
  1027. CAEConfig{
  1028. $var="1"; &GetComplete; $tip="Ctrl + Alt + Enter"; &DomConfig;
  1029. }
  1030. CSEConfig{
  1031. $var="2"; &GetComplete; $tip="Ctrl + Shift + Enter"; &DomConfig;
  1032. }
  1033.  
  1034. DomConfig{
  1035. $prefix=prompt("Prefix:",$tip,$prefix);
  1036. $prefix==""?"":setpref(STRING,$dom.$var.".prefix", $prefix);
  1037. $prefix==""?"":$suffix=prompt("Suffix:",$tip,$suffix);
  1038. $prefix==""?"":$suffix==""?"":setpref(STRING,$dom.$var.".suffix", $suffix);
  1039. $prefix==""?"":$suffix==""?"":alert($prefix."  +  ".$suffix,$tip,INFO);
  1040. }
  1041.  
  1042.  
  1043. # ----DOWNLOAD MACROS----
  1044.  
  1045. $sd="kmeleon.general.saveDir";
  1046. $sp="kmeleon.general.savePageDir";
  1047. $si="kmeleon.general.saveImageDir";
  1048. $sld="kmeleon.general.saveLinkDir";
  1049. $dir="kmeleon.general.profileDir";
  1050. $path=getpref(STRING, $dir);
  1051.  
  1052. GetDir{
  1053. $which=getpref(STRING,$el);
  1054. }
  1055. GetDef{
  1056. $el=$sd; $dl="Default"; &GetDir;
  1057. }
  1058. GetPage{
  1059. $el=$sp; $dl="Save Page As"; &GetDir;
  1060. }
  1061. GetImage{
  1062. $el=$si; $dl="Save Image As"; &GetDir;
  1063. }
  1064. GetLink{
  1065. $el=$sld; $dl="Save Link As"; &GetDir;
  1066. }
  1067.  
  1068. Save{
  1069. &GetDef; $oldsave=$which; macros($get); setpref(STRING,$sd,$which); 
  1070. id($id); setpref(STRING,$sd,$oldsave);
  1071. }
  1072.  
  1073. SavePage{
  1074. $get="GetPage"; $id="ID_FILE_SAVE_AS"; &Save; 
  1075. }
  1076.  
  1077. SaveFrame{
  1078. $get="GetPage"; $id="ID_FILE_SAVE_FRAME_AS"; &Save; 
  1079. }
  1080.  
  1081. SaveImage{
  1082. $get="GetImage"; $id="ID_SAVE_IMAGE_AS"; &Save; 
  1083. }
  1084.  
  1085. SaveLink{
  1086. $get="GetLink"; $id="ID_SAVE_LINK_AS"; &Save; 
  1087. }
  1088.  
  1089. SetDir{
  1090. $savetip="Enter Directory Path. (Include backslash at the end of folder name.)";
  1091. $which==""?$which=$path:"";
  1092. $which=prompt($savetip,$dl,$which);
  1093. $which==""?"":setpref(STRING,$el,$which);
  1094. $which==""?"":$savepath=$which; $which==""?"":&AlertSave;
  1095. }
  1096.  
  1097. DefaultDir{
  1098. &GetDef; &SetDir;
  1099. }
  1100.  
  1101. PageDir{
  1102. &GetPage; &SetDir;
  1103. }
  1104.  
  1105. ImageDir{
  1106. &GetImage; &SetDir;
  1107. }
  1108.  
  1109. LinkDir{
  1110. &GetLink; &SetDir;
  1111. }
  1112.  
  1113. AlertSave{
  1114. &GetDef; $def=$which; $dtip=$dl; &GetPage; $page=$which; $ptip=$dl;
  1115. &GetImage; $image=$which; $itip=$dl; &GetLink; $link=$which; $ltip=$dl;
  1116. alert($dtip."  =  ".$def.\n.$ptip."  =  ".$page.\n.$itip."  =  ".$image.\n.$ltip."  =  ".$link, "Download Directories",INFO); 
  1117. }
  1118.  
  1119.  
  1120. # ----MOUSE GESTURES----
  1121.  
  1122. $mouse="kmeleon.plugins.gestures.";
  1123.  
  1124. Gestures{
  1125. togglepref(BOOL,$mouse."load"); &Sync;
  1126. getpref(BOOL,$mouse."load")==true ? $tip="ENABLED":$tip="DISABLED"; 
  1127. alert("Mouse Gestures will be ".$tip." when K-Meleon is restarted.","Mouse Gestures ".$tip,INFO);
  1128. }
  1129.  
  1130. GestGuide{
  1131. $var=confirm("*M O U S E   G E S T U R E S   C O N F I G U R A T I O N   G U I D E*\n\nThis guide will present a prompt for each available mouse gesture. Each prompt will show the gesture in the title bar. Enter the command or macro that you'd like to use for each gesture. For your convenience, you can copy and paste the command or macro from the available commands list.\n\n\nDo you want to view a list of the available commands and macros to use for the gestures? (Recommended)","MOUSE GESTURES",YESNOCANCEL);
  1132. $var=="YES"? &Commands1st:0; $var=="NO"? &left:0; $var=="CANCEL"?"":0;
  1133. }
  1134. Commands1st{
  1135. &Commands; &left;
  1136. }
  1137.  
  1138. GestCFG{
  1139. $cmd=getpref(STRING,$mouse.$gest);
  1140. $cmd=prompt("Enter ID_COMMAND, PLUGIN COMMAND, or MACRO for this gesture.",$gest,$cmd);
  1141. $cmd==""?"":setpref(STRING,$mouse.$gest,$cmd); 
  1142. $cmd==""?"":confirm($gest."  =  ".$cmd."\n\nConfigure next gesture?","MOUSE GESTURE",YESNO)=="YES"? macros($next):0;
  1143. }
  1144.  
  1145. left{
  1146. $gest="left"; $next="right"; &GestCFG;
  1147. }
  1148. right{
  1149. $gest="right"; $next="down"; &GestCFG;
  1150. }
  1151. down{
  1152. $gest="down"; $next="downleft"; &GestCFG;
  1153. }
  1154. downleft{
  1155. $gest="downleft"; $next="downright"; &GestCFG;
  1156. }
  1157. downright{
  1158. $gest="downright"; $next="up"; &GestCFG;
  1159. }
  1160. up{
  1161. $gest="up"; $next="upleft"; &GestCFG;
  1162. }
  1163. upleft{
  1164. $gest="upleft"; $next="upright"; &GestCFG;
  1165. }
  1166. upright{
  1167. $gest="upright"; $next="left"; &GestCFG;
  1168. }
  1169.  
  1170.  
  1171. # ----BUTTON & MENU SYNC----
  1172.  
  1173. Sync{
  1174.  
  1175. &EngineSync;
  1176. setcheck("macros(SN0)",getpref(INT,$so)==0? true:false);
  1177. setcheck("macros(SN1)",getpref(INT,$so)==1? true:false);
  1178. setcheck("macros(SN2)",getpref(INT,$so)==2? true:false);
  1179. setcheck("macros(SearchLock)",getpref(BOOL,$sl));
  1180.  
  1181. setcheck("macros(Keyword)",getpref(BOOL,"keyword.enabled"));
  1182. setcheck("macros(KeyEngBBN)",getpref(STRING,"keyword.eng")=="BBN"? true:false);
  1183. setcheck("macros(KeyEngIFL)",getpref(STRING,"keyword.eng")=="IFL"? true:false);
  1184. setcheck("macros(KeyEngGoog)",getpref(STRING,"keyword.eng")=="GOOG"? true:false);
  1185. setcheck("macros(KeyConfig)",getpref(STRING,"keyword.eng")==""? true:false);
  1186.  
  1187. setcheck("macros(TAF)",getpref(BOOL,$taf)); 
  1188. setcheck("macros(TAFAuto)",getpref(BOOL,$taf.".autostart")); 
  1189. setcheck("macros(TAFLinks)", getpref(BOOL,$taf.".linksonly")); 
  1190.  
  1191. getpref(BOOL,$sh)==true ? setpref(INT,$sg,0):"";
  1192. setcheck("macros(StartHome)",getpref(BOOL,$sh));
  1193. setcheck("macros(StartBlank)",getpref(INT,$sg)==1? true:false);
  1194. setcheck("macros(StartGroup)",getpref(INT,$sg)==2? true:false);
  1195. setcheck("macros(StartLast)",getpref(INT,$sg)==3? true:false);
  1196.  
  1197. setcheck("macros(ZoomPage)",getpref(STRING,$zoom)==""? true:false);
  1198. setcheck("macros(ZoomText)",getpref(STRING,$zoom)=="text"? true:false);
  1199. setcheck("macros(ZoomImages)",getpref(STRING,$zoom)=="images"? true:false);
  1200.  
  1201. setcheck("macros(BookChev)",getpref(BOOL,"kmeleon.plugins.bookmarks.chevron"));
  1202. setcheck("macros(FavChev)",getpref(BOOL,"kmeleon.plugins.favorites.chevron"));
  1203. setcheck("macros(HotChev)",getpref(BOOL,"kmeleon.plugins.hotlist.chevron"));
  1204. setcheck("macros(OpenBook1)",getpref(STRING,$book)=="ID_OPEN_LINK" ? true:false);
  1205. setcheck("macros(OpenBook2)",getpref(STRING,$book)=="ID_OPEN_LINK_IN_NEW_WINDOW"? true:false);
  1206. setcheck("macros(OpenBook3)",getpref(STRING,$book)=="layers(OpenURL)"? true:false);
  1207. setcheck("macros(OpenBook4)",getpref(STRING,$book)=="layers(OpenURLBg)"? true:false);
  1208. setcheck("macros(OpenBook5)",getpref(STRING,$book)=="ID_OPEN_LINK_IN_BACKGROUND"? true:false);
  1209. setcheck("macros(OpenFav1)",getpref(STRING,$fav)=="ID_OPEN_LINK"? true:false);
  1210. setcheck("macros(OpenFav2)",getpref(STRING,$fav)=="ID_OPEN_LINK_IN_NEW_WINDOW"? true:false);
  1211. setcheck("macros(OpenFav3)",getpref(STRING,$fav)=="layers(OpenURL)"? true:false);
  1212. setcheck("macros(OpenFav4)",getpref(STRING,$fav)=="layers(OpenURLBg)"? true:false);
  1213. setcheck("macros(OpenFav5)",getpref(STRING,$fav)=="ID_OPEN_LINK_IN_BACKGROUND"? true:false);
  1214. setcheck("macros(OpenHot1)",getpref(STRING,$hot)=="ID_OPEN_LINK"? true:false);
  1215. setcheck("macros(OpenHot2)",getpref(STRING,$hot)=="ID_OPEN_LINK_IN_NEW_WINDOW"? true:false);
  1216. setcheck("macros(OpenHot3)",getpref(STRING,$hot)=="layers(OpenURL)"? true:false);
  1217. setcheck("macros(OpenHot4)",getpref(STRING,$hot)=="layers(OpenURLBg)"? true:false);
  1218. setcheck("macros(OpenHot5)",getpref(STRING,$hot)=="ID_OPEN_LINK_IN_BACKGROUND"? true:false);
  1219.  
  1220. setcheck("macros(Enumerate)",getpref(BOOL,$num));
  1221. setcheck("macros(Pressed)",getpref(INT,$style)==2? true:false);
  1222. setcheck("macros(Pressed+)",getpref(INT,$style)==10? true:false);
  1223. setcheck("macros(Buttons)",getpref(INT,$style)==6? true:false);
  1224. setcheck("macros(Buttons+)",getpref(INT,$style)==14? true:false);
  1225. setcheck("macros(SetCloseLast)",getpref(INT,$onClose)==0? true:false);
  1226. setcheck("macros(SetCloseLeft)",getpref(INT,$onClose)==1? true:false);
  1227. setcheck("macros(SetCloseRight)",getpref(INT,$onClose)==2? true:false);
  1228. setcheck("macros(SetOpenNext)",getpref(INT,$onOpen)==1? true:false);
  1229. setcheck("macros(SetOpenLast)",getpref(INT,$onOpen)==0? true:false);
  1230. setcheck("macros(ConfirmToggle)",getpref(BOOL,$confirm));
  1231.  
  1232. setcheck("macros(Gestures)",getpref(BOOL,$mouse."load"));
  1233.  
  1234. setcheck("macros(UA)",""==getpref(STRING,$ua)? true:false);
  1235. setcheck("macros(UA1)",getpref(STRING,$pu."1".$ps)==getpref(STRING,$ua)? true:false);
  1236. setcheck("macros(UA2)",getpref(STRING,$pu."2".$ps)==getpref(STRING,$ua)? true:false);
  1237. setcheck("macros(UA3)",getpref(STRING,$pu."3".$ps)==getpref(STRING,$ua)? true:false);
  1238. setcheck("macros(ResetUA)",getpref(BOOL,$uar)?false:true);
  1239.  
  1240. getpref(BOOL,$layers)==false ? setpref(BOOL,$catch,false):"";
  1241. getpref(BOOL,$layers)==false ? setpref(STRING,$mode,"WINDOWS ONLY"):(getpref(BOOL,$catch)==true ? setpref(STRING,$mode,"LAYERS ONLY"):setpref(STRING,$mode,""));
  1242. setcheck("macros(LayersOnly)",getpref(BOOL,$catch)==true ? true:false);
  1243. setcheck("macros(LayersWindows)",getpref(STRING,$mode)==""? true:false);
  1244. setcheck("macros(WindowsOnly)",$layer==false ? true:false);
  1245.  
  1246. setcheck("macros(URLInCurr)",getpref(STRING,$ou)=="ID_OPEN_LINK"? true:false);
  1247. setcheck("macros(URLInNew)", getpref(STRING,$ou)=="ID_OPEN_LINK_IN_NEW_WINDOW"? true:false);
  1248. setcheck("macros(URLInLayer)",getpref(STRING,$ou)=="layers(OpenURL)"? true:false);
  1249. setcheck("macros(URLInBg)",getpref(STRING,$ou)=="ID_OPEN_LINK_IN_BACKGROUND"? true:false);
  1250. setcheck("macros(URLInBgLayer)",getpref(STRING,$ou)=="layers(OpenURLBg)"? true:false);
  1251.  
  1252. setcheck("macros(BlockScripts)",getpref(BOOL,$flip));
  1253. setcheck("macros(AllowScripts)",getpref(BOOL,$flip)==false ? true:false);
  1254.  
  1255. setcheck("macros(AniToggle)",getpref(STRING,$animation)=="none"? true:false);
  1256. pluginmsg(toolbars,"CheckButton","Privacy Bar,macros(AniToggle),".(getpref(STRING,$animation)=="none"? 1:0));
  1257.  
  1258. setcheck("macros(CToggle)",getpref(BOOL,$colors)? false:true);
  1259. pluginmsg(toolbars,"CheckButton","Privacy Bar,macros(CToggle),".(getpref(BOOL,$colors)? 0:1));
  1260.  
  1261. setcheck("macros(CKToggle)", getpref(INT,$cookies));
  1262. pluginmsg(toolbars,"CheckButton","Privacy Bar,macros(CKToggle),".(getpref(INT,$cookies) ? 1:0));
  1263.  
  1264. setcheck("macros(ImgToggle)",getpref(INT,$images));
  1265. pluginmsg(toolbars,"CheckButton","Privacy Bar,macros(ImgToggle),".(getpref(INT,$images)? 1:0));
  1266.  
  1267. setcheck("macros(JToggle)", getpref(BOOL,$java)? false:true);
  1268. pluginmsg(toolbars,"CheckButton","Privacy Bar,macros(JToggle),".(getpref(BOOL,$java)? 0:1));
  1269.  
  1270. setcheck("macros(JSToggle)",getpref(BOOL,$jscript)? false:true);
  1271. pluginmsg(toolbars,"CheckButton","Privacy Bar,macros(JSToggle),".(getpref(BOOL,$jscript)? 0:1));
  1272.  
  1273. setcheck("macros(PBToggle)",getpref(BOOL,$popups));
  1274. pluginmsg(toolbars,"CheckButton","Main Bar,macros(PBToggle),".(getpref(BOOL,$popups)? 1:0));
  1275. pluginmsg(toolbars,"CheckButton","Privacy Bar,macros(PBToggle),".(getpref(BOOL,$popups)? 1:0));
  1276.  
  1277. setcheck("macros(RefToggle)",getpref(INT,$referer)? false:true);
  1278. pluginmsg(toolbars,"CheckButton","Privacy Bar,macros(RefToggle),".(getpref(INT,$referer)? 0:1));
  1279.  
  1280. }
  1281.  
  1282.  
  1283. # ----CONFIG MACROS----
  1284.  
  1285. $skindir=getpref(STRING,"kmeleon.general.skinsDir");
  1286. $skin=getpref(STRING,"kmeleon.general.skinsCurrent");
  1287.  
  1288. Commands{
  1289. exec("notepad.exe ".$skindir."commands.txt");
  1290. }
  1291. Toolbars{
  1292. exec("notepad.exe ".$skindir.$skin."toolbars.cfg");
  1293. }
  1294. Macros{
  1295. exec("notepad.exe ".$path."macros.cfg");
  1296. }
  1297. Menus{
  1298. exec("notepad.exe ".$path."menus.cfg");
  1299. }
  1300. Accel{
  1301. exec("notepad.exe ".$path."accel.cfg");
  1302. }
  1303. Prefs{
  1304. exec("notepad.exe ".$path."prefs.js");
  1305. }
  1306. User{
  1307. exec("notepad.exe ".$path."user.js");
  1308. }
  1309. UserContent{
  1310. exec("notepad.exe ".$path."\chrome\\userContent.css");
  1311. }
  1312.  
  1313. JSConsole{
  1314. open("javascript:");
  1315. }
  1316.  
  1317. XUL{
  1318. $layer==true ? pluginmsg(layers,OpenURL,$xul):opennew($xul);
  1319. }
  1320. AllPrefs{
  1321. $xul="about:config"; &XUL;
  1322. }
  1323. RSS{
  1324. $xul="chrome://aggreg8/content/aggreg8.xul"; &XUL;
  1325. }
  1326. Master{
  1327. $xul="chrome://pippki/content/pref-masterpass.xul"; &XUL;
  1328. }
  1329. Popups{
  1330. $xul="chrome://communicator/content/popupManager.xul"; &XUL;
  1331. }
  1332. Cert{
  1333. $xul="chrome://pippki/content/certManager.xul"; &XUL;
  1334. }
  1335. Cookies{
  1336. $xul="chrome://cookie/content/pref-cookies.xul"; &XUL; $loaded="CookMgr"; 
  1337. }
  1338. CookMgr{
  1339. open("javascript:viewCookies()"); $loaded="";
  1340. }
  1341. Images{
  1342. $xul="chrome://cookie/content/pref-images.xul"; &XUL; $loaded="ImgMgr";
  1343. }
  1344. ImgMgr{
  1345. open("javascript:viewImages()"); $loaded="";
  1346. }
  1347.  
  1348.  
  1349. # ----MISC. MACROS----
  1350.  
  1351. SetHome{
  1352. setpref(STRING,"kmeleon.general.homePage",$URL); 
  1353. setpref(INT,$sg,0); setpref(BOOL,$sh,true); &Sync;
  1354. alert("'".$TITLE."'  is now your Home Page.","Home Page Updated",INFO);
  1355. }
  1356.  
  1357. KMWiki{
  1358. open("http://kmeleon.sourceforge.net/wiki/index.php?id=Welcome");
  1359. }
  1360.  
  1361. LinkInfo {
  1362. confirm($LinkURL."\n\n\nDo you want to go to this address now?","URL OF SELECTED LINK:",YESNO)=="YES"? open($LINKURL):"";
  1363. }
  1364.  
  1365. ListLinks{
  1366. getpref(BOOL,$popups)==true ? &PB:&ViewLinks; 
  1367. }
  1368. PB{
  1369. &PBToggle; &ViewLinks; &PBToggle;
  1370. }
  1371. ViewLinks{
  1372. $macro="OpenLinks"; &JSEnable;
  1373. }
  1374. OpenLinks{
  1375. open("javascript:LnkW=open('','LnkW','width=600,height=300,scrollbars,resizable');sLFw=window.name;if(!sLFw){sLFw=window.name='sLFw'};sLFd=document;DlnK=document.links;with(LnkW.document){write('<base target='+sLFw+'>'+DlnK.length+' total links from:<br><b>'+sLFd.title+'</b><br>'+sLFd.URL.link(sLFd.URL)+'<hr>');for(lNK=0;lNK<DlnK.length;lNK++){write('<p>'+DlnK[lNK].text+'<br>'+DlnK[lNK].href.link(DlnK[lNK]))};close();LnkW.focus()}") ;
  1376. }
  1377.  
  1378. FrameInLayer{
  1379. pluginmsg(layers,OpenURL,$FRAMEURL);
  1380. }
  1381.  
  1382. FrameInBack{
  1383. $layer==true ? pluginmsg(layers,OpenURLBg,$FRAMEURL):OpenBg($FRAMEURL);
  1384. }
  1385.  
  1386. ReloadFrame {
  1387. $macro="ReloadFrm"; &JSEnable;
  1388. }
  1389. ReloadFrm {
  1390. $FrameURL=""; $PageURL=$FrameURL;
  1391. open("javascript: function chkframes(elem) { var rep; if (unescape(elem.location) == '".$PageURL."' || '".$PageURL."'=='') {  return elem; } for (var f=0; f<elem.frames.length; f++) { rep=chkframes(elem.frames[f]); if (rep) return rep; } return; }  function reloadFrame() { var elem=chkframes(window); elem.location.reload(); } void(reloadFrame()); ");");
  1392. }
  1393.  
  1394. AutoDetect {
  1395. setpref(STRING,"intl.charset.detector",$ARG); forcecharset();
  1396. }
  1397.  
  1398. ForceCharset {
  1399. forcecharset($ARG);
  1400. }
  1401.  
  1402. $ie="\"C:\\Program Files\\Internet Explorer\\iexplore.exe\"";
  1403.  
  1404. URLInIE{
  1405. $oldclip=getclipboard(); setclipboard(); 
  1406. id(ID_SELECT_URL); id(ID_EDIT_COPY); $theurl=getclipboard();
  1407. $theurl==""? $theurl=$URL:""; 
  1408. &ResetURL; setclipboard($oldclip);
  1409. exec($ie.$theurl);
  1410. }
  1411. LinkInIE{
  1412. exec($ie.$LINKURL);
  1413. }
  1414.  
  1415. Default{
  1416. exec("\SetDefault.exe ");
  1417. }
  1418.  
  1419. Continuous{
  1420. getpref(BOOL,$jscript)==false ? (confirm("JavaScript is currently disabled. It must be enabled to use this feature.\n\n\nEnable JavaScript and continue?","JavaScript Disabled",YESNO,EXCLAIM)=="YES" ? &JS1st:""):&Reload;
  1421. JS1st{
  1422. &JSToggle; &Reload;
  1423. }
  1424. Reload{
  1425. open("javascript:(function(){var intv=prompt('Enter number of seconds between reloads. (Click Back button to stop)');if(intv&&!isNaN(intv)){with(document){write('<html><frameset rows=\"*,22\" framespacing=0 border=0 frameborder=no><frame noresize frameborder=no><frame scrolling=no noresize frameborder=no></frameset></html>');frames[0].location.href=document.location.href;var docstr='<html><body bgcolor=cyan style=\"margin-top:0px\">\n';docstr+='Reloading in <span id=\"caption\"></span>secs.</body>\n';docstr+='<script>\nvar reloadIntv='+intv+';\nvar secsLeft='+intv+';\nfunction reloadFrame(){secsLeft=reloadIntv+1;parent.frames[0].location.href=parent.frames[0].location.href;}\nfunction countDown(){secsLeft--;showTime();}\nfunction showTime(){document.getElementById(\"caption\").innerHTML=parseInt(secsLeft)+\" \";}\nsetInterval(\"reloadFrame()\",'+intv*1000+');\nsetInterval(\"countDown()\",1000);\nshowTime();\n</script>\n</html>';frames[1].document.write(docstr);}}})()");
  1426. }
  1427.