Merge branch 'master' of https://github.com/ajaxorg/ace into cvox
This commit is contained in:
commit
23f62e015b
10 changed files with 2401 additions and 2109 deletions
|
|
@ -177,6 +177,26 @@ env.editor.commands.addCommands([{
|
|||
editor.showKeyboardShortcuts()
|
||||
})
|
||||
}
|
||||
}, {
|
||||
name: "increaseFontSize",
|
||||
bindKey: "Ctrl-+",
|
||||
exec: function(editor) {
|
||||
var size = parseInt(editor.getFontSize(), 10) || 12;
|
||||
editor.setFontSize(size + 1);
|
||||
}
|
||||
}, {
|
||||
name: "decreaseFontSize",
|
||||
bindKey: "Ctrl+-",
|
||||
exec: function(editor) {
|
||||
var size = parseInt(editor.getFontSize(), 10) || 12;
|
||||
editor.setFontSize(Math.max(size - 1 || 1));
|
||||
}
|
||||
}, {
|
||||
name: "resetFontSize",
|
||||
bindKey: "Ctrl+0",
|
||||
exec: function(editor) {
|
||||
editor.setFontSize(12);
|
||||
}
|
||||
}]);
|
||||
|
||||
|
||||
|
|
@ -199,7 +219,31 @@ var commands = env.editor.commands;
|
|||
commands.addCommand({
|
||||
name: "save",
|
||||
bindKey: {win: "Ctrl-S", mac: "Command-S"},
|
||||
exec: function() {alert("Fake Save File");}
|
||||
exec: function(arg) {
|
||||
var session = env.editor.session;
|
||||
name = session.name.match(/[^\/]+$/)
|
||||
localStorage.setItem(
|
||||
"saved_file:" + name,
|
||||
session.getValue()
|
||||
);
|
||||
env.editor.cmdLine.setValue("saved "+ name);
|
||||
}
|
||||
});
|
||||
|
||||
commands.addCommand({
|
||||
name: "load",
|
||||
bindKey: {win: "Ctrl-O", mac: "Command-O"},
|
||||
exec: function(arg) {
|
||||
var session = env.editor.session;
|
||||
name = session.name.match(/[^\/]+$/)
|
||||
var value = localStorage.getItem("saved_file:" + name);
|
||||
if (typeof value == "string") {
|
||||
session.setValue(value);
|
||||
env.editor.cmdLine.setValue("loaded "+ name);
|
||||
} else {
|
||||
env.editor.cmdLine.setValue("no previuos value saved for "+ name);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var keybindings = {
|
||||
|
|
@ -247,6 +291,7 @@ var showGutterEl = document.getElementById("show_gutter");
|
|||
var showPrintMarginEl = document.getElementById("show_print_margin");
|
||||
var highlightSelectedWordE = document.getElementById("highlight_selected_word");
|
||||
var showHScrollEl = document.getElementById("show_hscroll");
|
||||
var showVScrollEl = document.getElementById("show_vscroll");
|
||||
var animateScrollEl = document.getElementById("animate_scroll");
|
||||
var softTabEl = document.getElementById("soft_tab");
|
||||
var behavioursEl = document.getElementById("enable_behaviours");
|
||||
|
|
@ -409,7 +454,11 @@ bindCheckbox("highlight_selected_word", function(checked) {
|
|||
});
|
||||
|
||||
bindCheckbox("show_hscroll", function(checked) {
|
||||
env.editor.renderer.setHScrollBarAlwaysVisible(checked);
|
||||
env.editor.setOption("hScrollBarAlwaysVisible", checked);
|
||||
});
|
||||
|
||||
bindCheckbox("show_vscroll", function(checked) {
|
||||
env.editor.setOption("vScrollBarAlwaysVisible", checked);
|
||||
});
|
||||
|
||||
bindCheckbox("animate_scroll", function(checked) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/** vim: et:ts=4:sw=4:sts=4
|
||||
* @license RequireJS 2.1.7 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
|
||||
* @license RequireJS 2.1.8+ Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
|
||||
* Available via the MIT or new BSD license.
|
||||
* see: http://github.com/jrburke/requirejs for details
|
||||
*/
|
||||
|
|
@ -12,7 +12,7 @@ var requirejs, require, define;
|
|||
(function (global) {
|
||||
var req, s, head, baseElement, dataMain, src,
|
||||
interactiveScript, currentlyAddingScript, mainScript, subPath,
|
||||
version = '2.1.7',
|
||||
version = '2.1.8+',
|
||||
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
|
||||
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
|
||||
jsSuffixRegExp = /\.js$/,
|
||||
|
|
@ -1609,7 +1609,7 @@ var requirejs, require, define;
|
|||
|
||||
//Join the path parts together, then figure out if baseUrl is needed.
|
||||
url = syms.join('/');
|
||||
url += (ext || (/\?/.test(url) || skipExt ? '' : '.js'));
|
||||
url += (ext || (/^data\:|\?/.test(url) || skipExt ? '' : '.js'));
|
||||
url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue