ext-settings_menu.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. ace.define("ace/ext/menu_tools/element_generator",["require","exports","module"], function(require, exports, module) {
  2. 'use strict';
  3. module.exports.createOption = function createOption (obj) {
  4. var attribute;
  5. var el = document.createElement('option');
  6. for(attribute in obj) {
  7. if(obj.hasOwnProperty(attribute)) {
  8. if(attribute === 'selected') {
  9. el.setAttribute(attribute, obj[attribute]);
  10. } else {
  11. el[attribute] = obj[attribute];
  12. }
  13. }
  14. }
  15. return el;
  16. };
  17. module.exports.createCheckbox = function createCheckbox (id, checked, clss) {
  18. var el = document.createElement('input');
  19. el.setAttribute('type', 'checkbox');
  20. el.setAttribute('id', id);
  21. el.setAttribute('name', id);
  22. el.setAttribute('value', checked);
  23. el.setAttribute('class', clss);
  24. if(checked) {
  25. el.setAttribute('checked', 'checked');
  26. }
  27. return el;
  28. };
  29. module.exports.createInput = function createInput (id, value, clss) {
  30. var el = document.createElement('input');
  31. el.setAttribute('type', 'text');
  32. el.setAttribute('id', id);
  33. el.setAttribute('name', id);
  34. el.setAttribute('value', value);
  35. el.setAttribute('class', clss);
  36. return el;
  37. };
  38. module.exports.createLabel = function createLabel (text, labelFor) {
  39. var el = document.createElement('label');
  40. el.setAttribute('for', labelFor);
  41. el.textContent = text;
  42. return el;
  43. };
  44. module.exports.createSelection = function createSelection (id, values, clss) {
  45. var el = document.createElement('select');
  46. el.setAttribute('id', id);
  47. el.setAttribute('name', id);
  48. el.setAttribute('class', clss);
  49. values.forEach(function(item) {
  50. el.appendChild(module.exports.createOption(item));
  51. });
  52. return el;
  53. };
  54. });
  55. ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module) {
  56. "use strict";
  57. var modes = [];
  58. function getModeForPath(path) {
  59. var mode = modesByName.text;
  60. var fileName = path.split(/[\/\\]/).pop();
  61. for (var i = 0; i < modes.length; i++) {
  62. if (modes[i].supportsFile(fileName)) {
  63. mode = modes[i];
  64. break;
  65. }
  66. }
  67. return mode;
  68. }
  69. var Mode = function(name, caption, extensions) {
  70. this.name = name;
  71. this.caption = caption;
  72. this.mode = "ace/mode/" + name;
  73. this.extensions = extensions;
  74. var re;
  75. if (/\^/.test(extensions)) {
  76. re = extensions.replace(/\|(\^)?/g, function(a, b){
  77. return "$|" + (b ? "^" : "^.*\\.");
  78. }) + "$";
  79. } else {
  80. re = "^.*\\.(" + extensions + ")$";
  81. }
  82. this.extRe = new RegExp(re, "gi");
  83. };
  84. Mode.prototype.supportsFile = function(filename) {
  85. return filename.match(this.extRe);
  86. };
  87. var supportedModes = {
  88. ABAP: ["abap"],
  89. ABC: ["abc"],
  90. ActionScript:["as"],
  91. ADA: ["ada|adb"],
  92. Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],
  93. AsciiDoc: ["asciidoc|adoc"],
  94. Assembly_x86:["asm|a"],
  95. AutoHotKey: ["ahk"],
  96. BatchFile: ["bat|cmd"],
  97. Bro: ["bro"],
  98. C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
  99. C9Search: ["c9search_results"],
  100. Cirru: ["cirru|cr"],
  101. Clojure: ["clj|cljs"],
  102. Cobol: ["CBL|COB"],
  103. coffee: ["coffee|cf|cson|^Cakefile"],
  104. ColdFusion: ["cfm"],
  105. CSharp: ["cs"],
  106. CSS: ["css"],
  107. Curly: ["curly"],
  108. D: ["d|di"],
  109. Dart: ["dart"],
  110. Diff: ["diff|patch"],
  111. Dockerfile: ["^Dockerfile"],
  112. Dot: ["dot"],
  113. Drools: ["drl"],
  114. Dummy: ["dummy"],
  115. DummySyntax: ["dummy"],
  116. Eiffel: ["e|ge"],
  117. EJS: ["ejs"],
  118. Elixir: ["ex|exs"],
  119. Elm: ["elm"],
  120. Erlang: ["erl|hrl"],
  121. Forth: ["frt|fs|ldr|fth|4th"],
  122. Fortran: ["f|f90"],
  123. FTL: ["ftl"],
  124. Gcode: ["gcode"],
  125. Gherkin: ["feature"],
  126. Gitignore: ["^.gitignore"],
  127. Glsl: ["glsl|frag|vert"],
  128. Gobstones: ["gbs"],
  129. golang: ["go"],
  130. Groovy: ["groovy"],
  131. HAML: ["haml"],
  132. Handlebars: ["hbs|handlebars|tpl|mustache"],
  133. Haskell: ["hs"],
  134. Haskell_Cabal: ["cabal"],
  135. haXe: ["hx"],
  136. Hjson: ["hjson"],
  137. HTML: ["html|htm|xhtml"],
  138. HTML_Elixir: ["eex|html.eex"],
  139. HTML_Ruby: ["erb|rhtml|html.erb"],
  140. INI: ["ini|conf|cfg|prefs"],
  141. Io: ["io"],
  142. Jack: ["jack"],
  143. Jade: ["jade|pug"],
  144. Java: ["java"],
  145. JavaScript: ["js|jsm|jsx"],
  146. JSON: ["json"],
  147. JSONiq: ["jq"],
  148. JSP: ["jsp"],
  149. JSX: ["jsx"],
  150. Julia: ["jl"],
  151. Kotlin: ["kt|kts"],
  152. LaTeX: ["tex|latex|ltx|bib"],
  153. LESS: ["less"],
  154. Liquid: ["liquid"],
  155. Lisp: ["lisp"],
  156. LiveScript: ["ls"],
  157. LogiQL: ["logic|lql"],
  158. LSL: ["lsl"],
  159. Lua: ["lua"],
  160. LuaPage: ["lp"],
  161. Lucene: ["lucene"],
  162. Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],
  163. Markdown: ["md|markdown"],
  164. Mask: ["mask"],
  165. MATLAB: ["matlab"],
  166. Maze: ["mz"],
  167. MEL: ["mel"],
  168. MUSHCode: ["mc|mush"],
  169. MySQL: ["mysql"],
  170. Nix: ["nix"],
  171. NSIS: ["nsi|nsh"],
  172. ObjectiveC: ["m|mm"],
  173. OCaml: ["ml|mli"],
  174. Pascal: ["pas|p"],
  175. Perl: ["pl|pm"],
  176. pgSQL: ["pgsql"],
  177. PHP: ["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
  178. Powershell: ["ps1"],
  179. Praat: ["praat|praatscript|psc|proc"],
  180. Prolog: ["plg|prolog"],
  181. Properties: ["properties"],
  182. Protobuf: ["proto"],
  183. Python: ["py"],
  184. R: ["r"],
  185. Razor: ["cshtml|asp"],
  186. RDoc: ["Rd"],
  187. RHTML: ["Rhtml"],
  188. RST: ["rst"],
  189. Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
  190. Rust: ["rs"],
  191. SASS: ["sass"],
  192. SCAD: ["scad"],
  193. Scala: ["scala"],
  194. Scheme: ["scm|sm|rkt|oak|scheme"],
  195. SCSS: ["scss"],
  196. SH: ["sh|bash|^.bashrc"],
  197. SJS: ["sjs"],
  198. Smarty: ["smarty|tpl"],
  199. snippets: ["snippets"],
  200. Soy_Template:["soy"],
  201. Space: ["space"],
  202. SQL: ["sql"],
  203. SQLServer: ["sqlserver"],
  204. Stylus: ["styl|stylus"],
  205. SVG: ["svg"],
  206. Swift: ["swift"],
  207. Tcl: ["tcl"],
  208. Tex: ["tex"],
  209. Text: ["txt"],
  210. Textile: ["textile"],
  211. Toml: ["toml"],
  212. TSX: ["tsx"],
  213. Twig: ["twig|swig"],
  214. Typescript: ["ts|typescript|str"],
  215. Vala: ["vala"],
  216. VBScript: ["vbs|vb"],
  217. Velocity: ["vm"],
  218. Verilog: ["v|vh|sv|svh"],
  219. VHDL: ["vhd|vhdl"],
  220. Wollok: ["wlk|wpgm|wtest"],
  221. XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
  222. XQuery: ["xq"],
  223. YAML: ["yaml|yml"],
  224. Django: ["html"]
  225. };
  226. var nameOverrides = {
  227. ObjectiveC: "Objective-C",
  228. CSharp: "C#",
  229. golang: "Go",
  230. C_Cpp: "C and C++",
  231. coffee: "CoffeeScript",
  232. HTML_Ruby: "HTML (Ruby)",
  233. HTML_Elixir: "HTML (Elixir)",
  234. FTL: "FreeMarker"
  235. };
  236. var modesByName = {};
  237. for (var name in supportedModes) {
  238. var data = supportedModes[name];
  239. var displayName = (nameOverrides[name] || name).replace(/_/g, " ");
  240. var filename = name.toLowerCase();
  241. var mode = new Mode(filename, displayName, data[0]);
  242. modesByName[filename] = mode;
  243. modes.push(mode);
  244. }
  245. module.exports = {
  246. getModeForPath: getModeForPath,
  247. modes: modes,
  248. modesByName: modesByName
  249. };
  250. });
  251. ace.define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"], function(require, exports, module) {
  252. "use strict";
  253. require("ace/lib/fixoldbrowsers");
  254. var themeData = [
  255. ["Chrome" ],
  256. ["Clouds" ],
  257. ["Crimson Editor" ],
  258. ["Dawn" ],
  259. ["Dreamweaver" ],
  260. ["Eclipse" ],
  261. ["GitHub" ],
  262. ["IPlastic" ],
  263. ["Solarized Light"],
  264. ["TextMate" ],
  265. ["Tomorrow" ],
  266. ["XCode" ],
  267. ["Kuroir"],
  268. ["KatzenMilch"],
  269. ["SQL Server" ,"sqlserver" , "light"],
  270. ["Ambiance" ,"ambiance" , "dark"],
  271. ["Chaos" ,"chaos" , "dark"],
  272. ["Clouds Midnight" ,"clouds_midnight" , "dark"],
  273. ["Cobalt" ,"cobalt" , "dark"],
  274. ["Gruvbox" ,"gruvbox" , "dark"],
  275. ["idle Fingers" ,"idle_fingers" , "dark"],
  276. ["krTheme" ,"kr_theme" , "dark"],
  277. ["Merbivore" ,"merbivore" , "dark"],
  278. ["Merbivore Soft" ,"merbivore_soft" , "dark"],
  279. ["Mono Industrial" ,"mono_industrial" , "dark"],
  280. ["Monokai" ,"monokai" , "dark"],
  281. ["Pastel on dark" ,"pastel_on_dark" , "dark"],
  282. ["Solarized Dark" ,"solarized_dark" , "dark"],
  283. ["Terminal" ,"terminal" , "dark"],
  284. ["Tomorrow Night" ,"tomorrow_night" , "dark"],
  285. ["Tomorrow Night Blue" ,"tomorrow_night_blue" , "dark"],
  286. ["Tomorrow Night Bright","tomorrow_night_bright" , "dark"],
  287. ["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"],
  288. ["Twilight" ,"twilight" , "dark"],
  289. ["Vibrant Ink" ,"vibrant_ink" , "dark"]
  290. ];
  291. exports.themesByName = {};
  292. exports.themes = themeData.map(function(data) {
  293. var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
  294. var theme = {
  295. caption: data[0],
  296. theme: "ace/theme/" + name,
  297. isDark: data[2] == "dark",
  298. name: name
  299. };
  300. exports.themesByName[name] = theme;
  301. return theme;
  302. });
  303. });
  304. ace.define("ace/ext/menu_tools/add_editor_menu_options",["require","exports","module","ace/ext/modelist","ace/ext/themelist"], function(require, exports, module) {
  305. 'use strict';
  306. module.exports.addEditorMenuOptions = function addEditorMenuOptions (editor) {
  307. var modelist = require('../modelist');
  308. var themelist = require('../themelist');
  309. editor.menuOptions = {
  310. setNewLineMode: [{
  311. textContent: "unix",
  312. value: "unix"
  313. }, {
  314. textContent: "windows",
  315. value: "windows"
  316. }, {
  317. textContent: "auto",
  318. value: "auto"
  319. }],
  320. setTheme: [],
  321. setMode: [],
  322. setKeyboardHandler: [{
  323. textContent: "ace",
  324. value: ""
  325. }, {
  326. textContent: "vim",
  327. value: "ace/keyboard/vim"
  328. }, {
  329. textContent: "emacs",
  330. value: "ace/keyboard/emacs"
  331. }, {
  332. textContent: "textarea",
  333. value: "ace/keyboard/textarea"
  334. }, {
  335. textContent: "sublime",
  336. value: "ace/keyboard/sublime"
  337. }]
  338. };
  339. editor.menuOptions.setTheme = themelist.themes.map(function(theme) {
  340. return {
  341. textContent: theme.caption,
  342. value: theme.theme
  343. };
  344. });
  345. editor.menuOptions.setMode = modelist.modes.map(function(mode) {
  346. return {
  347. textContent: mode.name,
  348. value: mode.mode
  349. };
  350. });
  351. };
  352. });
  353. ace.define("ace/ext/menu_tools/get_set_functions",["require","exports","module"], function(require, exports, module) {
  354. 'use strict';
  355. module.exports.getSetFunctions = function getSetFunctions (editor) {
  356. var out = [];
  357. var my = {
  358. 'editor' : editor,
  359. 'session' : editor.session,
  360. 'renderer' : editor.renderer
  361. };
  362. var opts = [];
  363. var skip = [
  364. 'setOption',
  365. 'setUndoManager',
  366. 'setDocument',
  367. 'setValue',
  368. 'setBreakpoints',
  369. 'setScrollTop',
  370. 'setScrollLeft',
  371. 'setSelectionStyle',
  372. 'setWrapLimitRange'
  373. ];
  374. ['renderer', 'session', 'editor'].forEach(function(esra) {
  375. var esr = my[esra];
  376. var clss = esra;
  377. for(var fn in esr) {
  378. if(skip.indexOf(fn) === -1) {
  379. if(/^set/.test(fn) && opts.indexOf(fn) === -1) {
  380. opts.push(fn);
  381. out.push({
  382. 'functionName' : fn,
  383. 'parentObj' : esr,
  384. 'parentName' : clss
  385. });
  386. }
  387. }
  388. }
  389. });
  390. return out;
  391. };
  392. });
  393. ace.define("ace/ext/menu_tools/generate_settings_menu",["require","exports","module","ace/ext/menu_tools/element_generator","ace/ext/menu_tools/add_editor_menu_options","ace/ext/menu_tools/get_set_functions","ace/ace"], function(require, exports, module) {
  394. 'use strict';
  395. var egen = require('./element_generator');
  396. var addEditorMenuOptions = require('./add_editor_menu_options').addEditorMenuOptions;
  397. var getSetFunctions = require('./get_set_functions').getSetFunctions;
  398. module.exports.generateSettingsMenu = function generateSettingsMenu (editor) {
  399. var elements = [];
  400. function cleanupElementsList() {
  401. elements.sort(function(a, b) {
  402. var x = a.getAttribute('contains');
  403. var y = b.getAttribute('contains');
  404. return x.localeCompare(y);
  405. });
  406. }
  407. function wrapElements() {
  408. var topmenu = document.createElement('div');
  409. topmenu.setAttribute('id', 'ace_settingsmenu');
  410. elements.forEach(function(element) {
  411. topmenu.appendChild(element);
  412. });
  413. var el = topmenu.appendChild(document.createElement('div'));
  414. var version = require("../../ace").version;
  415. el.style.padding = "1em";
  416. el.textContent = "Ace version " + version;
  417. return topmenu;
  418. }
  419. function createNewEntry(obj, clss, item, val) {
  420. var el;
  421. var div = document.createElement('div');
  422. div.setAttribute('contains', item);
  423. div.setAttribute('class', 'ace_optionsMenuEntry');
  424. div.setAttribute('style', 'clear: both;');
  425. div.appendChild(egen.createLabel(
  426. item.replace(/^set/, '').replace(/([A-Z])/g, ' $1').trim(),
  427. item
  428. ));
  429. if (Array.isArray(val)) {
  430. el = egen.createSelection(item, val, clss);
  431. el.addEventListener('change', function(e) {
  432. try{
  433. editor.menuOptions[e.target.id].forEach(function(x) {
  434. if(x.textContent !== e.target.textContent) {
  435. delete x.selected;
  436. }
  437. });
  438. obj[e.target.id](e.target.value);
  439. } catch (err) {
  440. throw new Error(err);
  441. }
  442. });
  443. } else if(typeof val === 'boolean') {
  444. el = egen.createCheckbox(item, val, clss);
  445. el.addEventListener('change', function(e) {
  446. try{
  447. obj[e.target.id](!!e.target.checked);
  448. } catch (err) {
  449. throw new Error(err);
  450. }
  451. });
  452. } else {
  453. el = egen.createInput(item, val, clss);
  454. el.addEventListener('change', function(e) {
  455. try{
  456. if(e.target.value === 'true') {
  457. obj[e.target.id](true);
  458. } else if(e.target.value === 'false') {
  459. obj[e.target.id](false);
  460. } else {
  461. obj[e.target.id](e.target.value);
  462. }
  463. } catch (err) {
  464. throw new Error(err);
  465. }
  466. });
  467. }
  468. el.style.cssText = 'float:right;';
  469. div.appendChild(el);
  470. return div;
  471. }
  472. function makeDropdown(item, esr, clss, fn) {
  473. var val = editor.menuOptions[item];
  474. var currentVal = esr[fn]();
  475. if (typeof currentVal == 'object')
  476. currentVal = currentVal.$id;
  477. val.forEach(function(valuex) {
  478. if (valuex.value === currentVal)
  479. valuex.selected = 'selected';
  480. });
  481. return createNewEntry(esr, clss, item, val);
  482. }
  483. function handleSet(setObj) {
  484. var item = setObj.functionName;
  485. var esr = setObj.parentObj;
  486. var clss = setObj.parentName;
  487. var val;
  488. var fn = item.replace(/^set/, 'get');
  489. if(editor.menuOptions[item] !== undefined) {
  490. elements.push(makeDropdown(item, esr, clss, fn));
  491. } else if(typeof esr[fn] === 'function') {
  492. try {
  493. val = esr[fn]();
  494. if(typeof val === 'object') {
  495. val = val.$id;
  496. }
  497. elements.push(
  498. createNewEntry(esr, clss, item, val)
  499. );
  500. } catch (e) {
  501. }
  502. }
  503. }
  504. addEditorMenuOptions(editor);
  505. getSetFunctions(editor).forEach(function(setObj) {
  506. handleSet(setObj);
  507. });
  508. cleanupElementsList();
  509. return wrapElements();
  510. };
  511. });
  512. ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
  513. 'use strict';
  514. var dom = require("../../lib/dom");
  515. var cssText = "#ace_settingsmenu, #kbshortcutmenu {\
  516. background-color: #F7F7F7;\
  517. color: black;\
  518. box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\
  519. padding: 1em 0.5em 2em 1em;\
  520. overflow: auto;\
  521. position: absolute;\
  522. margin: 0;\
  523. bottom: 0;\
  524. right: 0;\
  525. top: 0;\
  526. z-index: 9991;\
  527. cursor: default;\
  528. }\
  529. .ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\
  530. box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\
  531. background-color: rgba(255, 255, 255, 0.6);\
  532. color: black;\
  533. }\
  534. .ace_optionsMenuEntry:hover {\
  535. background-color: rgba(100, 100, 100, 0.1);\
  536. -webkit-transition: all 0.5s;\
  537. transition: all 0.3s\
  538. }\
  539. .ace_closeButton {\
  540. background: rgba(245, 146, 146, 0.5);\
  541. border: 1px solid #F48A8A;\
  542. border-radius: 50%;\
  543. padding: 7px;\
  544. position: absolute;\
  545. right: -8px;\
  546. top: -8px;\
  547. z-index: 1000;\
  548. }\
  549. .ace_closeButton{\
  550. background: rgba(245, 146, 146, 0.9);\
  551. }\
  552. .ace_optionsMenuKey {\
  553. color: darkslateblue;\
  554. font-weight: bold;\
  555. }\
  556. .ace_optionsMenuCommand {\
  557. color: darkcyan;\
  558. font-weight: normal;\
  559. }";
  560. dom.importCssString(cssText);
  561. module.exports.overlayPage = function overlayPage(editor, contentElement, top, right, bottom, left) {
  562. top = top ? 'top: ' + top + ';' : '';
  563. bottom = bottom ? 'bottom: ' + bottom + ';' : '';
  564. right = right ? 'right: ' + right + ';' : '';
  565. left = left ? 'left: ' + left + ';' : '';
  566. var closer = document.createElement('div');
  567. var contentContainer = document.createElement('div');
  568. function documentEscListener(e) {
  569. if (e.keyCode === 27) {
  570. closer.click();
  571. }
  572. }
  573. closer.style.cssText = 'margin: 0; padding: 0; ' +
  574. 'position: fixed; top:0; bottom:0; left:0; right:0;' +
  575. 'z-index: 9990; ' +
  576. 'background-color: rgba(0, 0, 0, 0.3);';
  577. closer.addEventListener('click', function() {
  578. document.removeEventListener('keydown', documentEscListener);
  579. closer.parentNode.removeChild(closer);
  580. editor.focus();
  581. closer = null;
  582. });
  583. document.addEventListener('keydown', documentEscListener);
  584. contentContainer.style.cssText = top + right + bottom + left;
  585. contentContainer.addEventListener('click', function(e) {
  586. e.stopPropagation();
  587. });
  588. var wrapper = dom.createElement("div");
  589. wrapper.style.position = "relative";
  590. var closeButton = dom.createElement("div");
  591. closeButton.className = "ace_closeButton";
  592. closeButton.addEventListener('click', function() {
  593. closer.click();
  594. });
  595. wrapper.appendChild(closeButton);
  596. contentContainer.appendChild(wrapper);
  597. contentContainer.appendChild(contentElement);
  598. closer.appendChild(contentContainer);
  599. document.body.appendChild(closer);
  600. editor.blur();
  601. };
  602. });
  603. ace.define("ace/ext/settings_menu",["require","exports","module","ace/ext/menu_tools/generate_settings_menu","ace/ext/menu_tools/overlay_page","ace/editor"], function(require, exports, module) {
  604. "use strict";
  605. var generateSettingsMenu = require('./menu_tools/generate_settings_menu').generateSettingsMenu;
  606. var overlayPage = require('./menu_tools/overlay_page').overlayPage;
  607. function showSettingsMenu(editor) {
  608. var sm = document.getElementById('ace_settingsmenu');
  609. if (!sm)
  610. overlayPage(editor, generateSettingsMenu(editor), '0', '0', '0');
  611. }
  612. module.exports.init = function(editor) {
  613. var Editor = require("ace/editor").Editor;
  614. Editor.prototype.showSettingsMenu = function() {
  615. showSettingsMenu(this);
  616. };
  617. };
  618. });
  619. (function() {
  620. ace.require(["ace/ext/settings_menu"], function() {});
  621. })();