ext-settings_menu.js 20 KB

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