Updating editor demo page.
This commit is contained in:
parent
7cddd67016
commit
4ec24c2a04
4 changed files with 28 additions and 2575 deletions
56
demo/boot.js
56
demo/boot.js
|
|
@ -1,56 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Skywriter.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Kevin Dangoor (kdangoor@mozilla.com)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var config = {
|
||||
paths: {
|
||||
demo: "../demo",
|
||||
ace: "../lib/ace",
|
||||
cockpit: "../support/cockpit/lib/cockpit",
|
||||
pilot: "../support/cockpit/support/pilot/lib/pilot"
|
||||
}
|
||||
};
|
||||
|
||||
require(config, ["pilot/fixoldbrowsers", "pilot/plugin_manager", "pilot/settings",
|
||||
"pilot/environment", "demo/startup"], function() {
|
||||
var catalog = require("pilot/plugin_manager").catalog;
|
||||
catalog.registerPlugins([ "pilot/index", "cockpit/index" ]).then(function() {
|
||||
var env = require("pilot/environment").create();
|
||||
catalog.startupPlugins({ env: env }).then(function() {
|
||||
require("demo/startup").launch(env);
|
||||
});
|
||||
});
|
||||
});
|
||||
2496
demo/require.js
2496
demo/require.js
File diff suppressed because it is too large
Load diff
|
|
@ -36,25 +36,21 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
|
||||
define(function(require, exports, module) {
|
||||
var event = require("pilot/event");
|
||||
var Editor = require("ace/editor").Editor;
|
||||
var Renderer = require("ace/virtual_renderer").VirtualRenderer;
|
||||
var theme = require("ace/theme/textmate");
|
||||
var Document = require("ace/document").Document;
|
||||
var JavaScriptMode = require("ace/mode/javascript").Mode;
|
||||
var CssMode = require("ace/mode/css").Mode;
|
||||
var HtmlMode = require("ace/mode/html").Mode;
|
||||
var XmlMode = require("ace/mode/xml").Mode;
|
||||
var PythonMode = require("ace/mode/python").Mode;
|
||||
var PhpMode = require("ace/mode/php").Mode;
|
||||
var TextMode = require("ace/mode/text").Mode;
|
||||
var UndoManager = require("ace/undomanager").UndoManager;
|
||||
|
||||
exports.launch = function(env) {
|
||||
|
||||
var event = require("pilot/event");
|
||||
var Editor = require("ace/editor").Editor;
|
||||
var Renderer = require("ace/virtual_renderer").VirtualRenderer;
|
||||
var theme = require("ace/theme/textmate");
|
||||
var Document = require("ace/document").Document;
|
||||
var JavaScriptMode = require("ace/mode/javascript").Mode;
|
||||
var CssMode = require("ace/mode/css").Mode;
|
||||
var HtmlMode = require("ace/mode/html").Mode;
|
||||
var XmlMode = require("ace/mode/xml").Mode;
|
||||
var PythonMode = require("ace/mode/python").Mode;
|
||||
var PhpMode = require("ace/mode/php").Mode;
|
||||
var TextMode = require("ace/mode/text").Mode;
|
||||
var UndoManager = require("ace/undomanager").UndoManager;
|
||||
|
||||
var docs = {};
|
||||
|
||||
docs.js = new Document(document.getElementById("jstext").innerHTML);
|
||||
|
|
@ -142,7 +138,7 @@ exports.launch = function(env) {
|
|||
env.editor.setTheme(themeEl.value);
|
||||
};
|
||||
themeEl.onchange = setTheme;
|
||||
setTheme();
|
||||
//setTheme();
|
||||
|
||||
|
||||
var selectEl = document.getElementById("select_style");
|
||||
|
|
@ -235,4 +231,16 @@ exports.launch = function(env) {
|
|||
});
|
||||
};
|
||||
|
||||
});
|
||||
exports.main = function main() {
|
||||
var catalog = require("pilot/plugin_manager").catalog;
|
||||
var env = require("pilot/environment").create();
|
||||
var pilot = require("pilot/index");
|
||||
var cockpit = require("cockpit/index");
|
||||
catalog.startupPlugins({
|
||||
"pilot/index": pilot,
|
||||
"cockpit/index": cockpit,
|
||||
"env": env,
|
||||
}).then(function() { exports.launch(env); });
|
||||
}
|
||||
|
||||
if (require.main == module) exports.main()
|
||||
|
|
|
|||
|
|
@ -196,9 +196,6 @@ echo $output;
|
|||
?></script>
|
||||
|
||||
<input id="cockpitInput" type="text"/>
|
||||
|
||||
<script src="demo/require.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="demo/boot.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript" data-main="./demo/startup.js" src="packages/teleport/teleport.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue