moving files from pilot to ace where they more properly belong
This commit is contained in:
parent
a48d0e7688
commit
1e24a23ca5
17 changed files with 1176 additions and 44 deletions
39
demo/boot.js
39
demo/boot.js
|
|
@ -35,6 +35,7 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
require({
|
||||
paths: {
|
||||
demo: "../demo",
|
||||
|
|
@ -44,16 +45,42 @@ require({
|
|||
}
|
||||
});
|
||||
|
||||
var deps = [ "pilot/fixoldbrowsers", "pilot/plugin_manager", "pilot/settings",
|
||||
"pilot/environment", "demo/demo" ];
|
||||
var deps = [ "pilot/fixoldbrowsers", "ace/plugin_manager",
|
||||
"ace/environment", "demo/demo" ];
|
||||
|
||||
var plugins = [ "pilot/index", "cockpit/index", "ace/defaults" ];
|
||||
var plugins = [ "pilot/index", "cockpit/index", "ace/index" ];
|
||||
require(deps, function() {
|
||||
var catalog = require("pilot/plugin_manager").catalog;
|
||||
var catalog = require("ace/plugin_manager").catalog;
|
||||
catalog.registerPlugins(plugins).then(function() {
|
||||
var env = require("pilot/environment").create();
|
||||
var env = require("ace/environment").create();
|
||||
catalog.startupPlugins({ env: env }).then(function() {
|
||||
require("demo/demo").launch(env);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
*/
|
||||
|
||||
require({
|
||||
paths: {
|
||||
demo: "../demo",
|
||||
ace: "../lib/ace",
|
||||
cockpit: "../support/cockpit/lib/cockpit",
|
||||
pilot: "../support/cockpit/support/pilot/lib/pilot"
|
||||
}
|
||||
});
|
||||
|
||||
var deps = [
|
||||
"ace/environment", "pilot/index", "cockpit/index", "ace/index",
|
||||
"pilot/fixoldbrowsers"
|
||||
];
|
||||
|
||||
require(deps, function(environment, pilot, cockpit) {
|
||||
var data = { env: environment.create() };
|
||||
pilot.startup(data);
|
||||
cockpit.startup(data);
|
||||
new cockpit.CliView(data.env);
|
||||
|
||||
require([ "demo/demo" ], function(demo) {
|
||||
demo.launch(data.env);
|
||||
});
|
||||
}.bind(this));
|
||||
|
|
|
|||
20
demo/demo.js
20
demo/demo.js
|
|
@ -77,7 +77,7 @@ exports.launch = function(env) {
|
|||
custom: new HashHandler({
|
||||
"gotoright": "Tab"
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
var docs = {};
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ exports.launch = function(env) {
|
|||
}
|
||||
docs.plain = new EditSession(loreIpsum);
|
||||
docs.plain.setUseWrapMode(true);
|
||||
docs.plain.setWrapLimitRange(80, 80)
|
||||
docs.plain.setWrapLimitRange(80, 80);
|
||||
docs.plain.setMode(new TextMode());
|
||||
docs.plain.setUndoManager(new UndoManager());
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ exports.launch = function(env) {
|
|||
docs.svg = new EditSession(document.getElementById("svgtext").innerHTML.replace("<", "<"));
|
||||
docs.svg.setMode(new SvgMode());
|
||||
docs.svg.setUndoManager(new UndoManager());
|
||||
|
||||
|
||||
docs.textile = new EditSession(document.getElementById("textiletext").innerHTML);
|
||||
docs.textile.setMode(new TextileMode());
|
||||
docs.textile.setUndoManager(new UndoManager());
|
||||
|
|
@ -383,11 +383,11 @@ exports.launch = function(env) {
|
|||
});
|
||||
|
||||
window.env = env;
|
||||
|
||||
|
||||
/**
|
||||
* This demonstrates how you can define commands and bind shortcuts to them.
|
||||
*/
|
||||
|
||||
|
||||
// Command to focus the command line from the editor.
|
||||
canon.addCommand({
|
||||
name: "focuscli",
|
||||
|
|
@ -400,7 +400,7 @@ exports.launch = function(env) {
|
|||
env.cli.cliView.element.focus();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Command to focus the editor line from the command line.
|
||||
canon.addCommand({
|
||||
name: "focuseditor",
|
||||
|
|
@ -413,7 +413,7 @@ exports.launch = function(env) {
|
|||
env.editor.focus();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Fake-Save, works from the editor and the command line.
|
||||
canon.addCommand({
|
||||
name: "save",
|
||||
|
|
@ -426,7 +426,7 @@ exports.launch = function(env) {
|
|||
alert("Fake Save File");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Fake-Print with custom lookup-sender-match function.
|
||||
canon.addCommand({
|
||||
name: "save",
|
||||
|
|
@ -435,9 +435,9 @@ exports.launch = function(env) {
|
|||
mac: "Command-P",
|
||||
sender: function(env, sender, hashId, keyString) {
|
||||
if (sender == "editor") {
|
||||
return true;
|
||||
return true;
|
||||
} else {
|
||||
alert("Sorry, can only print from the editor");
|
||||
alert("Sorry, can only print from the editor");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue