Go to pimshell (6)-predefined global variables

Source: Internet
Author: User

Pimshell predefines and initializes some global variables that can be accessed directly in JavaScript code. "Page" is the first global variable, and other global variables are directly or indirectly from it. The initialization of these variables is similar to the following code:

  1. /*
  2. Enum
  3. */
  4. // Behavior required y code
  5. VaR enum_behaviornotify =
  6. {Addprofile: 9, addmarkup: 10, addinit: 11, addready: 12, dispose: 13 };
  7. // Cuteevent eventclass ID
  8. VaR enum_eventclassid =
  9. {Delay: 0, async: 1, simple: 2, asyncscript: 3, data: 4, catalog: 5 };
  10. // Tray message
  11. VaR enum_traymessagetype = {info: 0, warning: 1, error: 2 };
  12. VaR enum_traymessagecontenttype = {string: 0, IFRAME: 1, behavior: 2 };
  13. // Plugins guid
  14. VaR enum_plugins_guid = {
  15. Empty: "{00000000-0000-0000-0000-000000000000 }",
  16. Theme: "{00000000-0000-0000-0000-000000000001 }",
  17. System: "{00000000-0000-0000-0001-000000000000 }",
  18. GENERAL: "{00000000-0000-0000-0001-000000000001 }",
  19. Safe: "{00000000-0000-0000-0001-000000000002 }",
  20. Help: "{00000000-0000-0000-0001-000000000003 }"};
  21. /*
  22. Variables
  23. */
  24. VaR clientcontext = page. clientcontext;
  25. VaR plugin = clientcontext. plugin;
  26. VaR system = clientcontext. plugin (enum_plugins_guid.system );
  27. VaR General = clientcontext. plugin (enum_plugins_guid.general );
  28. VaR Options = clientcontext. options;
  29. VaR Config = clientcontext. config;
  30. VaR Language = clientcontext. language;
  31. VaR cuteevent = clientcontext. event;
  32. VaR datamanager = clientcontext. datamanager;
  33. VaR traymessage = clientcontext. traymessage;
  34. VaR remoteobject = clientcontext. remoteobject;
  35. VaR profilemanager = clientcontext. profilemanager;
  36. VaR profile = page. profile;
  37. //
  38. VaR root = page. root;
  39. //
  40. VaR Ajax = page. Ajax;
  41. VaR sys = Ajax. sys;
  42. VaR UI = Ajax. UI;
  43. VaR net = Ajax. net;
  44. VaR domelement = UI. domelement;
  45. VaR timer = SYS. timer;
  46. VaR string2 = SYS. String;
  47. VaR xmlhttpmanager = net. xmlhttpmanager;
  48. VaR pimtools = page. pimtools;
  49. VaR tools = page. tools;
  50. VaR trace = NULL;
  51. If (Root)
  52. Trace = root. Trace;
  53. /*
  54. Function
  55. */
  56. //
  57. Function $ (element)
  58. {
  59. Return SYS. getelementbyid (element );
  60. }
  61. Function $ object (element)
  62. {
  63. Return page. findcontrol (element );
  64. }
  65. Function $ F (element)
  66. {
  67. Return SYS. getelementvalue (element );
  68. }
  69. Function $ list (STR, delimiter)
  70. {
  71. VaR _ olist = SYS. List;
  72. If (typeof (delimiter) = "undefined ")
  73. _ Olist. Split (STR ,",");
  74. Else
  75. _ Olist. Split (STR, delimiter );
  76. Return _ olist;
  77. }

For more information about how to use VC ++ to set global variables in Javascript, see pimshell (2)-no longer use external extension browsers.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.