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