javascript-e8d60e0f.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. import{g as $}from"./index-15e3682d.js";function c(i,r){for(var n=0;n<r.length;n++){const t=r[n];if(typeof t!="string"&&!Array.isArray(t)){for(const e in t)if(e!=="default"&&!(e in i)){const s=Object.getOwnPropertyDescriptor(t,e);s&&Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var o={exports:{}};(function(i,r){ace.define("ace/snippets/javascript.snippets",["require","exports","module"],function(n,t,e){e.exports=`# Prototype
  2. snippet proto
  3. \${1:class_name}.prototype.\${2:method_name} = function(\${3:first_argument}) {
  4. \${4:// body...}
  5. };
  6. # Function
  7. snippet fun
  8. function \${1?:function_name}(\${2:argument}) {
  9. \${3:// body...}
  10. }
  11. # Anonymous Function
  12. regex /((=)\\s*|(:)\\s*|(\\()|\\b)/f/(\\))?/
  13. snippet f
  14. function\${M1?: \${1:functionName}}($2) {
  15. \${0:$TM_SELECTED_TEXT}
  16. }\${M2?;}\${M3?,}\${M4?)}
  17. # Immediate function
  18. trigger \\(?f\\(
  19. endTrigger \\)?
  20. snippet f(
  21. (function(\${1}) {
  22. \${0:\${TM_SELECTED_TEXT:/* code */}}
  23. }(\${1}));
  24. # if
  25. snippet if
  26. if (\${1:true}) {
  27. \${0}
  28. }
  29. # if ... else
  30. snippet ife
  31. if (\${1:true}) {
  32. \${2}
  33. } else {
  34. \${0}
  35. }
  36. # tertiary conditional
  37. snippet ter
  38. \${1:/* condition */} ? \${2:a} : \${3:b}
  39. # switch
  40. snippet switch
  41. switch (\${1:expression}) {
  42. case '\${3:case}':
  43. \${4:// code}
  44. break;
  45. \${5}
  46. default:
  47. \${2:// code}
  48. }
  49. # case
  50. snippet case
  51. case '\${1:case}':
  52. \${2:// code}
  53. break;
  54. \${3}
  55. # while (...) {...}
  56. snippet wh
  57. while (\${1:/* condition */}) {
  58. \${0:/* code */}
  59. }
  60. # try
  61. snippet try
  62. try {
  63. \${0:/* code */}
  64. } catch (e) {}
  65. # do...while
  66. snippet do
  67. do {
  68. \${2:/* code */}
  69. } while (\${1:/* condition */});
  70. # Object Method
  71. snippet :f
  72. regex /([,{[])|^\\s*/:f/
  73. \${1:method_name}: function(\${2:attribute}) {
  74. \${0}
  75. }\${3:,}
  76. # setTimeout function
  77. snippet setTimeout
  78. regex /\\b/st|timeout|setTimeo?u?t?/
  79. setTimeout(function() {\${3:$TM_SELECTED_TEXT}}, \${1:10});
  80. # Get Elements
  81. snippet gett
  82. getElementsBy\${1:TagName}('\${2}')\${3}
  83. # Get Element
  84. snippet get
  85. getElementBy\${1:Id}('\${2}')\${3}
  86. # console.log (Firebug)
  87. snippet cl
  88. console.log(\${1});
  89. # return
  90. snippet ret
  91. return \${1:result}
  92. # for (property in object ) { ... }
  93. snippet fori
  94. for (var \${1:prop} in \${2:Things}) {
  95. \${0:$2[$1]}
  96. }
  97. # hasOwnProperty
  98. snippet has
  99. hasOwnProperty(\${1})
  100. # docstring
  101. snippet /**
  102. /**
  103. * \${1:description}
  104. *
  105. */
  106. snippet @par
  107. regex /^\\s*\\*\\s*/@(para?m?)?/
  108. @param {\${1:type}} \${2:name} \${3:description}
  109. snippet @ret
  110. @return {\${1:type}} \${2:description}
  111. # JSON.parse
  112. snippet jsonp
  113. JSON.parse(\${1:jstr});
  114. # JSON.stringify
  115. snippet jsons
  116. JSON.stringify(\${1:object});
  117. # self-defining function
  118. snippet sdf
  119. var \${1:function_name} = function(\${2:argument}) {
  120. \${3:// initial code ...}
  121. $1 = function($2) {
  122. \${4:// main code}
  123. };
  124. }
  125. # singleton
  126. snippet sing
  127. function \${1:Singleton} (\${2:argument}) {
  128. // the cached instance
  129. var instance;
  130. // rewrite the constructor
  131. $1 = function $1($2) {
  132. return instance;
  133. };
  134. // carry over the prototype properties
  135. $1.prototype = this;
  136. // the instance
  137. instance = new $1();
  138. // reset the constructor pointer
  139. instance.constructor = $1;
  140. \${3:// code ...}
  141. return instance;
  142. }
  143. # class
  144. snippet class
  145. regex /^\\s*/clas{0,2}/
  146. var \${1:class} = function(\${20}) {
  147. $40$0
  148. };
  149. (function() {
  150. \${60:this.prop = ""}
  151. }).call(\${1:class}.prototype);
  152. exports.\${1:class} = \${1:class};
  153. #
  154. snippet for-
  155. for (var \${1:i} = \${2:Things}.length; \${1:i}--; ) {
  156. \${0:\${2:Things}[\${1:i}];}
  157. }
  158. # for (...) {...}
  159. snippet for
  160. for (var \${1:i} = 0; $1 < \${2:Things}.length; $1++) {
  161. \${3:$2[$1]}$0
  162. }
  163. # for (...) {...} (Improved Native For-Loop)
  164. snippet forr
  165. for (var \${1:i} = \${2:Things}.length - 1; $1 >= 0; $1--) {
  166. \${3:$2[$1]}$0
  167. }
  168. #modules
  169. snippet def
  170. define(function(require, exports, module) {
  171. "use strict";
  172. var \${1/.*\\///} = require("\${1}");
  173. $TM_SELECTED_TEXT
  174. });
  175. snippet req
  176. guard ^\\s*
  177. var \${1/.*\\///} = require("\${1}");
  178. $0
  179. snippet requ
  180. guard ^\\s*
  181. var \${1/.*\\/(.)/\\u$1/} = require("\${1}").\${1/.*\\/(.)/\\u$1/};
  182. $0
  183. `}),ace.define("ace/snippets/javascript",["require","exports","module","ace/snippets/javascript.snippets"],function(n,t,e){t.snippetText=n("./javascript.snippets"),t.scope="javascript"}),function(){ace.require(["ace/snippets/javascript"],function(n){i&&(i.exports=n)})}()})(o);var p=o.exports;const a=$(p),f=c({__proto__:null,default:a},[p]);export{f as j};