home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 September / PCWorld_2008-09_cd.bin / komunikace / kmeleon / K-Meleon1.1.3en-US.exe / macros / ie.kmm < prev    next >
Text File  |  2007-05-04  |  2KB  |  61 lines

  1. # K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
  2.  
  3. # ---------- Microsoft Internet Explorer ---------------------------------------------------------------------------
  4. #
  5. # Dependencies    : main.kmm (Go), sendto.kmm (menus)
  6. # Resources    : -
  7. # Preferences    : -
  8. #
  9. # ------------------------------------------------------------------------------------------------------------------
  10.  
  11. IE_OpenPage{
  12. $_IE_Open=$URL; &_IE_Open;
  13. }
  14. IE_OpenLink{
  15. $_IE_Open=$LinkURL; &_IE_Open;
  16. }
  17. IE_OpenImage{
  18. $_IE_Open=$ImageURL; &_IE_Open;
  19. }
  20. IE_OpenURL{
  21. $__text=$URLBAR; $__text==""?$__text=$URL:0;
  22. $_IE_Open=$__text; &_IE_Open;
  23. }
  24.  
  25. # ----- PRIVATE
  26.  
  27. _IE_Open{
  28. # fallback command line (may fail on NT):
  29. $_IE=sub("%s",_("Program Files"),"\"C:\\%s\\Internet Explorer\\iexplore.exe\" %1");
  30. # try to get IE's command line from the registry:
  31. $__data=readreg("HKCR","Applications\\iexplore.exe\\shell\\open\\command\\");
  32. # PATCH (invalid IE7 registry data)
  33. index($__data,".")>index($__data,"%1")?$__data="\"%ProgramFiles%\\Internet Explorer\\iexplore.exe\" %1":0;
  34. # PATCH
  35. $__data==""?0:$_IE=$__data; exec(sub("%1",$_IE_Open,$_IE));
  36. }
  37.  
  38. _IE_BuildMenu{
  39. index($macroModules,";SendTo;")>-1?&_IE_BuildMenu_SendTo:&_IE_BuildMenu_Default;
  40. }
  41. _IE_BuildMenu_Default{
  42. $__m="Open In &Internet Explorer";
  43. setmenu(DocumentOpenExternal,macro,$__m,IE_OpenPage);
  44. setmenu(LinkOpenExternal,macro,$__m,IE_OpenLink);
  45. #setmenu(ImageOpenExternal,macro,$__m,IE_OpenImage);
  46. setmenu(_Go_Open,macro,$__m,IE_OpenURL);
  47. }
  48. _IE_BuildMenu_SendTo{
  49. $__m="&Internet Explorer";
  50. setmenu($_SendTo_Page,macro,$__m,IE_OpenPage);
  51. setmenu($_SendTo_Link,macro,$__m,IE_OpenLink);
  52. #setmenu($_SendTo_Image,macro,$__m,IE_OpenImage);
  53. setmenu($_SendTo_URL,macro,$__m,IE_OpenURL);
  54. }
  55. _IE_SetAccels{
  56. setaccel("CTRL ALT I","macros(IE_OpenPage)");
  57. }
  58. $OnInit=$OnInit."_IE_SetAccels;_IE_BuildMenu;";
  59.  
  60. # ------------------------------------------------------------------------------------------------------------------
  61. $macroModules=$macroModules."IE;";