f0c3577b988df216dc7b30f3c15e2eae.js 108 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416
  1. ace.define("ace/mode/jsdoc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  2. var oop = require("../lib/oop");
  3. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  4. var JsDocCommentHighlightRules = function () {
  5. this.$rules = {
  6. "start": [
  7. {
  8. token: ["comment.doc.tag", "comment.doc.text", "lparen.doc"],
  9. regex: "(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)",
  10. push: [
  11. {
  12. token: "lparen.doc",
  13. regex: "{",
  14. push: [
  15. {
  16. include: "doc-syntax"
  17. }, {
  18. token: "rparen.doc",
  19. regex: "}|(?=$)",
  20. next: "pop"
  21. }
  22. ]
  23. }, {
  24. token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
  25. regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
  26. next: "pop"
  27. }, {
  28. token: "rparen.doc",
  29. regex: "}|(?=$)",
  30. next: "pop"
  31. }, {
  32. include: "doc-syntax"
  33. }, {
  34. defaultToken: "text.doc"
  35. }
  36. ]
  37. }, {
  38. token: ["comment.doc.tag", "text.doc", "lparen.doc"],
  39. regex: "(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|"
  40. + "implements|external|exception|throws|enum|define|extends))(\\s*)({)",
  41. push: [
  42. {
  43. token: "lparen.doc",
  44. regex: "{",
  45. push: [
  46. {
  47. include: "doc-syntax"
  48. }, {
  49. token: "rparen.doc",
  50. regex: "}|(?=$)",
  51. next: "pop"
  52. }
  53. ]
  54. }, {
  55. token: "rparen.doc",
  56. regex: "}|(?=$)",
  57. next: "pop"
  58. }, {
  59. include: "doc-syntax"
  60. }, {
  61. defaultToken: "text.doc"
  62. }
  63. ]
  64. }, {
  65. token: ["comment.doc.tag", "text.doc", "variable.parameter.doc"],
  66. regex: "(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|"
  67. + "requires|param|implements|function|extends|typedef|mixes|constructor|var|"
  68. + "memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|"
  69. + "throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#\.:\/~\"\\-]*)?"
  70. }, {
  71. token: ["comment.doc.tag", "text.doc", "variable.parameter.doc"],
  72. regex: "(@method)(\\s+)(\\w[\\w\.\\(\\)]*)"
  73. }, {
  74. token: "comment.doc.tag",
  75. regex: "@access\\s+(?:private|public|protected)"
  76. }, {
  77. token: "comment.doc.tag",
  78. regex: "@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)"
  79. }, {
  80. token: "comment.doc.tag",
  81. regex: "@\\w+(?=\\s|$)"
  82. },
  83. JsDocCommentHighlightRules.getTagRule(),
  84. {
  85. defaultToken: "comment.doc.body",
  86. caseInsensitive: true
  87. }
  88. ],
  89. "doc-syntax": [{
  90. token: "operator.doc",
  91. regex: /[|:]/
  92. }, {
  93. token: "paren.doc",
  94. regex: /[\[\]]/
  95. }]
  96. };
  97. this.normalizeRules();
  98. };
  99. oop.inherits(JsDocCommentHighlightRules, TextHighlightRules);
  100. JsDocCommentHighlightRules.getTagRule = function (start) {
  101. return {
  102. token: "comment.doc.tag.storage.type",
  103. regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
  104. };
  105. };
  106. JsDocCommentHighlightRules.getStartRule = function (start) {
  107. return {
  108. token: "comment.doc", // doc comment
  109. regex: /\/\*\*(?!\/)/,
  110. next: start
  111. };
  112. };
  113. JsDocCommentHighlightRules.getEndRule = function (start) {
  114. return {
  115. token: "comment.doc", // closing comment
  116. regex: "\\*\\/",
  117. next: start
  118. };
  119. };
  120. exports.JsDocCommentHighlightRules = JsDocCommentHighlightRules;
  121. });
  122. ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/jsdoc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  123. var oop = require("../lib/oop");
  124. var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules;
  125. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  126. var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
  127. var JavaScriptHighlightRules = function (options) {
  128. var keywords = {
  129. "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
  130. "Namespace|QName|XML|XMLList|" + // E4X
  131. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  132. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
  133. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
  134. "SyntaxError|TypeError|URIError|" +
  135. "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
  136. "isNaN|parseFloat|parseInt|" +
  137. "JSON|Math|" + // Other
  138. "this|arguments|prototype|window|document", // Pseudo
  139. "keyword": "const|yield|import|get|set|async|await|" +
  140. "break|case|catch|continue|default|delete|do|else|finally|for|" +
  141. "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
  142. "__parent__|__count__|escape|unescape|with|__proto__|" +
  143. "class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
  144. "storage.type": "const|let|var|function",
  145. "constant.language": "null|Infinity|NaN|undefined",
  146. "support.function": "alert",
  147. "constant.language.boolean": "true|false"
  148. };
  149. var keywordMapper = this.createKeywordMapper(keywords, "identifier");
  150. var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
  151. var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
  152. "u[0-9a-fA-F]{4}|" + // unicode
  153. "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
  154. "[0-2][0-7]{0,2}|" + // oct
  155. "3[0-7][0-7]?|" + // oct
  156. "[4-7][0-7]?|" + //oct
  157. ".)";
  158. var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
  159. var functionCallStartRule = {
  160. token: ["identifier", "text", "paren.lparen"],
  161. regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
  162. };
  163. this.$rules = {
  164. "no_regex": [
  165. DocCommentHighlightRules.getStartRule("doc-start"),
  166. comments("no_regex"),
  167. functionCallStartRule,
  168. {
  169. token: "string",
  170. regex: "'(?=.)",
  171. next: "qstring"
  172. }, {
  173. token: "string",
  174. regex: '"(?=.)',
  175. next: "qqstring"
  176. }, {
  177. token: "constant.numeric", // hexadecimal, octal and binary
  178. regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
  179. }, {
  180. token: "constant.numeric", // decimal integers and floats
  181. regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
  182. }, {
  183. token: [
  184. "entity.name.function", "text", "keyword.operator", "text", "storage.type",
  185. "text", "storage.type", "text", "paren.lparen"
  186. ],
  187. regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
  188. next: "function_arguments"
  189. }, {
  190. token: [
  191. "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
  192. ],
  193. regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
  194. next: "function_arguments"
  195. }, {
  196. token: [
  197. "entity.name.function", "text", "punctuation.operator",
  198. "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
  199. ],
  200. regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
  201. next: "function_arguments"
  202. }, {
  203. token: [
  204. "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
  205. ],
  206. regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
  207. next: "function_arguments"
  208. }, {
  209. token: "keyword",
  210. regex: "from(?=\\s*('|\"))"
  211. }, {
  212. token: "keyword",
  213. regex: "(?:" + kwBeforeRe + ")\\b",
  214. next: "start"
  215. }, {
  216. token: "support.constant",
  217. regex: /that\b/
  218. }, {
  219. token: ["storage.type", "punctuation.operator", "support.function.firebug"],
  220. regex: /(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/
  221. }, {
  222. token: keywordMapper,
  223. regex: identifierRe
  224. }, {
  225. token: "punctuation.operator",
  226. regex: /[.](?![.])/,
  227. next: "property"
  228. }, {
  229. token: "storage.type",
  230. regex: /=>/,
  231. next: "start"
  232. }, {
  233. token: "keyword.operator",
  234. regex: /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
  235. next: "start"
  236. }, {
  237. token: "punctuation.operator",
  238. regex: /[?:,;.]/,
  239. next: "start"
  240. }, {
  241. token: "paren.lparen",
  242. regex: /[\[({]/,
  243. next: "start"
  244. }, {
  245. token: "paren.rparen",
  246. regex: /[\])}]/
  247. }, {
  248. token: "comment",
  249. regex: /^#!.*$/
  250. }
  251. ],
  252. property: [{
  253. token: "text",
  254. regex: "\\s+"
  255. }, {
  256. token: "keyword.operator",
  257. regex: /=/
  258. }, {
  259. token: [
  260. "storage.type", "text", "storage.type", "text", "paren.lparen"
  261. ],
  262. regex: anonymousFunctionRe + "(\\s*)(\\()",
  263. next: "function_arguments"
  264. }, {
  265. token: [
  266. "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
  267. ],
  268. regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
  269. next: "function_arguments"
  270. }, {
  271. token: "punctuation.operator",
  272. regex: /[.](?![.])/
  273. }, {
  274. token: "support.function",
  275. regex: "prototype"
  276. }, {
  277. token: "support.function",
  278. regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
  279. }, {
  280. token: "support.function.dom",
  281. regex: /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
  282. }, {
  283. token: "support.constant",
  284. regex: /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
  285. }, {
  286. token: "identifier",
  287. regex: identifierRe
  288. }, {
  289. regex: "",
  290. token: "empty",
  291. next: "no_regex"
  292. }
  293. ],
  294. "start": [
  295. DocCommentHighlightRules.getStartRule("doc-start"),
  296. comments("start"),
  297. {
  298. token: "string.regexp",
  299. regex: "\\/",
  300. next: "regex"
  301. }, {
  302. token: "text",
  303. regex: "\\s+|^$",
  304. next: "start"
  305. }, {
  306. token: "empty",
  307. regex: "",
  308. next: "no_regex"
  309. }
  310. ],
  311. "regex": [
  312. {
  313. token: "regexp.keyword.operator",
  314. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  315. }, {
  316. token: "string.regexp",
  317. regex: "/[sxngimy]*",
  318. next: "no_regex"
  319. }, {
  320. token: "invalid",
  321. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  322. }, {
  323. token: "constant.language.escape",
  324. regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  325. }, {
  326. token: "constant.language.delimiter",
  327. regex: /\|/
  328. }, {
  329. token: "constant.language.escape",
  330. regex: /\[\^?/,
  331. next: "regex_character_class"
  332. }, {
  333. token: "empty",
  334. regex: "$",
  335. next: "no_regex"
  336. }, {
  337. defaultToken: "string.regexp"
  338. }
  339. ],
  340. "regex_character_class": [
  341. {
  342. token: "regexp.charclass.keyword.operator",
  343. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  344. }, {
  345. token: "constant.language.escape",
  346. regex: "]",
  347. next: "regex"
  348. }, {
  349. token: "constant.language.escape",
  350. regex: "-"
  351. }, {
  352. token: "empty",
  353. regex: "$",
  354. next: "no_regex"
  355. }, {
  356. defaultToken: "string.regexp.charachterclass"
  357. }
  358. ],
  359. "default_parameter": [
  360. {
  361. token: "string",
  362. regex: "'(?=.)",
  363. push: [
  364. {
  365. token: "string",
  366. regex: "'|$",
  367. next: "pop"
  368. }, {
  369. include: "qstring"
  370. }
  371. ]
  372. }, {
  373. token: "string",
  374. regex: '"(?=.)',
  375. push: [
  376. {
  377. token: "string",
  378. regex: '"|$',
  379. next: "pop"
  380. }, {
  381. include: "qqstring"
  382. }
  383. ]
  384. }, {
  385. token: "constant.language",
  386. regex: "null|Infinity|NaN|undefined"
  387. }, {
  388. token: "constant.numeric", // hexadecimal, octal and binary
  389. regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
  390. }, {
  391. token: "constant.numeric", // decimal integers and floats
  392. regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
  393. }, {
  394. token: "punctuation.operator",
  395. regex: ",",
  396. next: "function_arguments"
  397. }, {
  398. token: "text",
  399. regex: "\\s+"
  400. }, {
  401. token: "punctuation.operator",
  402. regex: "$"
  403. }, {
  404. token: "empty",
  405. regex: "",
  406. next: "no_regex"
  407. }
  408. ],
  409. "function_arguments": [
  410. comments("function_arguments"),
  411. {
  412. token: "variable.parameter",
  413. regex: identifierRe
  414. }, {
  415. token: "punctuation.operator",
  416. regex: ","
  417. }, {
  418. token: "text",
  419. regex: "\\s+"
  420. }, {
  421. token: "punctuation.operator",
  422. regex: "$"
  423. }, {
  424. token: "empty",
  425. regex: "",
  426. next: "no_regex"
  427. }
  428. ],
  429. "qqstring": [
  430. {
  431. token: "constant.language.escape",
  432. regex: escapedRe
  433. }, {
  434. token: "string",
  435. regex: "\\\\$",
  436. consumeLineEnd: true
  437. }, {
  438. token: "string",
  439. regex: '"|$',
  440. next: "no_regex"
  441. }, {
  442. defaultToken: "string"
  443. }
  444. ],
  445. "qstring": [
  446. {
  447. token: "constant.language.escape",
  448. regex: escapedRe
  449. }, {
  450. token: "string",
  451. regex: "\\\\$",
  452. consumeLineEnd: true
  453. }, {
  454. token: "string",
  455. regex: "'|$",
  456. next: "no_regex"
  457. }, {
  458. defaultToken: "string"
  459. }
  460. ]
  461. };
  462. if (!options || !options.noES6) {
  463. this.$rules.no_regex.unshift({
  464. regex: "[{}]", onMatch: function (val, state, stack) {
  465. this.next = val == "{" ? this.nextState : "";
  466. if (val == "{" && stack.length) {
  467. stack.unshift("start", state);
  468. }
  469. else if (val == "}" && stack.length) {
  470. stack.shift();
  471. this.next = stack.shift();
  472. if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
  473. return "paren.quasi.end";
  474. }
  475. return val == "{" ? "paren.lparen" : "paren.rparen";
  476. },
  477. nextState: "start"
  478. }, {
  479. token: "string.quasi.start",
  480. regex: /`/,
  481. push: [{
  482. token: "constant.language.escape",
  483. regex: escapedRe
  484. }, {
  485. token: "paren.quasi.start",
  486. regex: /\${/,
  487. push: "start"
  488. }, {
  489. token: "string.quasi.end",
  490. regex: /`/,
  491. next: "pop"
  492. }, {
  493. defaultToken: "string.quasi"
  494. }]
  495. }, {
  496. token: ["variable.parameter", "text"],
  497. regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
  498. }, {
  499. token: "paren.lparen",
  500. regex: "(\\()(?=[^\\(]+\\s*=>)",
  501. next: "function_arguments"
  502. }, {
  503. token: "variable.language",
  504. regex: "(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"
  505. });
  506. this.$rules["function_arguments"].unshift({
  507. token: "keyword.operator",
  508. regex: "=",
  509. next: "default_parameter"
  510. }, {
  511. token: "keyword.operator",
  512. regex: "\\.{3}"
  513. });
  514. this.$rules["property"].unshift({
  515. token: "support.function",
  516. regex: "(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|"
  517. + "finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"
  518. }, {
  519. token: "constant.language",
  520. regex: "(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"
  521. });
  522. if (!options || options.jsx != false)
  523. JSX.call(this);
  524. }
  525. this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("no_regex")]);
  526. this.normalizeRules();
  527. };
  528. oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
  529. function JSX() {
  530. var tagRegex = identifierRe.replace("\\d", "\\d\\-");
  531. var jsxTag = {
  532. onMatch: function (val, state, stack) {
  533. var offset = val.charAt(1) == "/" ? 2 : 1;
  534. if (offset == 1) {
  535. if (state != this.nextState)
  536. stack.unshift(this.next, this.nextState, 0);
  537. else
  538. stack.unshift(this.next);
  539. stack[2]++;
  540. }
  541. else if (offset == 2) {
  542. if (state == this.nextState) {
  543. stack[1]--;
  544. if (!stack[1] || stack[1] < 0) {
  545. stack.shift();
  546. stack.shift();
  547. }
  548. }
  549. }
  550. return [{
  551. type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
  552. value: val.slice(0, offset)
  553. }, {
  554. type: "meta.tag.tag-name.xml",
  555. value: val.substr(offset)
  556. }];
  557. },
  558. regex: "</?(?:" + tagRegex + "|(?=>))",
  559. next: "jsxAttributes",
  560. nextState: "jsx"
  561. };
  562. this.$rules.start.unshift(jsxTag);
  563. var jsxJsRule = {
  564. regex: "{",
  565. token: "paren.quasi.start",
  566. push: "start"
  567. };
  568. this.$rules.jsx = [
  569. jsxJsRule,
  570. jsxTag,
  571. { include: "reference" }, { defaultToken: "string.xml" }
  572. ];
  573. this.$rules.jsxAttributes = [{
  574. token: "meta.tag.punctuation.tag-close.xml",
  575. regex: "/?>",
  576. onMatch: function (value, currentState, stack) {
  577. if (currentState == stack[0])
  578. stack.shift();
  579. if (value.length == 2) {
  580. if (stack[0] == this.nextState)
  581. stack[1]--;
  582. if (!stack[1] || stack[1] < 0) {
  583. stack.splice(0, 2);
  584. }
  585. }
  586. this.next = stack[0] || "start";
  587. return [{ type: this.token, value: value }];
  588. },
  589. nextState: "jsx"
  590. },
  591. jsxJsRule,
  592. comments("jsxAttributes"),
  593. {
  594. token: "entity.other.attribute-name.xml",
  595. regex: tagRegex
  596. }, {
  597. token: "keyword.operator.attribute-equals.xml",
  598. regex: "="
  599. }, {
  600. token: "text.tag-whitespace.xml",
  601. regex: "\\s+"
  602. }, {
  603. token: "string.attribute-value.xml",
  604. regex: "'",
  605. stateName: "jsx_attr_q",
  606. push: [
  607. { token: "string.attribute-value.xml", regex: "'", next: "pop" },
  608. { include: "reference" },
  609. { defaultToken: "string.attribute-value.xml" }
  610. ]
  611. }, {
  612. token: "string.attribute-value.xml",
  613. regex: '"',
  614. stateName: "jsx_attr_qq",
  615. push: [
  616. { token: "string.attribute-value.xml", regex: '"', next: "pop" },
  617. { include: "reference" },
  618. { defaultToken: "string.attribute-value.xml" }
  619. ]
  620. },
  621. jsxTag
  622. ];
  623. this.$rules.reference = [{
  624. token: "constant.language.escape.reference.xml",
  625. regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  626. }];
  627. }
  628. function comments(next) {
  629. return [
  630. {
  631. token: "comment", // multi line comment
  632. regex: /\/\*/,
  633. next: [
  634. DocCommentHighlightRules.getTagRule(),
  635. { token: "comment", regex: "\\*\\/", next: next || "pop" },
  636. { defaultToken: "comment", caseInsensitive: true }
  637. ]
  638. }, {
  639. token: "comment",
  640. regex: "\\/\\/",
  641. next: [
  642. DocCommentHighlightRules.getTagRule(),
  643. { token: "comment", regex: "$|^", next: next || "pop" },
  644. { defaultToken: "comment", caseInsensitive: true }
  645. ]
  646. }
  647. ];
  648. }
  649. exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
  650. });
  651. ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
  652. var Range = require("../range").Range;
  653. var MatchingBraceOutdent = function () { };
  654. (function () {
  655. this.checkOutdent = function (line, input) {
  656. if (!/^\s+$/.test(line))
  657. return false;
  658. return /^\s*\}/.test(input);
  659. };
  660. this.autoOutdent = function (doc, row) {
  661. var line = doc.getLine(row);
  662. var match = line.match(/^(\s*\})/);
  663. if (!match)
  664. return 0;
  665. var column = match[1].length;
  666. var openBracePos = doc.findMatchingBracket({ row: row, column: column });
  667. if (!openBracePos || openBracePos.row == row)
  668. return 0;
  669. var indent = this.$getIndent(doc.getLine(openBracePos.row));
  670. doc.replace(new Range(row, 0, row, column - 1), indent);
  671. };
  672. this.$getIndent = function (line) {
  673. return line.match(/^\s*/)[0];
  674. };
  675. }).call(MatchingBraceOutdent.prototype);
  676. exports.MatchingBraceOutdent = MatchingBraceOutdent;
  677. });
  678. ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
  679. var oop = require("../../lib/oop");
  680. var Behaviour = require("../behaviour").Behaviour;
  681. var TokenIterator = require("../../token_iterator").TokenIterator;
  682. function is(token, type) {
  683. return token && token.type.lastIndexOf(type + ".xml") > -1;
  684. }
  685. var XmlBehaviour = function () {
  686. this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
  687. if (text == '"' || text == "'") {
  688. var quote = text;
  689. var selected = session.doc.getTextRange(editor.getSelectionRange());
  690. if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
  691. return {
  692. text: quote + selected + quote,
  693. selection: false
  694. };
  695. }
  696. var cursor = editor.getCursorPosition();
  697. var line = session.doc.getLine(cursor.row);
  698. var rightChar = line.substring(cursor.column, cursor.column + 1);
  699. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  700. var token = iterator.getCurrentToken();
  701. if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
  702. return {
  703. text: "",
  704. selection: [1, 1]
  705. };
  706. }
  707. if (!token)
  708. token = iterator.stepBackward();
  709. if (!token)
  710. return;
  711. while (is(token, "tag-whitespace") || is(token, "whitespace")) {
  712. token = iterator.stepBackward();
  713. }
  714. var rightSpace = !rightChar || rightChar.match(/\s/);
  715. if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
  716. return {
  717. text: quote + quote,
  718. selection: [1, 1]
  719. };
  720. }
  721. }
  722. });
  723. this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
  724. var selected = session.doc.getTextRange(range);
  725. if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
  726. var line = session.doc.getLine(range.start.row);
  727. var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
  728. if (rightChar == selected) {
  729. range.end.column++;
  730. return range;
  731. }
  732. }
  733. });
  734. this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
  735. if (text == '>') {
  736. var position = editor.getSelectionRange().start;
  737. var iterator = new TokenIterator(session, position.row, position.column);
  738. var token = iterator.getCurrentToken() || iterator.stepBackward();
  739. if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
  740. return;
  741. if (is(token, "reference.attribute-value"))
  742. return;
  743. if (is(token, "attribute-value")) {
  744. var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
  745. if (position.column < tokenEndColumn)
  746. return;
  747. if (position.column == tokenEndColumn) {
  748. var nextToken = iterator.stepForward();
  749. if (nextToken && is(nextToken, "attribute-value"))
  750. return;
  751. iterator.stepBackward();
  752. }
  753. }
  754. if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
  755. return;
  756. while (!is(token, "tag-name")) {
  757. token = iterator.stepBackward();
  758. if (token.value == "<") {
  759. token = iterator.stepForward();
  760. break;
  761. }
  762. }
  763. var tokenRow = iterator.getCurrentTokenRow();
  764. var tokenColumn = iterator.getCurrentTokenColumn();
  765. if (is(iterator.stepBackward(), "end-tag-open"))
  766. return;
  767. var element = token.value;
  768. if (tokenRow == position.row)
  769. element = element.substring(0, position.column - tokenColumn);
  770. if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
  771. return;
  772. return {
  773. text: ">" + "</" + element + ">",
  774. selection: [1, 1]
  775. };
  776. }
  777. });
  778. this.add("autoindent", "insertion", function (state, action, editor, session, text) {
  779. if (text == "\n") {
  780. var cursor = editor.getCursorPosition();
  781. var line = session.getLine(cursor.row);
  782. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  783. var token = iterator.getCurrentToken();
  784. if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
  785. if (token.value == "/>")
  786. return;
  787. while (token && token.type.indexOf("tag-name") === -1) {
  788. token = iterator.stepBackward();
  789. }
  790. if (!token) {
  791. return;
  792. }
  793. var tag = token.value;
  794. var row = iterator.getCurrentTokenRow();
  795. token = iterator.stepBackward();
  796. if (!token || token.type.indexOf("end-tag") !== -1) {
  797. return;
  798. }
  799. if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
  800. var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
  801. var line = session.getLine(row);
  802. var nextIndent = this.$getIndent(line);
  803. var indent = nextIndent + session.getTabString();
  804. if (nextToken && nextToken.value === "</") {
  805. return {
  806. text: "\n" + indent + "\n" + nextIndent,
  807. selection: [1, indent.length, 1, indent.length]
  808. };
  809. }
  810. else {
  811. return {
  812. text: "\n" + indent
  813. };
  814. }
  815. }
  816. }
  817. }
  818. });
  819. };
  820. oop.inherits(XmlBehaviour, Behaviour);
  821. exports.XmlBehaviour = XmlBehaviour;
  822. });
  823. ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
  824. var oop = require("../../lib/oop");
  825. var TokenIterator = require("../../token_iterator").TokenIterator;
  826. var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
  827. var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
  828. var JavaScriptBehaviour = function () {
  829. var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
  830. this.addBehaviours(xmlBehaviours);
  831. this.inherit(CstyleBehaviour);
  832. this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
  833. if (text == '>') {
  834. var position = editor.getSelectionRange().start;
  835. var iterator = new TokenIterator(session, position.row, position.column);
  836. var token = iterator.getCurrentToken() || iterator.stepBackward();
  837. if (!token)
  838. return;
  839. if (token.value == '<') {
  840. return {
  841. text: "></>",
  842. selection: [1, 1]
  843. };
  844. }
  845. }
  846. });
  847. };
  848. oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
  849. exports.JavaScriptBehaviour = JavaScriptBehaviour;
  850. });
  851. ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
  852. var oop = require("../../lib/oop");
  853. var Range = require("../../range").Range;
  854. var BaseFoldMode = require("./fold_mode").FoldMode;
  855. var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
  856. BaseFoldMode.call(this);
  857. this.voidElements = voidElements || {};
  858. this.optionalEndTags = oop.mixin({}, this.voidElements);
  859. if (optionalEndTags)
  860. oop.mixin(this.optionalEndTags, optionalEndTags);
  861. };
  862. oop.inherits(FoldMode, BaseFoldMode);
  863. var Tag = function () {
  864. this.tagName = "";
  865. this.closing = false;
  866. this.selfClosing = false;
  867. this.start = { row: 0, column: 0 };
  868. this.end = { row: 0, column: 0 };
  869. };
  870. function is(token, type) {
  871. return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
  872. }
  873. (function () {
  874. this.getFoldWidget = function (session, foldStyle, row) {
  875. var tag = this._getFirstTagInLine(session, row);
  876. if (!tag)
  877. return this.getCommentFoldWidget(session, row);
  878. if (tag.closing || (!tag.tagName && tag.selfClosing))
  879. return foldStyle === "markbeginend" ? "end" : "";
  880. if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
  881. return "";
  882. if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
  883. return "";
  884. return "start";
  885. };
  886. this.getCommentFoldWidget = function (session, row) {
  887. if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
  888. return "start";
  889. return "";
  890. };
  891. this._getFirstTagInLine = function (session, row) {
  892. var tokens = session.getTokens(row);
  893. var tag = new Tag();
  894. for (var i = 0; i < tokens.length; i++) {
  895. var token = tokens[i];
  896. if (is(token, "tag-open")) {
  897. tag.end.column = tag.start.column + token.value.length;
  898. tag.closing = is(token, "end-tag-open");
  899. token = tokens[++i];
  900. if (!token)
  901. return null;
  902. tag.tagName = token.value;
  903. if (token.value === "") { //skip empty tag name token for fragment
  904. token = tokens[++i];
  905. if (!token)
  906. return null;
  907. tag.tagName = token.value;
  908. }
  909. tag.end.column += token.value.length;
  910. for (i++; i < tokens.length; i++) {
  911. token = tokens[i];
  912. tag.end.column += token.value.length;
  913. if (is(token, "tag-close")) {
  914. tag.selfClosing = token.value == '/>';
  915. break;
  916. }
  917. }
  918. return tag;
  919. }
  920. else if (is(token, "tag-close")) {
  921. tag.selfClosing = token.value == '/>';
  922. return tag;
  923. }
  924. tag.start.column += token.value.length;
  925. }
  926. return null;
  927. };
  928. this._findEndTagInLine = function (session, row, tagName, startColumn) {
  929. var tokens = session.getTokens(row);
  930. var column = 0;
  931. for (var i = 0; i < tokens.length; i++) {
  932. var token = tokens[i];
  933. column += token.value.length;
  934. if (column < startColumn - 1)
  935. continue;
  936. if (is(token, "end-tag-open")) {
  937. token = tokens[i + 1];
  938. if (is(token, "tag-name") && token.value === "") {
  939. token = tokens[i + 2];
  940. }
  941. if (token && token.value == tagName)
  942. return true;
  943. }
  944. }
  945. return false;
  946. };
  947. this.getFoldWidgetRange = function (session, foldStyle, row) {
  948. var firstTag = this._getFirstTagInLine(session, row);
  949. if (!firstTag) {
  950. return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
  951. }
  952. var tags = session.getMatchingTags({ row: row, column: 0 });
  953. if (tags) {
  954. return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
  955. }
  956. };
  957. }).call(FoldMode.prototype);
  958. });
  959. ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
  960. var oop = require("../../lib/oop");
  961. var Range = require("../../range").Range;
  962. var BaseFoldMode = require("./fold_mode").FoldMode;
  963. var FoldMode = exports.FoldMode = function (commentRegex) {
  964. if (commentRegex) {
  965. this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
  966. this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
  967. }
  968. };
  969. oop.inherits(FoldMode, BaseFoldMode);
  970. (function () {
  971. this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
  972. this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
  973. this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
  974. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  975. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  976. this._getFoldWidgetBase = this.getFoldWidget;
  977. this.getFoldWidget = function (session, foldStyle, row) {
  978. var line = session.getLine(row);
  979. if (this.singleLineBlockCommentRe.test(line)) {
  980. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  981. return "";
  982. }
  983. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  984. if (!fw && this.startRegionRe.test(line))
  985. return "start"; // lineCommentRegionStart
  986. return fw;
  987. };
  988. this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
  989. var line = session.getLine(row);
  990. if (this.startRegionRe.test(line))
  991. return this.getCommentRegionBlock(session, line, row);
  992. var match = line.match(this.foldingStartMarker);
  993. if (match) {
  994. var i = match.index;
  995. if (match[1])
  996. return this.openingBracketBlock(session, match[1], row, i);
  997. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  998. if (range && !range.isMultiLine()) {
  999. if (forceMultiline) {
  1000. range = this.getSectionRange(session, row);
  1001. }
  1002. else if (foldStyle != "all")
  1003. range = null;
  1004. }
  1005. return range;
  1006. }
  1007. if (foldStyle === "markbegin")
  1008. return;
  1009. var match = line.match(this.foldingStopMarker);
  1010. if (match) {
  1011. var i = match.index + match[0].length;
  1012. if (match[1])
  1013. return this.closingBracketBlock(session, match[1], row, i);
  1014. return session.getCommentFoldRange(row, i, -1);
  1015. }
  1016. };
  1017. this.getSectionRange = function (session, row) {
  1018. var line = session.getLine(row);
  1019. var startIndent = line.search(/\S/);
  1020. var startRow = row;
  1021. var startColumn = line.length;
  1022. row = row + 1;
  1023. var endRow = row;
  1024. var maxRow = session.getLength();
  1025. while (++row < maxRow) {
  1026. line = session.getLine(row);
  1027. var indent = line.search(/\S/);
  1028. if (indent === -1)
  1029. continue;
  1030. if (startIndent > indent)
  1031. break;
  1032. var subRange = this.getFoldWidgetRange(session, "all", row);
  1033. if (subRange) {
  1034. if (subRange.start.row <= startRow) {
  1035. break;
  1036. }
  1037. else if (subRange.isMultiLine()) {
  1038. row = subRange.end.row;
  1039. }
  1040. else if (startIndent == indent) {
  1041. break;
  1042. }
  1043. }
  1044. endRow = row;
  1045. }
  1046. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  1047. };
  1048. this.getCommentRegionBlock = function (session, line, row) {
  1049. var startColumn = line.search(/\s*$/);
  1050. var maxRow = session.getLength();
  1051. var startRow = row;
  1052. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  1053. var depth = 1;
  1054. while (++row < maxRow) {
  1055. line = session.getLine(row);
  1056. var m = re.exec(line);
  1057. if (!m)
  1058. continue;
  1059. if (m[1])
  1060. depth--;
  1061. else
  1062. depth++;
  1063. if (!depth)
  1064. break;
  1065. }
  1066. var endRow = row;
  1067. if (endRow > startRow) {
  1068. return new Range(startRow, startColumn, endRow, line.length);
  1069. }
  1070. };
  1071. }).call(FoldMode.prototype);
  1072. });
  1073. ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
  1074. var oop = require("../../lib/oop");
  1075. var XmlFoldMode = require("./xml").FoldMode;
  1076. var CFoldMode = require("./cstyle").FoldMode;
  1077. var FoldMode = exports.FoldMode = function (commentRegex) {
  1078. if (commentRegex) {
  1079. this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
  1080. this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
  1081. }
  1082. this.xmlFoldMode = new XmlFoldMode();
  1083. };
  1084. oop.inherits(FoldMode, CFoldMode);
  1085. (function () {
  1086. this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
  1087. this.getFoldWidgetBase = this.getFoldWidget;
  1088. this.getFoldWidget = function (session, foldStyle, row) {
  1089. var fw = this.getFoldWidgetBase(session, foldStyle, row);
  1090. if (!fw) {
  1091. return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
  1092. }
  1093. return fw;
  1094. };
  1095. this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
  1096. var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
  1097. if (range)
  1098. return range;
  1099. return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
  1100. };
  1101. }).call(FoldMode.prototype);
  1102. });
  1103. ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
  1104. var oop = require("../lib/oop");
  1105. var TextMode = require("./text").Mode;
  1106. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  1107. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  1108. var WorkerClient = require("../worker/worker_client").WorkerClient;
  1109. var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
  1110. var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
  1111. var Mode = function () {
  1112. this.HighlightRules = JavaScriptHighlightRules;
  1113. this.$outdent = new MatchingBraceOutdent();
  1114. this.$behaviour = new JavaScriptBehaviour();
  1115. this.foldingRules = new JavaScriptFoldMode();
  1116. };
  1117. oop.inherits(Mode, TextMode);
  1118. (function () {
  1119. this.lineCommentStart = "//";
  1120. this.blockComment = { start: "/*", end: "*/" };
  1121. this.$quotes = { '"': '"', "'": "'", "`": "`" };
  1122. this.$pairQuotesAfter = {
  1123. "`": /\w/
  1124. };
  1125. this.getNextLineIndent = function (state, line, tab) {
  1126. var indent = this.$getIndent(line);
  1127. var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
  1128. var tokens = tokenizedLine.tokens;
  1129. var endState = tokenizedLine.state;
  1130. if (tokens.length && tokens[tokens.length - 1].type == "comment") {
  1131. return indent;
  1132. }
  1133. if (state == "start" || state == "no_regex") {
  1134. var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
  1135. if (match) {
  1136. indent += tab;
  1137. }
  1138. }
  1139. else if (state == "doc-start") {
  1140. if (endState == "start" || endState == "no_regex") {
  1141. return "";
  1142. }
  1143. }
  1144. return indent;
  1145. };
  1146. this.checkOutdent = function (state, line, input) {
  1147. return this.$outdent.checkOutdent(line, input);
  1148. };
  1149. this.autoOutdent = function (state, doc, row) {
  1150. this.$outdent.autoOutdent(doc, row);
  1151. };
  1152. this.createWorker = function (session) {
  1153. var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
  1154. worker.attachToDocument(session.getDocument());
  1155. worker.on("annotate", function (results) {
  1156. session.setAnnotations(results.data);
  1157. });
  1158. worker.on("terminate", function () {
  1159. session.clearAnnotations();
  1160. });
  1161. return worker;
  1162. };
  1163. this.$id = "ace/mode/javascript";
  1164. this.snippetFileId = "ace/snippets/javascript";
  1165. }).call(Mode.prototype);
  1166. exports.Mode = Mode;
  1167. });
  1168. ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  1169. var oop = require("../lib/oop");
  1170. var lang = require("../lib/lang");
  1171. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  1172. var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
  1173. var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
  1174. var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|flex-end|flex-start|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom";
  1175. var supportConstantColor = exports.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen";
  1176. var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
  1177. var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
  1178. var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
  1179. var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
  1180. var CssHighlightRules = function () {
  1181. var keywordMapper = this.createKeywordMapper({
  1182. "support.function": supportFunction,
  1183. "support.constant": supportConstant,
  1184. "support.type": supportType,
  1185. "support.constant.color": supportConstantColor,
  1186. "support.constant.fonts": supportConstantFonts
  1187. }, "text", true);
  1188. this.$rules = {
  1189. "start": [{
  1190. include: ["strings", "url", "comments"]
  1191. }, {
  1192. token: "paren.lparen",
  1193. regex: "\\{",
  1194. next: "ruleset"
  1195. }, {
  1196. token: "paren.rparen",
  1197. regex: "\\}"
  1198. }, {
  1199. token: "string",
  1200. regex: "@(?!viewport)",
  1201. next: "media"
  1202. }, {
  1203. token: "keyword",
  1204. regex: "#[a-z0-9-_]+"
  1205. }, {
  1206. token: "keyword",
  1207. regex: "%"
  1208. }, {
  1209. token: "variable",
  1210. regex: "\\.[a-z0-9-_]+"
  1211. }, {
  1212. token: "string",
  1213. regex: ":[a-z0-9-_]+"
  1214. }, {
  1215. token: "constant.numeric",
  1216. regex: numRe
  1217. }, {
  1218. token: "constant",
  1219. regex: "[a-z0-9-_]+"
  1220. }, {
  1221. caseInsensitive: true
  1222. }],
  1223. "media": [{
  1224. include: ["strings", "url", "comments"]
  1225. }, {
  1226. token: "paren.lparen",
  1227. regex: "\\{",
  1228. next: "start"
  1229. }, {
  1230. token: "paren.rparen",
  1231. regex: "\\}",
  1232. next: "start"
  1233. }, {
  1234. token: "string",
  1235. regex: ";",
  1236. next: "start"
  1237. }, {
  1238. token: "keyword",
  1239. regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
  1240. + "|page|font|keyframes|viewport|counter-style|font-feature-values"
  1241. + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
  1242. }],
  1243. "comments": [{
  1244. token: "comment", // multi line comment
  1245. regex: "\\/\\*",
  1246. push: [{
  1247. token: "comment",
  1248. regex: "\\*\\/",
  1249. next: "pop"
  1250. }, {
  1251. defaultToken: "comment"
  1252. }]
  1253. }],
  1254. "ruleset": [{
  1255. regex: "-(webkit|ms|moz|o)-",
  1256. token: "text"
  1257. }, {
  1258. token: "punctuation.operator",
  1259. regex: "[:;]"
  1260. }, {
  1261. token: "paren.rparen",
  1262. regex: "\\}",
  1263. next: "start"
  1264. }, {
  1265. include: ["strings", "url", "comments"]
  1266. }, {
  1267. token: ["constant.numeric", "keyword"],
  1268. regex: "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
  1269. }, {
  1270. token: "constant.numeric",
  1271. regex: numRe
  1272. }, {
  1273. token: "constant.numeric", // hex6 color
  1274. regex: "#[a-f0-9]{6}"
  1275. }, {
  1276. token: "constant.numeric", // hex3 color
  1277. regex: "#[a-f0-9]{3}"
  1278. }, {
  1279. token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
  1280. regex: pseudoElements
  1281. }, {
  1282. token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
  1283. regex: pseudoClasses
  1284. }, {
  1285. include: "url"
  1286. }, {
  1287. token: keywordMapper,
  1288. regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
  1289. }, {
  1290. token: "paren.lparen",
  1291. regex: "\\{"
  1292. }, {
  1293. caseInsensitive: true
  1294. }],
  1295. url: [{
  1296. token: "support.function",
  1297. regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
  1298. push: [{
  1299. token: "support.function",
  1300. regex: "\\)",
  1301. next: "pop"
  1302. }, {
  1303. defaultToken: "string"
  1304. }]
  1305. }],
  1306. strings: [{
  1307. token: "string.start",
  1308. regex: "'",
  1309. push: [{
  1310. token: "string.end",
  1311. regex: "'|$",
  1312. next: "pop"
  1313. }, {
  1314. include: "escapes"
  1315. }, {
  1316. token: "constant.language.escape",
  1317. regex: /\\$/,
  1318. consumeLineEnd: true
  1319. }, {
  1320. defaultToken: "string"
  1321. }]
  1322. }, {
  1323. token: "string.start",
  1324. regex: '"',
  1325. push: [{
  1326. token: "string.end",
  1327. regex: '"|$',
  1328. next: "pop"
  1329. }, {
  1330. include: "escapes"
  1331. }, {
  1332. token: "constant.language.escape",
  1333. regex: /\\$/,
  1334. consumeLineEnd: true
  1335. }, {
  1336. defaultToken: "string"
  1337. }]
  1338. }],
  1339. escapes: [{
  1340. token: "constant.language.escape",
  1341. regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
  1342. }]
  1343. };
  1344. this.normalizeRules();
  1345. };
  1346. oop.inherits(CssHighlightRules, TextHighlightRules);
  1347. exports.CssHighlightRules = CssHighlightRules;
  1348. });
  1349. ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
  1350. var propertyMap = {
  1351. "background": { "#$0": 1 },
  1352. "background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
  1353. "background-image": { "url('/$0')": 1 },
  1354. "background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
  1355. "background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
  1356. "background-attachment": { "scroll": 1, "fixed": 1 },
  1357. "background-size": { "cover": 1, "contain": 1 },
  1358. "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
  1359. "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
  1360. "border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
  1361. "border-color": { "#$0": 1 },
  1362. "border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
  1363. "border-collapse": { "collapse": 1, "separate": 1 },
  1364. "bottom": { "px": 1, "em": 1, "%": 1 },
  1365. "clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
  1366. "color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
  1367. "cursor": { "default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1 },
  1368. "display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
  1369. "empty-cells": { "show": 1, "hide": 1 },
  1370. "float": { "left": 1, "right": 1, "none": 1 },
  1371. "font-family": { "Arial": 2, "Comic Sans MS": 2, "Consolas": 2, "Courier New": 2, "Courier": 2, "Georgia": 2, "Monospace": 2, "Sans-Serif": 2, "Segoe UI": 2, "Tahoma": 2, "Times New Roman": 2, "Trebuchet MS": 2, "Verdana": 1 },
  1372. "font-size": { "px": 1, "em": 1, "%": 1 },
  1373. "font-weight": { "bold": 1, "normal": 1 },
  1374. "font-style": { "italic": 1, "normal": 1 },
  1375. "font-variant": { "normal": 1, "small-caps": 1 },
  1376. "height": { "px": 1, "em": 1, "%": 1 },
  1377. "left": { "px": 1, "em": 1, "%": 1 },
  1378. "letter-spacing": { "normal": 1 },
  1379. "line-height": { "normal": 1 },
  1380. "list-style-type": { "none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1 },
  1381. "margin": { "px": 1, "em": 1, "%": 1 },
  1382. "margin-right": { "px": 1, "em": 1, "%": 1 },
  1383. "margin-left": { "px": 1, "em": 1, "%": 1 },
  1384. "margin-top": { "px": 1, "em": 1, "%": 1 },
  1385. "margin-bottom": { "px": 1, "em": 1, "%": 1 },
  1386. "max-height": { "px": 1, "em": 1, "%": 1 },
  1387. "max-width": { "px": 1, "em": 1, "%": 1 },
  1388. "min-height": { "px": 1, "em": 1, "%": 1 },
  1389. "min-width": { "px": 1, "em": 1, "%": 1 },
  1390. "overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
  1391. "overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
  1392. "overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
  1393. "padding": { "px": 1, "em": 1, "%": 1 },
  1394. "padding-top": { "px": 1, "em": 1, "%": 1 },
  1395. "padding-right": { "px": 1, "em": 1, "%": 1 },
  1396. "padding-bottom": { "px": 1, "em": 1, "%": 1 },
  1397. "padding-left": { "px": 1, "em": 1, "%": 1 },
  1398. "page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
  1399. "page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
  1400. "position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
  1401. "right": { "px": 1, "em": 1, "%": 1 },
  1402. "table-layout": { "fixed": 1, "auto": 1 },
  1403. "text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
  1404. "text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
  1405. "text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
  1406. "top": { "px": 1, "em": 1, "%": 1 },
  1407. "vertical-align": { "top": 1, "bottom": 1 },
  1408. "visibility": { "hidden": 1, "visible": 1 },
  1409. "white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
  1410. "width": { "px": 1, "em": 1, "%": 1 },
  1411. "word-spacing": { "normal": 1 },
  1412. "filter": { "alpha(opacity=$0100)": 1 },
  1413. "text-shadow": { "$02px 2px 2px #777": 1 },
  1414. "text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
  1415. "-moz-border-radius": 1,
  1416. "-moz-border-radius-topright": 1,
  1417. "-moz-border-radius-bottomright": 1,
  1418. "-moz-border-radius-topleft": 1,
  1419. "-moz-border-radius-bottomleft": 1,
  1420. "-webkit-border-radius": 1,
  1421. "-webkit-border-top-right-radius": 1,
  1422. "-webkit-border-top-left-radius": 1,
  1423. "-webkit-border-bottom-right-radius": 1,
  1424. "-webkit-border-bottom-left-radius": 1,
  1425. "-moz-box-shadow": 1,
  1426. "-webkit-box-shadow": 1,
  1427. "transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
  1428. "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
  1429. "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
  1430. };
  1431. var CssCompletions = function () {
  1432. };
  1433. (function () {
  1434. this.completionsDefined = false;
  1435. this.defineCompletions = function () {
  1436. if (document) {
  1437. var style = document.createElement('c').style;
  1438. for (var i in style) {
  1439. if (typeof style[i] !== 'string')
  1440. continue;
  1441. var name = i.replace(/[A-Z]/g, function (x) {
  1442. return '-' + x.toLowerCase();
  1443. });
  1444. if (!propertyMap.hasOwnProperty(name))
  1445. propertyMap[name] = 1;
  1446. }
  1447. }
  1448. this.completionsDefined = true;
  1449. };
  1450. this.getCompletions = function (state, session, pos, prefix) {
  1451. if (!this.completionsDefined) {
  1452. this.defineCompletions();
  1453. }
  1454. if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
  1455. var line = session.getLine(pos.row).substr(0, pos.column);
  1456. var inParens = /\([^)]*$/.test(line);
  1457. if (inParens) {
  1458. line = line.substr(line.lastIndexOf('(') + 1);
  1459. }
  1460. if (/:[^;]+$/.test(line)) {
  1461. /([\w\-]+):[^:]*$/.test(line);
  1462. return this.getPropertyValueCompletions(state, session, pos, prefix);
  1463. }
  1464. else {
  1465. return this.getPropertyCompletions(state, session, pos, prefix, inParens);
  1466. }
  1467. }
  1468. return [];
  1469. };
  1470. this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
  1471. skipSemicolon = skipSemicolon || false;
  1472. var properties = Object.keys(propertyMap);
  1473. return properties.map(function (property) {
  1474. return {
  1475. caption: property,
  1476. snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
  1477. meta: "property",
  1478. score: 1000000
  1479. };
  1480. });
  1481. };
  1482. this.getPropertyValueCompletions = function (state, session, pos, prefix) {
  1483. var line = session.getLine(pos.row).substr(0, pos.column);
  1484. var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
  1485. if (!property)
  1486. return [];
  1487. var values = [];
  1488. if (property in propertyMap && typeof propertyMap[property] === "object") {
  1489. values = Object.keys(propertyMap[property]);
  1490. }
  1491. return values.map(function (value) {
  1492. return {
  1493. caption: value,
  1494. snippet: value,
  1495. meta: "property value",
  1496. score: 1000000
  1497. };
  1498. });
  1499. };
  1500. }).call(CssCompletions.prototype);
  1501. exports.CssCompletions = CssCompletions;
  1502. });
  1503. ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module){"use strict";
  1504. var oop = require("../../lib/oop");
  1505. var Behaviour = require("../behaviour").Behaviour;
  1506. var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
  1507. var TokenIterator = require("../../token_iterator").TokenIterator;
  1508. var CssBehaviour = function () {
  1509. this.inherit(CstyleBehaviour);
  1510. this.add("colon", "insertion", function (state, action, editor, session, text) {
  1511. if (text === ':' && editor.selection.isEmpty()) {
  1512. var cursor = editor.getCursorPosition();
  1513. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1514. var token = iterator.getCurrentToken();
  1515. if (token && token.value.match(/\s+/)) {
  1516. token = iterator.stepBackward();
  1517. }
  1518. if (token && token.type === 'support.type') {
  1519. var line = session.doc.getLine(cursor.row);
  1520. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1521. if (rightChar === ':') {
  1522. return {
  1523. text: '',
  1524. selection: [1, 1]
  1525. };
  1526. }
  1527. if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
  1528. return {
  1529. text: ':;',
  1530. selection: [1, 1]
  1531. };
  1532. }
  1533. }
  1534. }
  1535. });
  1536. this.add("colon", "deletion", function (state, action, editor, session, range) {
  1537. var selected = session.doc.getTextRange(range);
  1538. if (!range.isMultiLine() && selected === ':') {
  1539. var cursor = editor.getCursorPosition();
  1540. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1541. var token = iterator.getCurrentToken();
  1542. if (token && token.value.match(/\s+/)) {
  1543. token = iterator.stepBackward();
  1544. }
  1545. if (token && token.type === 'support.type') {
  1546. var line = session.doc.getLine(range.start.row);
  1547. var rightChar = line.substring(range.end.column, range.end.column + 1);
  1548. if (rightChar === ';') {
  1549. range.end.column++;
  1550. return range;
  1551. }
  1552. }
  1553. }
  1554. });
  1555. this.add("semicolon", "insertion", function (state, action, editor, session, text) {
  1556. if (text === ';' && editor.selection.isEmpty()) {
  1557. var cursor = editor.getCursorPosition();
  1558. var line = session.doc.getLine(cursor.row);
  1559. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1560. if (rightChar === ';') {
  1561. return {
  1562. text: '',
  1563. selection: [1, 1]
  1564. };
  1565. }
  1566. }
  1567. });
  1568. this.add("!important", "insertion", function (state, action, editor, session, text) {
  1569. if (text === '!' && editor.selection.isEmpty()) {
  1570. var cursor = editor.getCursorPosition();
  1571. var line = session.doc.getLine(cursor.row);
  1572. if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
  1573. return {
  1574. text: '!important',
  1575. selection: [10, 10]
  1576. };
  1577. }
  1578. }
  1579. });
  1580. };
  1581. oop.inherits(CssBehaviour, CstyleBehaviour);
  1582. exports.CssBehaviour = CssBehaviour;
  1583. });
  1584. ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
  1585. var oop = require("../lib/oop");
  1586. var TextMode = require("./text").Mode;
  1587. var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
  1588. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  1589. var WorkerClient = require("../worker/worker_client").WorkerClient;
  1590. var CssCompletions = require("./css_completions").CssCompletions;
  1591. var CssBehaviour = require("./behaviour/css").CssBehaviour;
  1592. var CStyleFoldMode = require("./folding/cstyle").FoldMode;
  1593. var Mode = function () {
  1594. this.HighlightRules = CssHighlightRules;
  1595. this.$outdent = new MatchingBraceOutdent();
  1596. this.$behaviour = new CssBehaviour();
  1597. this.$completer = new CssCompletions();
  1598. this.foldingRules = new CStyleFoldMode();
  1599. };
  1600. oop.inherits(Mode, TextMode);
  1601. (function () {
  1602. this.foldingRules = "cStyle";
  1603. this.blockComment = { start: "/*", end: "*/" };
  1604. this.getNextLineIndent = function (state, line, tab) {
  1605. var indent = this.$getIndent(line);
  1606. var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
  1607. if (tokens.length && tokens[tokens.length - 1].type == "comment") {
  1608. return indent;
  1609. }
  1610. var match = line.match(/^.*\{\s*$/);
  1611. if (match) {
  1612. indent += tab;
  1613. }
  1614. return indent;
  1615. };
  1616. this.checkOutdent = function (state, line, input) {
  1617. return this.$outdent.checkOutdent(line, input);
  1618. };
  1619. this.autoOutdent = function (state, doc, row) {
  1620. this.$outdent.autoOutdent(doc, row);
  1621. };
  1622. this.getCompletions = function (state, session, pos, prefix) {
  1623. return this.$completer.getCompletions(state, session, pos, prefix);
  1624. };
  1625. this.createWorker = function (session) {
  1626. var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
  1627. worker.attachToDocument(session.getDocument());
  1628. worker.on("annotate", function (e) {
  1629. session.setAnnotations(e.data);
  1630. });
  1631. worker.on("terminate", function () {
  1632. session.clearAnnotations();
  1633. });
  1634. return worker;
  1635. };
  1636. this.$id = "ace/mode/css";
  1637. this.snippetFileId = "ace/snippets/css";
  1638. }).call(Mode.prototype);
  1639. exports.Mode = Mode;
  1640. });
  1641. ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  1642. var oop = require("../lib/oop");
  1643. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  1644. var XmlHighlightRules = function (normalize) {
  1645. var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
  1646. this.$rules = {
  1647. start: [
  1648. { token: "string.cdata.xml", regex: "<\\!\\[CDATA\\[", next: "cdata" },
  1649. {
  1650. token: ["punctuation.instruction.xml", "keyword.instruction.xml"],
  1651. regex: "(<\\?)(" + tagRegex + ")", next: "processing_instruction"
  1652. },
  1653. { token: "comment.start.xml", regex: "<\\!--", next: "comment" },
  1654. {
  1655. token: ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
  1656. regex: "(<\\!)(DOCTYPE)(?=[\\s])", next: "doctype", caseInsensitive: true
  1657. },
  1658. { include: "tag" },
  1659. { token: "text.end-tag-open.xml", regex: "</" },
  1660. { token: "text.tag-open.xml", regex: "<" },
  1661. { include: "reference" },
  1662. { defaultToken: "text.xml" }
  1663. ],
  1664. processing_instruction: [{
  1665. token: "entity.other.attribute-name.decl-attribute-name.xml",
  1666. regex: tagRegex
  1667. }, {
  1668. token: "keyword.operator.decl-attribute-equals.xml",
  1669. regex: "="
  1670. }, {
  1671. include: "whitespace"
  1672. }, {
  1673. include: "string"
  1674. }, {
  1675. token: "punctuation.xml-decl.xml",
  1676. regex: "\\?>",
  1677. next: "start"
  1678. }],
  1679. doctype: [
  1680. { include: "whitespace" },
  1681. { include: "string" },
  1682. { token: "xml-pe.doctype.xml", regex: ">", next: "start" },
  1683. { token: "xml-pe.xml", regex: "[-_a-zA-Z0-9:]+" },
  1684. { token: "punctuation.int-subset", regex: "\\[", push: "int_subset" }
  1685. ],
  1686. int_subset: [{
  1687. token: "text.xml",
  1688. regex: "\\s+"
  1689. }, {
  1690. token: "punctuation.int-subset.xml",
  1691. regex: "]",
  1692. next: "pop"
  1693. }, {
  1694. token: ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
  1695. regex: "(<\\!)(" + tagRegex + ")",
  1696. push: [{
  1697. token: "text",
  1698. regex: "\\s+"
  1699. },
  1700. {
  1701. token: "punctuation.markup-decl.xml",
  1702. regex: ">",
  1703. next: "pop"
  1704. },
  1705. { include: "string" }]
  1706. }],
  1707. cdata: [
  1708. { token: "string.cdata.xml", regex: "\\]\\]>", next: "start" },
  1709. { token: "text.xml", regex: "\\s+" },
  1710. { token: "text.xml", regex: "(?:[^\\]]|\\](?!\\]>))+" }
  1711. ],
  1712. comment: [
  1713. { token: "comment.end.xml", regex: "-->", next: "start" },
  1714. { defaultToken: "comment.xml" }
  1715. ],
  1716. reference: [{
  1717. token: "constant.language.escape.reference.xml",
  1718. regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  1719. }],
  1720. attr_reference: [{
  1721. token: "constant.language.escape.reference.attribute-value.xml",
  1722. regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  1723. }],
  1724. tag: [{
  1725. token: ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
  1726. regex: "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
  1727. next: [
  1728. { include: "attributes" },
  1729. { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
  1730. ]
  1731. }],
  1732. tag_whitespace: [
  1733. { token: "text.tag-whitespace.xml", regex: "\\s+" }
  1734. ],
  1735. whitespace: [
  1736. { token: "text.whitespace.xml", regex: "\\s+" }
  1737. ],
  1738. string: [{
  1739. token: "string.xml",
  1740. regex: "'",
  1741. push: [
  1742. { token: "string.xml", regex: "'", next: "pop" },
  1743. { defaultToken: "string.xml" }
  1744. ]
  1745. }, {
  1746. token: "string.xml",
  1747. regex: '"',
  1748. push: [
  1749. { token: "string.xml", regex: '"', next: "pop" },
  1750. { defaultToken: "string.xml" }
  1751. ]
  1752. }],
  1753. attributes: [{
  1754. token: "entity.other.attribute-name.xml",
  1755. regex: tagRegex
  1756. }, {
  1757. token: "keyword.operator.attribute-equals.xml",
  1758. regex: "="
  1759. }, {
  1760. include: "tag_whitespace"
  1761. }, {
  1762. include: "attribute_value"
  1763. }],
  1764. attribute_value: [{
  1765. token: "string.attribute-value.xml",
  1766. regex: "'",
  1767. push: [
  1768. { token: "string.attribute-value.xml", regex: "'", next: "pop" },
  1769. { include: "attr_reference" },
  1770. { defaultToken: "string.attribute-value.xml" }
  1771. ]
  1772. }, {
  1773. token: "string.attribute-value.xml",
  1774. regex: '"',
  1775. push: [
  1776. { token: "string.attribute-value.xml", regex: '"', next: "pop" },
  1777. { include: "attr_reference" },
  1778. { defaultToken: "string.attribute-value.xml" }
  1779. ]
  1780. }]
  1781. };
  1782. if (this.constructor === XmlHighlightRules)
  1783. this.normalizeRules();
  1784. };
  1785. (function () {
  1786. this.embedTagRules = function (HighlightRules, prefix, tag) {
  1787. this.$rules.tag.unshift({
  1788. token: ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  1789. regex: "(<)(" + tag + "(?=\\s|>|$))",
  1790. next: [
  1791. { include: "attributes" },
  1792. { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: prefix + "start" }
  1793. ]
  1794. });
  1795. this.$rules[tag + "-end"] = [
  1796. { include: "attributes" },
  1797. { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start",
  1798. onMatch: function (value, currentState, stack) {
  1799. stack.splice(0);
  1800. return this.token;
  1801. } }
  1802. ];
  1803. this.embedRules(HighlightRules, prefix, [{
  1804. token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  1805. regex: "(</)(" + tag + "(?=\\s|>|$))",
  1806. next: tag + "-end"
  1807. }, {
  1808. token: "string.cdata.xml",
  1809. regex: "<\\!\\[CDATA\\["
  1810. }, {
  1811. token: "string.cdata.xml",
  1812. regex: "\\]\\]>"
  1813. }]);
  1814. };
  1815. }).call(TextHighlightRules.prototype);
  1816. oop.inherits(XmlHighlightRules, TextHighlightRules);
  1817. exports.XmlHighlightRules = XmlHighlightRules;
  1818. });
  1819. ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module){"use strict";
  1820. var oop = require("../lib/oop");
  1821. var lang = require("../lib/lang");
  1822. var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
  1823. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  1824. var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
  1825. var tagMap = lang.createMap({
  1826. a: 'anchor',
  1827. button: 'form',
  1828. form: 'form',
  1829. img: 'image',
  1830. input: 'form',
  1831. label: 'form',
  1832. option: 'form',
  1833. script: 'script',
  1834. select: 'form',
  1835. textarea: 'form',
  1836. style: 'style',
  1837. table: 'table',
  1838. tbody: 'table',
  1839. td: 'table',
  1840. tfoot: 'table',
  1841. th: 'table',
  1842. tr: 'table'
  1843. });
  1844. var HtmlHighlightRules = function () {
  1845. XmlHighlightRules.call(this);
  1846. this.addRules({
  1847. attributes: [{
  1848. include: "tag_whitespace"
  1849. }, {
  1850. token: "entity.other.attribute-name.xml",
  1851. regex: "[-_a-zA-Z0-9:.]+"
  1852. }, {
  1853. token: "keyword.operator.attribute-equals.xml",
  1854. regex: "=",
  1855. push: [{
  1856. include: "tag_whitespace"
  1857. }, {
  1858. token: "string.unquoted.attribute-value.html",
  1859. regex: "[^<>='\"`\\s]+",
  1860. next: "pop"
  1861. }, {
  1862. token: "empty",
  1863. regex: "",
  1864. next: "pop"
  1865. }]
  1866. }, {
  1867. include: "attribute_value"
  1868. }],
  1869. tag: [{
  1870. token: function (start, tag) {
  1871. var group = tagMap[tag];
  1872. return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
  1873. "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
  1874. },
  1875. regex: "(</?)([-_a-zA-Z0-9:.]+)",
  1876. next: "tag_stuff"
  1877. }],
  1878. tag_stuff: [
  1879. { include: "attributes" },
  1880. { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
  1881. ]
  1882. });
  1883. this.embedTagRules(CssHighlightRules, "css-", "style");
  1884. this.embedTagRules(new JavaScriptHighlightRules({ jsx: false }).getRules(), "js-", "script");
  1885. if (this.constructor === HtmlHighlightRules)
  1886. this.normalizeRules();
  1887. };
  1888. oop.inherits(HtmlHighlightRules, XmlHighlightRules);
  1889. exports.HtmlHighlightRules = HtmlHighlightRules;
  1890. });
  1891. ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
  1892. var oop = require("../../lib/oop");
  1893. var BaseFoldMode = require("./fold_mode").FoldMode;
  1894. var FoldMode = exports.FoldMode = function (defaultMode, subModes) {
  1895. this.defaultMode = defaultMode;
  1896. this.subModes = subModes;
  1897. };
  1898. oop.inherits(FoldMode, BaseFoldMode);
  1899. (function () {
  1900. this.$getMode = function (state) {
  1901. if (typeof state != "string")
  1902. state = state[0];
  1903. for (var key in this.subModes) {
  1904. if (state.indexOf(key) === 0)
  1905. return this.subModes[key];
  1906. }
  1907. return null;
  1908. };
  1909. this.$tryMode = function (state, session, foldStyle, row) {
  1910. var mode = this.$getMode(state);
  1911. return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
  1912. };
  1913. this.getFoldWidget = function (session, foldStyle, row) {
  1914. return (this.$tryMode(session.getState(row - 1), session, foldStyle, row) ||
  1915. this.$tryMode(session.getState(row), session, foldStyle, row) ||
  1916. this.defaultMode.getFoldWidget(session, foldStyle, row));
  1917. };
  1918. this.getFoldWidgetRange = function (session, foldStyle, row) {
  1919. var mode = this.$getMode(session.getState(row - 1));
  1920. if (!mode || !mode.getFoldWidget(session, foldStyle, row))
  1921. mode = this.$getMode(session.getState(row));
  1922. if (!mode || !mode.getFoldWidget(session, foldStyle, row))
  1923. mode = this.defaultMode;
  1924. return mode.getFoldWidgetRange(session, foldStyle, row);
  1925. };
  1926. }).call(FoldMode.prototype);
  1927. });
  1928. ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
  1929. var oop = require("../../lib/oop");
  1930. var MixedFoldMode = require("./mixed").FoldMode;
  1931. var XmlFoldMode = require("./xml").FoldMode;
  1932. var CStyleFoldMode = require("./cstyle").FoldMode;
  1933. var FoldMode = exports.FoldMode = function (voidElements, optionalTags) {
  1934. MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
  1935. "js-": new CStyleFoldMode(),
  1936. "css-": new CStyleFoldMode()
  1937. });
  1938. };
  1939. oop.inherits(FoldMode, MixedFoldMode);
  1940. });
  1941. ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module){"use strict";
  1942. var TokenIterator = require("../token_iterator").TokenIterator;
  1943. var commonAttributes = [
  1944. "accesskey",
  1945. "class",
  1946. "contenteditable",
  1947. "contextmenu",
  1948. "dir",
  1949. "draggable",
  1950. "dropzone",
  1951. "hidden",
  1952. "id",
  1953. "inert",
  1954. "itemid",
  1955. "itemprop",
  1956. "itemref",
  1957. "itemscope",
  1958. "itemtype",
  1959. "lang",
  1960. "spellcheck",
  1961. "style",
  1962. "tabindex",
  1963. "title",
  1964. "translate"
  1965. ];
  1966. var eventAttributes = [
  1967. "onabort",
  1968. "onblur",
  1969. "oncancel",
  1970. "oncanplay",
  1971. "oncanplaythrough",
  1972. "onchange",
  1973. "onclick",
  1974. "onclose",
  1975. "oncontextmenu",
  1976. "oncuechange",
  1977. "ondblclick",
  1978. "ondrag",
  1979. "ondragend",
  1980. "ondragenter",
  1981. "ondragleave",
  1982. "ondragover",
  1983. "ondragstart",
  1984. "ondrop",
  1985. "ondurationchange",
  1986. "onemptied",
  1987. "onended",
  1988. "onerror",
  1989. "onfocus",
  1990. "oninput",
  1991. "oninvalid",
  1992. "onkeydown",
  1993. "onkeypress",
  1994. "onkeyup",
  1995. "onload",
  1996. "onloadeddata",
  1997. "onloadedmetadata",
  1998. "onloadstart",
  1999. "onmousedown",
  2000. "onmousemove",
  2001. "onmouseout",
  2002. "onmouseover",
  2003. "onmouseup",
  2004. "onmousewheel",
  2005. "onpause",
  2006. "onplay",
  2007. "onplaying",
  2008. "onprogress",
  2009. "onratechange",
  2010. "onreset",
  2011. "onscroll",
  2012. "onseeked",
  2013. "onseeking",
  2014. "onselect",
  2015. "onshow",
  2016. "onstalled",
  2017. "onsubmit",
  2018. "onsuspend",
  2019. "ontimeupdate",
  2020. "onvolumechange",
  2021. "onwaiting"
  2022. ];
  2023. var globalAttributes = commonAttributes.concat(eventAttributes);
  2024. var attributeMap = {
  2025. "a": { "href": 1, "target": { "_blank": 1, "top": 1 }, "ping": 1, "rel": { "nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1 }, "media": 1, "hreflang": 1, "type": 1 },
  2026. "abbr": {},
  2027. "address": {},
  2028. "area": { "shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1 },
  2029. "article": { "pubdate": 1 },
  2030. "aside": {},
  2031. "audio": { "src": 1, "autobuffer": 1, "autoplay": { "autoplay": 1 }, "loop": { "loop": 1 }, "controls": { "controls": 1 }, "muted": { "muted": 1 }, "preload": { "auto": 1, "metadata": 1, "none": 1 } },
  2032. "b": {},
  2033. "base": { "href": 1, "target": 1 },
  2034. "bdi": {},
  2035. "bdo": {},
  2036. "blockquote": { "cite": 1 },
  2037. "body": { "onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1 },
  2038. "br": {},
  2039. "button": { "autofocus": 1, "disabled": { "disabled": 1 }, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": { "button": 1, "submit": 1 } },
  2040. "canvas": { "width": 1, "height": 1 },
  2041. "caption": {},
  2042. "cite": {},
  2043. "code": {},
  2044. "col": { "span": 1 },
  2045. "colgroup": { "span": 1 },
  2046. "command": { "type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1 },
  2047. "data": {},
  2048. "datalist": {},
  2049. "dd": {},
  2050. "del": { "cite": 1, "datetime": 1 },
  2051. "details": { "open": 1 },
  2052. "dfn": {},
  2053. "dialog": { "open": 1 },
  2054. "div": {},
  2055. "dl": {},
  2056. "dt": {},
  2057. "em": {},
  2058. "embed": { "src": 1, "height": 1, "width": 1, "type": 1 },
  2059. "fieldset": { "disabled": 1, "form": 1, "name": 1 },
  2060. "figcaption": {},
  2061. "figure": {},
  2062. "footer": {},
  2063. "form": { "accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": { "multipart/form-data": 1, "application/x-www-form-urlencoded": 1 }, "method": { "get": 1, "post": 1 }, "name": 1, "novalidate": 1, "target": { "_blank": 1, "top": 1 } },
  2064. "h1": {},
  2065. "h2": {},
  2066. "h3": {},
  2067. "h4": {},
  2068. "h5": {},
  2069. "h6": {},
  2070. "head": {},
  2071. "header": {},
  2072. "hr": {},
  2073. "html": { "manifest": 1 },
  2074. "i": {},
  2075. "iframe": { "name": 1, "src": 1, "height": 1, "width": 1, "sandbox": { "allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1 }, "seamless": { "seamless": 1 } },
  2076. "img": { "alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1 },
  2077. "input": {
  2078. "type": { "text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1 },
  2079. "accept": 1, "alt": 1, "autocomplete": { "on": 1, "off": 1 }, "autofocus": { "autofocus": 1 }, "checked": { "checked": 1 }, "disabled": { "disabled": 1 }, "form": 1, "formaction": 1, "formenctype": { "application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1 }, "formmethod": { "get": 1, "post": 1 }, "formnovalidate": { "formnovalidate": 1 }, "formtarget": { "_blank": 1, "_self": 1, "_parent": 1, "_top": 1 }, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": { "multiple": 1 }, "name": 1, "pattern": 1, "placeholder": 1, "readonly": { "readonly": 1 }, "required": { "required": 1 }, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1
  2080. },
  2081. "ins": { "cite": 1, "datetime": 1 },
  2082. "kbd": {},
  2083. "keygen": { "autofocus": 1, "challenge": { "challenge": 1 }, "disabled": { "disabled": 1 }, "form": 1, "keytype": { "rsa": 1, "dsa": 1, "ec": 1 }, "name": 1 },
  2084. "label": { "form": 1, "for": 1 },
  2085. "legend": {},
  2086. "li": { "value": 1 },
  2087. "link": { "href": 1, "hreflang": 1, "rel": { "stylesheet": 1, "icon": 1 }, "media": { "all": 1, "screen": 1, "print": 1 }, "type": { "text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1 }, "sizes": 1 },
  2088. "main": {},
  2089. "map": { "name": 1 },
  2090. "mark": {},
  2091. "math": {},
  2092. "menu": { "type": 1, "label": 1 },
  2093. "meta": { "http-equiv": { "content-type": 1 }, "name": { "description": 1, "keywords": 1 }, "content": { "text/html; charset=UTF-8": 1 }, "charset": 1 },
  2094. "meter": { "value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1 },
  2095. "nav": {},
  2096. "noscript": { "href": 1 },
  2097. "object": { "param": 1, "data": 1, "type": 1, "height": 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1 },
  2098. "ol": { "start": 1, "reversed": 1 },
  2099. "optgroup": { "disabled": 1, "label": 1 },
  2100. "option": { "disabled": 1, "selected": 1, "label": 1, "value": 1 },
  2101. "output": { "for": 1, "form": 1, "name": 1 },
  2102. "p": {},
  2103. "param": { "name": 1, "value": 1 },
  2104. "pre": {},
  2105. "progress": { "value": 1, "max": 1 },
  2106. "q": { "cite": 1 },
  2107. "rp": {},
  2108. "rt": {},
  2109. "ruby": {},
  2110. "s": {},
  2111. "samp": {},
  2112. "script": { "charset": 1, "type": { "text/javascript": 1 }, "src": 1, "defer": 1, "async": 1 },
  2113. "select": { "autofocus": 1, "disabled": 1, "form": 1, "multiple": { "multiple": 1 }, "name": 1, "size": 1, "readonly": { "readonly": 1 } },
  2114. "small": {},
  2115. "source": { "src": 1, "type": 1, "media": 1 },
  2116. "span": {},
  2117. "strong": {},
  2118. "style": { "type": 1, "media": { "all": 1, "screen": 1, "print": 1 }, "scoped": 1 },
  2119. "sub": {},
  2120. "sup": {},
  2121. "svg": {},
  2122. "table": { "summary": 1 },
  2123. "tbody": {},
  2124. "td": { "headers": 1, "rowspan": 1, "colspan": 1 },
  2125. "textarea": { "autofocus": { "autofocus": 1 }, "disabled": { "disabled": 1 }, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": { "readonly": 1 }, "required": { "required": 1 }, "rows": 1, "cols": 1, "wrap": { "on": 1, "off": 1, "hard": 1, "soft": 1 } },
  2126. "tfoot": {},
  2127. "th": { "headers": 1, "rowspan": 1, "colspan": 1, "scope": 1 },
  2128. "thead": {},
  2129. "time": { "datetime": 1 },
  2130. "title": {},
  2131. "tr": {},
  2132. "track": { "kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1 },
  2133. "section": {},
  2134. "summary": {},
  2135. "u": {},
  2136. "ul": {},
  2137. "var": {},
  2138. "video": { "src": 1, "autobuffer": 1, "autoplay": { "autoplay": 1 }, "loop": { "loop": 1 }, "controls": { "controls": 1 }, "width": 1, "height": 1, "poster": 1, "muted": { "muted": 1 }, "preload": { "auto": 1, "metadata": 1, "none": 1 } },
  2139. "wbr": {}
  2140. };
  2141. var elements = Object.keys(attributeMap);
  2142. function is(token, type) {
  2143. return token.type.lastIndexOf(type + ".xml") > -1;
  2144. }
  2145. function findTagName(session, pos) {
  2146. var iterator = new TokenIterator(session, pos.row, pos.column);
  2147. var token = iterator.getCurrentToken();
  2148. while (token && !is(token, "tag-name")) {
  2149. token = iterator.stepBackward();
  2150. }
  2151. if (token)
  2152. return token.value;
  2153. }
  2154. function findAttributeName(session, pos) {
  2155. var iterator = new TokenIterator(session, pos.row, pos.column);
  2156. var token = iterator.getCurrentToken();
  2157. while (token && !is(token, "attribute-name")) {
  2158. token = iterator.stepBackward();
  2159. }
  2160. if (token)
  2161. return token.value;
  2162. }
  2163. var HtmlCompletions = function () {
  2164. };
  2165. (function () {
  2166. this.getCompletions = function (state, session, pos, prefix) {
  2167. var token = session.getTokenAt(pos.row, pos.column);
  2168. if (!token)
  2169. return [];
  2170. if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
  2171. return this.getTagCompletions(state, session, pos, prefix);
  2172. if (is(token, "tag-whitespace") || is(token, "attribute-name"))
  2173. return this.getAttributeCompletions(state, session, pos, prefix);
  2174. if (is(token, "attribute-value"))
  2175. return this.getAttributeValueCompletions(state, session, pos, prefix);
  2176. var line = session.getLine(pos.row).substr(0, pos.column);
  2177. if (/&[a-z]*$/i.test(line))
  2178. return this.getHTMLEntityCompletions(state, session, pos, prefix);
  2179. return [];
  2180. };
  2181. this.getTagCompletions = function (state, session, pos, prefix) {
  2182. return elements.map(function (element) {
  2183. return {
  2184. value: element,
  2185. meta: "tag",
  2186. score: 1000000
  2187. };
  2188. });
  2189. };
  2190. this.getAttributeCompletions = function (state, session, pos, prefix) {
  2191. var tagName = findTagName(session, pos);
  2192. if (!tagName)
  2193. return [];
  2194. var attributes = globalAttributes;
  2195. if (tagName in attributeMap) {
  2196. attributes = attributes.concat(Object.keys(attributeMap[tagName]));
  2197. }
  2198. return attributes.map(function (attribute) {
  2199. return {
  2200. caption: attribute,
  2201. snippet: attribute + '="$0"',
  2202. meta: "attribute",
  2203. score: 1000000
  2204. };
  2205. });
  2206. };
  2207. this.getAttributeValueCompletions = function (state, session, pos, prefix) {
  2208. var tagName = findTagName(session, pos);
  2209. var attributeName = findAttributeName(session, pos);
  2210. if (!tagName)
  2211. return [];
  2212. var values = [];
  2213. if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
  2214. values = Object.keys(attributeMap[tagName][attributeName]);
  2215. }
  2216. return values.map(function (value) {
  2217. return {
  2218. caption: value,
  2219. snippet: value,
  2220. meta: "attribute value",
  2221. score: 1000000
  2222. };
  2223. });
  2224. };
  2225. this.getHTMLEntityCompletions = function (state, session, pos, prefix) {
  2226. var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;'];
  2227. return values.map(function (value) {
  2228. return {
  2229. caption: value,
  2230. snippet: value,
  2231. meta: "html entity",
  2232. score: 1000000
  2233. };
  2234. });
  2235. };
  2236. }).call(HtmlCompletions.prototype);
  2237. exports.HtmlCompletions = HtmlCompletions;
  2238. });
  2239. ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module){"use strict";
  2240. var oop = require("../lib/oop");
  2241. var lang = require("../lib/lang");
  2242. var TextMode = require("./text").Mode;
  2243. var JavaScriptMode = require("./javascript").Mode;
  2244. var CssMode = require("./css").Mode;
  2245. var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
  2246. var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
  2247. var HtmlFoldMode = require("./folding/html").FoldMode;
  2248. var HtmlCompletions = require("./html_completions").HtmlCompletions;
  2249. var WorkerClient = require("../worker/worker_client").WorkerClient;
  2250. var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
  2251. var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
  2252. var Mode = function (options) {
  2253. this.fragmentContext = options && options.fragmentContext;
  2254. this.HighlightRules = HtmlHighlightRules;
  2255. this.$behaviour = new XmlBehaviour();
  2256. this.$completer = new HtmlCompletions();
  2257. this.createModeDelegates({
  2258. "js-": JavaScriptMode,
  2259. "css-": CssMode
  2260. });
  2261. this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
  2262. };
  2263. oop.inherits(Mode, TextMode);
  2264. (function () {
  2265. this.blockComment = { start: "<!--", end: "-->" };
  2266. this.voidElements = lang.arrayToMap(voidElements);
  2267. this.getNextLineIndent = function (state, line, tab) {
  2268. return this.$getIndent(line);
  2269. };
  2270. this.checkOutdent = function (state, line, input) {
  2271. return false;
  2272. };
  2273. this.getCompletions = function (state, session, pos, prefix) {
  2274. return this.$completer.getCompletions(state, session, pos, prefix);
  2275. };
  2276. this.createWorker = function (session) {
  2277. if (this.constructor != Mode)
  2278. return;
  2279. var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
  2280. worker.attachToDocument(session.getDocument());
  2281. if (this.fragmentContext)
  2282. worker.call("setOptions", [{ context: this.fragmentContext }]);
  2283. worker.on("error", function (e) {
  2284. session.setAnnotations(e.data);
  2285. });
  2286. worker.on("terminate", function () {
  2287. session.clearAnnotations();
  2288. });
  2289. return worker;
  2290. };
  2291. this.$id = "ace/mode/html";
  2292. this.snippetFileId = "ace/snippets/html";
  2293. }).call(Mode.prototype);
  2294. exports.Mode = Mode;
  2295. });
  2296. ace.define("ace/mode/django",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/html_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){var oop = require("../lib/oop");
  2297. var HtmlMode = require("./html").Mode;
  2298. var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
  2299. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  2300. var DjangoHighlightRules = function () {
  2301. this.$rules = {
  2302. 'start': [{
  2303. token: "string",
  2304. regex: '".*?"'
  2305. }, {
  2306. token: "string",
  2307. regex: "'.*?'"
  2308. }, {
  2309. token: "constant",
  2310. regex: '[0-9]+'
  2311. }, {
  2312. token: "variable",
  2313. regex: "[-_a-zA-Z0-9:]+"
  2314. }],
  2315. 'tag': [{
  2316. token: "entity.name.function",
  2317. regex: "[a-zA-Z][_a-zA-Z0-9]*",
  2318. next: "start"
  2319. }]
  2320. };
  2321. };
  2322. oop.inherits(DjangoHighlightRules, TextHighlightRules);
  2323. var DjangoHtmlHighlightRules = function () {
  2324. this.$rules = new HtmlHighlightRules().getRules();
  2325. for (var i in this.$rules) {
  2326. this.$rules[i].unshift({
  2327. token: "comment.line",
  2328. regex: "\\{#.*?#\\}"
  2329. }, {
  2330. token: "comment.block",
  2331. regex: "\\{\\%\\s*comment\\s*\\%\\}",
  2332. merge: true,
  2333. next: "django-comment"
  2334. }, {
  2335. token: "constant.language",
  2336. regex: "\\{\\{",
  2337. next: "django-start"
  2338. }, {
  2339. token: "constant.language",
  2340. regex: "\\{\\%",
  2341. next: "django-tag"
  2342. });
  2343. this.embedRules(DjangoHighlightRules, "django-", [{
  2344. token: "comment.block",
  2345. regex: "\\{\\%\\s*endcomment\\s*\\%\\}",
  2346. merge: true,
  2347. next: "start"
  2348. }, {
  2349. token: "constant.language",
  2350. regex: "\\%\\}",
  2351. next: "start"
  2352. }, {
  2353. token: "constant.language",
  2354. regex: "\\}\\}",
  2355. next: "start"
  2356. }]);
  2357. }
  2358. };
  2359. oop.inherits(DjangoHtmlHighlightRules, HtmlHighlightRules);
  2360. var Mode = function () {
  2361. HtmlMode.call(this);
  2362. this.HighlightRules = DjangoHtmlHighlightRules;
  2363. };
  2364. oop.inherits(Mode, HtmlMode);
  2365. (function () {
  2366. this.$id = "ace/mode/django";
  2367. this.snippetFileId = "ace/snippets/django";
  2368. }).call(Mode.prototype);
  2369. exports.Mode = Mode;
  2370. }); (function() {
  2371. ace.require(["ace/mode/django"], function(m) {
  2372. if (typeof module == "object" && typeof exports == "object" && module) {
  2373. module.exports = m;
  2374. }
  2375. });
  2376. })();