ext-settings_menu.js 20 KB

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