update packaged ace
This commit is contained in:
parent
fb85c5790d
commit
5eddc94f97
39 changed files with 2250 additions and 1697 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
|
@ -760,6 +760,7 @@ Requisition.prototype = {
|
|||
exec: function() {
|
||||
canon.exec(this.commandAssignment.value,
|
||||
this.env,
|
||||
"cli",
|
||||
this.getArgsObject(),
|
||||
this.toCanonicalString());
|
||||
},
|
||||
|
|
@ -1351,6 +1352,7 @@ define('cockpit/ui/cli_view', ['require', 'exports', 'module' , 'text!cockpit/ui
|
|||
var editorCss = require("text!cockpit/ui/cli_view.css");
|
||||
var event = require("pilot/event");
|
||||
var dom = require("pilot/dom");
|
||||
|
||||
dom.importCssString(editorCss);
|
||||
|
||||
var event = require("pilot/event");
|
||||
|
|
@ -1375,15 +1377,18 @@ var NO_HINT = new Hint(Status.VALID, '', 0, 0);
|
|||
exports.startup = function(data, reason) {
|
||||
var cli = new CliRequisition(data.env);
|
||||
var cliView = new CliView(cli, data.env);
|
||||
data.env.cli = cli;
|
||||
};
|
||||
|
||||
/**
|
||||
* A class to handle the simplest UI implementation
|
||||
*/
|
||||
function CliView(cli, env) {
|
||||
cli.cliView = this;
|
||||
this.cli = cli;
|
||||
this.doc = document;
|
||||
this.win = dom.getParentWindow(this.doc);
|
||||
this.env = env;
|
||||
|
||||
// TODO: we should have a better way to specify command lines???
|
||||
this.element = this.doc.getElementById('cockpitInput');
|
||||
|
|
@ -1418,7 +1423,7 @@ CliView.prototype = {
|
|||
if (!this.output) {
|
||||
this.output = this.doc.createElement('div');
|
||||
this.output.id = 'cockpitOutput';
|
||||
this.output.className = 'cptFocusPopup';
|
||||
this.output.className = 'cptOutput';
|
||||
input.parentNode.insertBefore(this.output, input.nextSibling);
|
||||
|
||||
var setMaxOutputHeight = function() {
|
||||
|
|
@ -1430,7 +1435,7 @@ CliView.prototype = {
|
|||
|
||||
this.completer = this.doc.createElement('div');
|
||||
this.completer.className = 'cptCompletion VALID';
|
||||
;
|
||||
|
||||
this.completer.style.color = dom.computedStyle(input, "color");
|
||||
this.completer.style.fontSize = dom.computedStyle(input, "fontSize");
|
||||
this.completer.style.fontFamily = dom.computedStyle(input, "fontFamily");
|
||||
|
|
@ -1443,7 +1448,7 @@ CliView.prototype = {
|
|||
input.style.backgroundColor = 'transparent';
|
||||
|
||||
this.hinter = this.doc.createElement('div');
|
||||
this.hinter.className = 'cptHints cptFocusPopup';
|
||||
this.hinter.className = 'cptHints';
|
||||
input.parentNode.insertBefore(this.hinter, input.nextSibling);
|
||||
|
||||
var resizer = this.resizer.bind(this);
|
||||
|
|
@ -1455,7 +1460,7 @@ CliView.prototype = {
|
|||
canon.addEventListener('output', function(ev) {
|
||||
new RequestView(ev.request, this);
|
||||
}.bind(this));
|
||||
event.addCommandKeyListener(input, this.onCommandKey.bind(this));
|
||||
event.addCommandKeyListener(input, this.onCommandKey.bind(this));
|
||||
event.addListener(input, 'keyup', this.onKeyUp.bind(this));
|
||||
|
||||
// cursor position affects hint severity. TODO: shortcuts for speed
|
||||
|
|
@ -1466,6 +1471,18 @@ CliView.prototype = {
|
|||
}.bind(this));
|
||||
|
||||
this.cli.addEventListener('argumentChange', this.onArgChange.bind(this));
|
||||
|
||||
event.addListener(input, "focus", function() {
|
||||
dom.addCssClass(this.output, "cptFocusPopup");
|
||||
dom.addCssClass(this.hinter, "cptFocusPopup");
|
||||
}.bind(this));
|
||||
|
||||
function hideOutput() {
|
||||
dom.removeCssClass(this.output, "cptFocusPopup");
|
||||
dom.removeCssClass(this.hinter, "cptFocusPopup");
|
||||
};
|
||||
event.addListener(input, "blur", hideOutput.bind(this));
|
||||
hideOutput.call(this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -1521,17 +1538,16 @@ CliView.prototype = {
|
|||
/**
|
||||
* Ensure that TAB isn't handled by the browser
|
||||
*/
|
||||
onCommandKey: function(ev, hashId, keyCode) {
|
||||
var handled;
|
||||
// var handled = keyboardManager.processKeyEvent(ev, this, {
|
||||
// isCommandLine: true, isKeyUp: false
|
||||
// });
|
||||
onCommandKey: function(ev, hashId, keyCode) {
|
||||
var stopEvent;
|
||||
if (keyCode === keys.TAB ||
|
||||
keyCode === keys.UP ||
|
||||
keyCode === keys.DOWN) {
|
||||
event.stopEvent(ev);
|
||||
stopEvent = true;
|
||||
} else if (hashId != 0 || keyCode != 0) {
|
||||
stopEvent = canon.execKeyCommand(this.env, 'cli', hashId, keyCode);
|
||||
}
|
||||
return handled;
|
||||
stopEvent && event.stopEvent(ev);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -1756,7 +1772,10 @@ var row = templates.querySelector('.cptRow');
|
|||
* TODO: This should probably live in some utility area somewhere
|
||||
*/
|
||||
function imageUrl(path) {
|
||||
var dataUrl = require('text!cockpit/ui/' + path);
|
||||
var dataUrl;
|
||||
try {
|
||||
dataUrl = require('text!cockpit/ui/' + path);
|
||||
} catch (e) { }
|
||||
if (dataUrl) {
|
||||
return dataUrl;
|
||||
}
|
||||
|
|
@ -1771,7 +1790,7 @@ function imageUrl(path) {
|
|||
|
||||
if (module.uri) {
|
||||
var end = module.uri.length - filename.length - 1;
|
||||
return module.uri.substr(0, end) + path;
|
||||
return module.uri.substr(0, end) + "/" + path;
|
||||
}
|
||||
|
||||
return filename + path;
|
||||
|
|
@ -2360,12 +2379,7 @@ exports.shutdown = function(data, reason) {
|
|||
define("text!cockpit/ui/cli_view.css", [], "" +
|
||||
"#cockpitInput { padding-left: 16px; }" +
|
||||
"" +
|
||||
"#cockpitOutput { overflow: auto; }" +
|
||||
"#cockpitOutput.cptFocusPopup { position: absolute; z-index: 999; }" +
|
||||
"" +
|
||||
".cptFocusPopup { display: none; }" +
|
||||
"#cockpitInput:focus ~ .cptFocusPopup { display: block; }" +
|
||||
"#cockpitInput:focus ~ .cptFocusPopup.cptNoPopup { display: none; }" +
|
||||
".cptOutput { overflow: auto; position: absolute; z-index: 999; display: none; }" +
|
||||
"" +
|
||||
".cptCompletion { padding: 0; position: absolute; z-index: -1000; }" +
|
||||
".cptCompletion.VALID { background: #FFF; }" +
|
||||
|
|
@ -2389,6 +2403,10 @@ define("text!cockpit/ui/cli_view.css", [], "" +
|
|||
" padding: 8px;" +
|
||||
" display: none;" +
|
||||
"}" +
|
||||
"" +
|
||||
".cptFocusPopup { display: block; }" +
|
||||
".cptFocusPopup.cptNoPopup { display: none; }" +
|
||||
"" +
|
||||
".cptHints ul { margin: 0; padding: 0 15px; }" +
|
||||
"" +
|
||||
".cptGt { font-weight: bold; font-size: 120%; }" +
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
build/src/mode-svg.js
Normal file
1
build/src/mode-svg.js
Normal file
File diff suppressed because one or more lines are too long
1
build/src/theme-merbivore.js
Normal file
1
build/src/theme-merbivore.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
define("ace/theme/merbivore",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-merbivore .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-merbivore .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-merbivore .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-merbivore .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-merbivore .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-merbivore .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-merbivore .ace_scroller {\n background-color: #161616;\n}\n\n.ace-merbivore .ace_text-layer {\n cursor: text;\n color: #E6E1DC;\n}\n\n.ace-merbivore .ace_cursor {\n border-left: 2px solid #FFFFFF;\n}\n\n.ace-merbivore .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FFFFFF;\n}\n \n.ace-merbivore .ace_marker-layer .ace_selection {\n background: #454545;\n}\n\n.ace-merbivore .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-merbivore .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #FCE94F;\n}\n\n.ace-merbivore .ace_marker-layer .ace_active_line {\n background: #333435;\n}\n\n \n.ace-merbivore .ace_invisible {\n color: #404040;\n}\n\n.ace-merbivore .ace_keyword {\n color:#FC6F09;\n}\n\n.ace-merbivore .ace_keyword.ace_operator {\n \n}\n\n.ace-merbivore .ace_constant {\n color:#1EDAFB;\n}\n\n.ace-merbivore .ace_constant.ace_language {\n color:#FDC251;\n}\n\n.ace-merbivore .ace_constant.ace_library {\n color:#8DFF0A;\n}\n\n.ace-merbivore .ace_constant.ace_numeric {\n color:#58C554;\n}\n\n.ace-merbivore .ace_invalid {\n color:#FFFFFF;\n background-color:#990000;\n}\n\n.ace-merbivore .ace_invalid.ace_illegal {\n \n}\n\n.ace-merbivore .ace_invalid.ace_deprecated {\n color:#FFFFFF;\n background-color:#990000;\n}\n\n.ace-merbivore .ace_support {\n \n}\n\n.ace-merbivore .ace_support.ace_function {\n color:#FC6F09;\n}\n\n.ace-merbivore .ace_function.ace_buildin {\n \n}\n\n.ace-merbivore .ace_string {\n color:#8DFF0A;\n}\n\n.ace-merbivore .ace_string.ace_regexp {\n \n}\n\n.ace-merbivore .ace_comment {\n color:#AD2EA4;\n}\n\n.ace-merbivore .ace_comment.ace_doc {\n \n}\n\n.ace-merbivore .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-merbivore .ace_variable {\n \n}\n\n.ace-merbivore .ace_variable.ace_language {\n \n}\n\n.ace-merbivore .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-merbivore"})
|
||||
1
build/src/theme-merbivore_soft.js
Normal file
1
build/src/theme-merbivore_soft.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
define("ace/theme/merbivore_soft",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-merbivore-soft .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-merbivore-soft .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-merbivore-soft .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-merbivore-soft .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-merbivore-soft .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-merbivore-soft .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-merbivore-soft .ace_scroller {\n background-color: #1C1C1C;\n}\n\n.ace-merbivore-soft .ace_text-layer {\n cursor: text;\n color: #E6E1DC;\n}\n\n.ace-merbivore-soft .ace_cursor {\n border-left: 2px solid #FFFFFF;\n}\n\n.ace-merbivore-soft .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FFFFFF;\n}\n \n.ace-merbivore-soft .ace_marker-layer .ace_selection {\n background: #494949;\n}\n\n.ace-merbivore-soft .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-merbivore-soft .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #FCE94F;\n}\n\n.ace-merbivore-soft .ace_marker-layer .ace_active_line {\n background: #333435;\n}\n\n \n.ace-merbivore-soft .ace_invisible {\n color: #404040;\n}\n\n.ace-merbivore-soft .ace_keyword {\n color:#FC803A;\n}\n\n.ace-merbivore-soft .ace_keyword.ace_operator {\n \n}\n\n.ace-merbivore-soft .ace_constant {\n color:#68C1D8;\n}\n\n.ace-merbivore-soft .ace_constant.ace_language {\n color:#E1C582;\n}\n\n.ace-merbivore-soft .ace_constant.ace_library {\n color:#8EC65F;\n}\n\n.ace-merbivore-soft .ace_constant.ace_numeric {\n color:#7FC578;\n}\n\n.ace-merbivore-soft .ace_invalid {\n color:#FFFFFF;\n background-color:#FE3838;\n}\n\n.ace-merbivore-soft .ace_invalid.ace_illegal {\n \n}\n\n.ace-merbivore-soft .ace_invalid.ace_deprecated {\n color:#FFFFFF;\n background-color:#FE3838;\n}\n\n.ace-merbivore-soft .ace_support {\n \n}\n\n.ace-merbivore-soft .ace_support.ace_function {\n color:#FC803A;\n}\n\n.ace-merbivore-soft .ace_function.ace_buildin {\n \n}\n\n.ace-merbivore-soft .ace_string {\n color:#8EC65F;\n}\n\n.ace-merbivore-soft .ace_string.ace_regexp {\n \n}\n\n.ace-merbivore-soft .ace_comment {\n color:#AC4BB8;\n}\n\n.ace-merbivore-soft .ace_comment.ace_doc {\n \n}\n\n.ace-merbivore-soft .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-merbivore-soft .ace_variable {\n \n}\n\n.ace-merbivore-soft .ace_variable.ace_language {\n \n}\n\n.ace-merbivore-soft .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-merbivore-soft"})
|
||||
1
build/src/theme-vibrant_ink.js
Normal file
1
build/src/theme-vibrant_ink.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
define("ace/theme/vibrant_ink",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-vibrant-ink .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-vibrant-ink .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-vibrant-ink .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-vibrant-ink .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-vibrant-ink .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-vibrant-ink .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-vibrant-ink .ace_scroller {\n background-color: #0F0F0F;\n}\n\n.ace-vibrant-ink .ace_text-layer {\n cursor: text;\n color: #FFFFFF;\n}\n\n.ace-vibrant-ink .ace_cursor {\n border-left: 2px solid #FFFFFF;\n}\n\n.ace-vibrant-ink .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FFFFFF;\n}\n \n.ace-vibrant-ink .ace_marker-layer .ace_selection {\n background: #6699CC;\n}\n\n.ace-vibrant-ink .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-vibrant-ink .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #99CC99;\n}\n\n.ace-vibrant-ink .ace_marker-layer .ace_active_line {\n background: #333333;\n}\n\n \n.ace-vibrant-ink .ace_invisible {\n color: #404040;\n}\n\n.ace-vibrant-ink .ace_keyword {\n color:#FF6600;\n}\n\n.ace-vibrant-ink .ace_keyword.ace_operator {\n \n}\n\n.ace-vibrant-ink .ace_constant {\n \n}\n\n.ace-vibrant-ink .ace_constant.ace_language {\n color:#339999;\n}\n\n.ace-vibrant-ink .ace_constant.ace_library {\n \n}\n\n.ace-vibrant-ink .ace_constant.ace_numeric {\n color:#99CC99;\n}\n\n.ace-vibrant-ink .ace_invalid {\n color:#CCFF33;\n background-color:#000000;\n}\n\n.ace-vibrant-ink .ace_invalid.ace_illegal {\n \n}\n\n.ace-vibrant-ink .ace_invalid.ace_deprecated {\n color:#CCFF33;\n background-color:#000000;\n}\n\n.ace-vibrant-ink .ace_support {\n \n}\n\n.ace-vibrant-ink .ace_support.ace_function {\n color:#FFCC00;\n}\n\n.ace-vibrant-ink .ace_function.ace_buildin {\n \n}\n\n.ace-vibrant-ink .ace_string {\n color:#66FF00;\n}\n\n.ace-vibrant-ink .ace_string.ace_regexp {\n \n}\n\n.ace-vibrant-ink .ace_comment {\n color:#9933CC;\n}\n\n.ace-vibrant-ink .ace_comment.ace_doc {\n \n}\n\n.ace-vibrant-ink .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-vibrant-ink .ace_variable {\n \n}\n\n.ace-vibrant-ink .ace_variable.ace_language {\n \n}\n\n.ace-vibrant-ink .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-vibrant-ink"})
|
||||
Loading…
Add table
Add a link
Reference in a new issue