kopia lustrzana https://github.com/c9/core
Merge remote-tracking branch 'origin/master' into tweaks
commit
93af6fd7a5
|
@ -9,7 +9,7 @@ During the alpha stage, expect many things to break, not work or simply fail.
|
||||||
|
|
||||||
#### Creating Plugins ####
|
#### Creating Plugins ####
|
||||||
|
|
||||||
The best and easiest way to create plugins is on c9.io. Please check out this tutorial for how to [get started writing plugins.](http://cloud9-sdk.readme.io/v0.1/docs/getting-started)
|
The best and easiest way to create plugins is on c9.io. Please check out this tutorial for how to [get started writing plugins.](http://cloud9-sdk.readme.io/v0.1/docs/getting-started-with-cloud9-plugins)
|
||||||
|
|
||||||
We also have a tutorial for how to get started working on the core plugins. [Check out that tutorial here.](http://cloud9-sdk.readme.io/v0.1/docs/contributing-to-existing-packages)
|
We also have a tutorial for how to get started working on the core plugins. [Check out that tutorial here.](http://cloud9-sdk.readme.io/v0.1/docs/contributing-to-existing-packages)
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ case "$uname" in
|
||||||
*x86_64*) arch=x64 ;;
|
*x86_64*) arch=x64 ;;
|
||||||
*i*86*) arch=x86 ;;
|
*i*86*) arch=x86 ;;
|
||||||
*armv6l*) arch=arm-pi ;;
|
*armv6l*) arch=arm-pi ;;
|
||||||
|
*armv7l*) arch=arm-pi ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
showStatus () { printf "\e[1A\e[0K\r%s\n" $1; }
|
showStatus () { printf "\e[1A\e[0K\r%s\n" $1; }
|
||||||
|
|
|
@ -24,6 +24,7 @@ case "$uname" in
|
||||||
*x86_64*) arch=x64 ;;
|
*x86_64*) arch=x64 ;;
|
||||||
*i*86*) arch=x86 ;;
|
*i*86*) arch=x86 ;;
|
||||||
*armv6l*) arch=arm-pi ;;
|
*armv6l*) arch=arm-pi ;;
|
||||||
|
*armv7l*) arch=arm-pi ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
showStatus () { printf "\e[1A\e[0K\r%s\n" $1; }
|
showStatus () { printf "\e[1A\e[0K\r%s\n" $1; }
|
||||||
|
@ -89,7 +90,7 @@ console.log('Client Plugins:');
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('CLI Plugins:');
|
console.log('CLI Plugins:');
|
||||||
plugins = require('./configs/cli');
|
plugins = require('./configs/cli')();
|
||||||
copy.dirs('$SOURCE', '$APPDIR', pluginDirs(plugins), {
|
copy.dirs('$SOURCE', '$APPDIR', pluginDirs(plugins), {
|
||||||
exclude: /^mock$/,
|
exclude: /^mock$/,
|
||||||
});
|
});
|
||||||
|
|
|
@ -733,10 +733,14 @@ CodeMirror.defineExtension = function(name, fn) {
|
||||||
CodeMirror.prototype[name] = fn;
|
CodeMirror.prototype[name] = fn;
|
||||||
};
|
};
|
||||||
dom.importCssString(".normal-mode .ace_cursor{\
|
dom.importCssString(".normal-mode .ace_cursor{\
|
||||||
border: 0!important;\
|
border: 1px solid red;\
|
||||||
background-color: red;\
|
background-color: red;\
|
||||||
opacity: 0.5;\
|
opacity: 0.5;\
|
||||||
}.ace_dialog {\
|
}\
|
||||||
|
.normal-mode .ace_hidden-cursors .ace_cursor{\
|
||||||
|
background-color: transparent;\
|
||||||
|
}\
|
||||||
|
.ace_dialog {\
|
||||||
position: absolute;\
|
position: absolute;\
|
||||||
left: 0; right: 0;\
|
left: 0; right: 0;\
|
||||||
background: white;\
|
background: white;\
|
||||||
|
@ -762,23 +766,6 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||||
font-family: monospace;\
|
font-family: monospace;\
|
||||||
}", "vimMode");
|
}", "vimMode");
|
||||||
(function() {
|
(function() {
|
||||||
function dialogDiv(cm, template, bottom) {
|
|
||||||
var wrap = cm.ace.container;
|
|
||||||
var dialog;
|
|
||||||
dialog = wrap.appendChild(document.createElement("div"));
|
|
||||||
if (bottom)
|
|
||||||
dialog.className = "ace_dialog ace_dialog-bottom";
|
|
||||||
else
|
|
||||||
dialog.className = "ace_dialog ace_dialog-top";
|
|
||||||
|
|
||||||
if (typeof template == "string") {
|
|
||||||
dialog.innerHTML = template;
|
|
||||||
} else { // Assuming it's a detached DOM element.
|
|
||||||
dialog.appendChild(template);
|
|
||||||
}
|
|
||||||
return dialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeNotification(cm, newVal) {
|
function closeNotification(cm, newVal) {
|
||||||
if (cm.state.currentNotificationClose)
|
if (cm.state.currentNotificationClose)
|
||||||
cm.state.currentNotificationClose();
|
cm.state.currentNotificationClose();
|
||||||
|
@ -5814,7 +5801,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
return isHandled;
|
return isHandled;
|
||||||
};
|
}
|
||||||
exports.CodeMirror = CodeMirror;
|
exports.CodeMirror = CodeMirror;
|
||||||
var getVim = Vim.maybeInitVimState_;
|
var getVim = Vim.maybeInitVimState_;
|
||||||
exports.handler = {
|
exports.handler = {
|
||||||
|
@ -5828,9 +5815,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||||
if (!vim.insertMode) {
|
if (!vim.insertMode) {
|
||||||
var isbackwards = !sel.cursor
|
var isbackwards = !sel.cursor
|
||||||
? session.selection.isBackwards() || session.selection.isEmpty()
|
? session.selection.isBackwards() || session.selection.isEmpty()
|
||||||
: Range.comparePoints(sel.cursor, sel.start) <= 0
|
: Range.comparePoints(sel.cursor, sel.start) <= 0;
|
||||||
if (!isbackwards && left > w)
|
if (!isbackwards && left > w)
|
||||||
left -= w
|
left -= w;
|
||||||
}
|
}
|
||||||
if (!vim.insertMode && vim.status) {
|
if (!vim.insertMode && vim.status) {
|
||||||
h = h / 2;
|
h = h / 2;
|
||||||
|
@ -5991,16 +5978,16 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
var renderVirtualNumbers = {
|
var renderVirtualNumbers = {
|
||||||
getText: function(session, row) {
|
getText: function(session, row) {
|
||||||
return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9? "\xb7" : "" ))) + ""
|
return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9? "\xb7" : "" ))) + "";
|
||||||
},
|
},
|
||||||
getWidth: function(session, lastLineNumber, config) {
|
getWidth: function(session, lastLineNumber, config) {
|
||||||
return session.getLength().toString().length * config.characterWidth;
|
return session.getLength().toString().length * config.characterWidth;
|
||||||
},
|
},
|
||||||
update: function(e, editor) {
|
update: function(e, editor) {
|
||||||
editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER)
|
editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER);
|
||||||
},
|
},
|
||||||
attach: function(editor) {
|
attach: function(editor) {
|
||||||
editor.renderer.$gutterLayer.$renderer = this;
|
editor.renderer.$gutterLayer.$renderer = this;
|
||||||
|
@ -6042,7 +6029,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||||
if (cm.ace.inVirtualSelectionMode)
|
if (cm.ace.inVirtualSelectionMode)
|
||||||
cm.ace.on("beforeEndOperation", delayedExecAceCommand);
|
cm.ace.on("beforeEndOperation", delayedExecAceCommand);
|
||||||
else
|
else
|
||||||
delayedExecAceCommand(null, cm.ace)
|
delayedExecAceCommand(null, cm.ace);
|
||||||
};
|
};
|
||||||
function delayedExecAceCommand(op, ace) {
|
function delayedExecAceCommand(op, ace) {
|
||||||
ace.off("beforeEndOperation", delayedExecAceCommand);
|
ace.off("beforeEndOperation", delayedExecAceCommand);
|
||||||
|
|
|
@ -5,7 +5,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var hashing = require('./hashing');
|
var hashing = require('./hashing');
|
||||||
var bcrypt = require('bcrypt');
|
var bcrypt;
|
||||||
|
try {
|
||||||
|
bcrypt = require('bcrypt');
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Failed to load brcrypt - binary version mismatch?", e.stack);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
var SALT_LENGTH = 8;
|
var SALT_LENGTH = 8;
|
||||||
|
|
||||||
exports.encrypt = function(password, callback) {
|
exports.encrypt = function(password, callback) {
|
||||||
|
|
|
@ -130,6 +130,20 @@ module.exports = function setup(fsOptions) {
|
||||||
fsOptions.defaultEnv = process.env;
|
fsOptions.defaultEnv = process.env;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fetch environment variables from the login shell
|
||||||
|
if (!isWin) {
|
||||||
|
_execFile(BASH, ["-lc", "printenv -0"], function(error, stdout, stderr) {
|
||||||
|
if (!error && !stderr && stdout) {
|
||||||
|
var env = fsOptions.defaultEnv;
|
||||||
|
stdout.split("\x00").forEach(function(entry) {
|
||||||
|
var i = entry.indexOf("=");
|
||||||
|
if (i != -1)
|
||||||
|
env[entry.slice(0, i)] = entry.slice(i + 1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Storage for extension APIs
|
// Storage for extension APIs
|
||||||
var apis = {};
|
var apis = {};
|
||||||
// Storage for event handlers
|
// Storage for event handlers
|
||||||
|
|
|
@ -59,16 +59,16 @@
|
||||||
"c9.ide.language.javascript.eslint": "#cf4b2d05af",
|
"c9.ide.language.javascript.eslint": "#cf4b2d05af",
|
||||||
"c9.ide.language.javascript.tern": "#a65ad88dd9",
|
"c9.ide.language.javascript.tern": "#a65ad88dd9",
|
||||||
"c9.ide.language.javascript.infer": "#ebb2daf81a",
|
"c9.ide.language.javascript.infer": "#ebb2daf81a",
|
||||||
"c9.ide.language.jsonalyzer": "#722983bf96",
|
"c9.ide.language.jsonalyzer": "#5262f6b4b9",
|
||||||
"c9.ide.collab": "#74e0a2d340",
|
"c9.ide.collab": "#74e0a2d340",
|
||||||
"c9.ide.local": "#2bfd7ff051",
|
"c9.ide.local": "#2bfd7ff051",
|
||||||
"c9.ide.find": "#989c06e6a7",
|
"c9.ide.find": "#989c06e6a7",
|
||||||
"c9.ide.find.infiles": "#28b3cfcb47",
|
"c9.ide.find.infiles": "#28b3cfcb47",
|
||||||
"c9.ide.find.replace": "#43a6b95e6a",
|
"c9.ide.find.replace": "#43a6b95e6a",
|
||||||
"c9.ide.run.debug": "#8421e5e3a5",
|
"c9.ide.run.debug": "#789019f9a7",
|
||||||
"c9.ide.ace.emmet": "#e5f1a92ac3",
|
"c9.ide.ace.emmet": "#e5f1a92ac3",
|
||||||
"c9.ide.ace.gotoline": "#4d1a93172c",
|
"c9.ide.ace.gotoline": "#4d1a93172c",
|
||||||
"c9.ide.ace.keymaps": "#1e42293fb9",
|
"c9.ide.ace.keymaps": "#2477fd8ac6",
|
||||||
"c9.ide.ace.repl": "#ada99852fa",
|
"c9.ide.ace.repl": "#ada99852fa",
|
||||||
"c9.ide.ace.split": "#0ae0151c78",
|
"c9.ide.ace.split": "#0ae0151c78",
|
||||||
"c9.ide.ace.statusbar": "#d7b45bb7c3",
|
"c9.ide.ace.statusbar": "#d7b45bb7c3",
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
"c9.ide.readonly": "#f6f07bbe42",
|
"c9.ide.readonly": "#f6f07bbe42",
|
||||||
"c9.ide.recentfiles": "#7c099abf40",
|
"c9.ide.recentfiles": "#7c099abf40",
|
||||||
"c9.ide.remote": "#37773d905b",
|
"c9.ide.remote": "#37773d905b",
|
||||||
"c9.ide.run": "#0a8cc7f0a9",
|
"c9.ide.run": "#d3873e1447",
|
||||||
"c9.ide.run.build": "#6726030127",
|
"c9.ide.run.build": "#6726030127",
|
||||||
"c9.ide.save": "#a32a8f4346",
|
"c9.ide.save": "#a32a8f4346",
|
||||||
"c9.ide.terminal.monitor": "#df9936daa2",
|
"c9.ide.terminal.monitor": "#df9936daa2",
|
||||||
|
|
|
@ -124,12 +124,6 @@ define(function(require, exports, module) {
|
||||||
return usedBy
|
return usedBy
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadRemotePlugin(id, options, callback) {
|
|
||||||
vfs.extend(id, options, function(err, meta) {
|
|
||||||
callback(err, meta && meta.api);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function unloadAllPlugins(exclude) {
|
function unloadAllPlugins(exclude) {
|
||||||
if (lut.settings)
|
if (lut.settings)
|
||||||
lut.settings.unload(null, true);
|
lut.settings.unload(null, true);
|
||||||
|
@ -160,6 +154,12 @@ define(function(require, exports, module) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadRemotePlugin(id, options, callback) {
|
||||||
|
vfs.extend(id, options, function(err, meta) {
|
||||||
|
callback(err, meta && meta.api);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function fetchRemoteApi(id, callback) {
|
function fetchRemoteApi(id, callback) {
|
||||||
vfs.use(id, {}, function(err, meta) {
|
vfs.use(id, {}, function(err, meta) {
|
||||||
callback(err, meta && meta.api);
|
callback(err, meta && meta.api);
|
||||||
|
|
|
@ -2075,7 +2075,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
/***** Lifecycle *****/
|
/***** Lifecycle *****/
|
||||||
|
|
||||||
//@todo set selection, scroll and file in header
|
// @todo set selection, scroll and file in header
|
||||||
|
|
||||||
plugin.on("load", function(){
|
plugin.on("load", function(){
|
||||||
|
|
||||||
|
@ -2102,7 +2102,7 @@ define(function(require, exports, module) {
|
||||||
doc.on("setValue", function set(e) {
|
doc.on("setValue", function set(e) {
|
||||||
var aceSession = c9Session.session;
|
var aceSession = c9Session.session;
|
||||||
if (!aceSession)
|
if (!aceSession)
|
||||||
return; //This is probably a deconstructed document
|
return; // This is probably a deconstructed document
|
||||||
|
|
||||||
// The first value that is set should clear the undo stack
|
// The first value that is set should clear the undo stack
|
||||||
// additional times setting the value should keep it.
|
// additional times setting the value should keep it.
|
||||||
|
@ -2115,7 +2115,7 @@ define(function(require, exports, module) {
|
||||||
hideProgress();
|
hideProgress();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.state)
|
if (e.state) // There is nowhere where e.state is set. Dead code?
|
||||||
setState(doc, e.state);
|
setState(doc, e.state);
|
||||||
|
|
||||||
if (currentDocument === doc)
|
if (currentDocument === doc)
|
||||||
|
|
|
@ -185,7 +185,7 @@ define(function(require, module, exports) {
|
||||||
|
|
||||||
tabs.on("paneCreate", function(e) {
|
tabs.on("paneCreate", function(e) {
|
||||||
if (hidden && container && ui.isChildOf(container, e.pane.aml)) {
|
if (hidden && container && ui.isChildOf(container, e.pane.aml)) {
|
||||||
e.pane.visible = false;
|
e.pane._visible = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ define(function(require, module, exports) {
|
||||||
maxHeight = window.innerHeight - 70;
|
maxHeight = window.innerHeight - 70;
|
||||||
|
|
||||||
getPanes().forEach(function(pane) {
|
getPanes().forEach(function(pane) {
|
||||||
pane.visible = !shouldHide;
|
pane._visible = !shouldHide;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!shouldHide && !tabs.focussedTab) {
|
if (!shouldHide && !tabs.focussedTab) {
|
||||||
|
|
|
@ -330,7 +330,7 @@ define(function(require, module, exports) {
|
||||||
get editor(){ return editor; },
|
get editor(){ return editor; },
|
||||||
set editor(v) {
|
set editor(v) {
|
||||||
editor = v;
|
editor = v;
|
||||||
emit("setEditor", {editor: v});
|
emit("setEditor", { editor: v });
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Whether the document is fully loaded
|
* Whether the document is fully loaded
|
||||||
|
@ -340,7 +340,7 @@ define(function(require, module, exports) {
|
||||||
set ready(v) {
|
set ready(v) {
|
||||||
if (ready) throw new Error("Permission Denied");
|
if (ready) throw new Error("Permission Denied");
|
||||||
ready = true;
|
ready = true;
|
||||||
emit.sticky("ready");
|
emit.sticky("ready", { doc: plugin });
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* The tooltip displayed when hovering over the tab button
|
* The tooltip displayed when hovering over the tab button
|
||||||
|
@ -349,7 +349,7 @@ define(function(require, module, exports) {
|
||||||
get tooltip(){ return tooltip; },
|
get tooltip(){ return tooltip; },
|
||||||
set tooltip(v) {
|
set tooltip(v) {
|
||||||
tooltip = v;
|
tooltip = v;
|
||||||
emit("setTooltip", {tooltip: v});
|
emit("setTooltip", { tooltip: v });
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* The title of the document (displayed as caption of the tab button)
|
* The title of the document (displayed as caption of the tab button)
|
||||||
|
@ -358,18 +358,18 @@ define(function(require, module, exports) {
|
||||||
get title(){ return title; },
|
get title(){ return title; },
|
||||||
set title(v) {
|
set title(v) {
|
||||||
title = v;
|
title = v;
|
||||||
emit("setTitle", {title: v});
|
emit("setTitle", { title: v });
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Sets or retrieves the serialized value of this document.
|
* Sets or retrieves the serialized value of this document.
|
||||||
* Setting this document will not change the undo stack. Set
|
* Setting this property will not change the undo stack. Set
|
||||||
* this property only to initialize the document or to reset
|
* this property only to initialize the document or to reset
|
||||||
* the value of this document. Requesting the value of this
|
* the value of this document. Requesting the value of this
|
||||||
* document will cause it to serialize it's full state.
|
* document will cause it to serialize it's full state.
|
||||||
* @property {String} value
|
* @property {String} value
|
||||||
*/
|
*/
|
||||||
get value(){
|
get value(){
|
||||||
var calculated = emit("getValue", {value: value});
|
var calculated = emit("getValue", { value: recentValue || value });
|
||||||
if (typeof calculated != "string")
|
if (typeof calculated != "string")
|
||||||
calculated = value;
|
calculated = value;
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ define(function(require, module, exports) {
|
||||||
},
|
},
|
||||||
set value(v) {
|
set value(v) {
|
||||||
value = recentValue = v;
|
value = recentValue = v;
|
||||||
emit("setValue", {value: v});
|
emit("setValue", { value: v });
|
||||||
hasValue = true;
|
hasValue = true;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -205,7 +205,8 @@ define(function(require, module, exports) {
|
||||||
|
|
||||||
/***** Register and define API *****/
|
/***** Register and define API *****/
|
||||||
|
|
||||||
plugin.freezePublicAPI.baseclass();
|
// This is a base class
|
||||||
|
plugin.baseclass();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Editor base class for Cloud9 Editors. Each file that is opened
|
* Editor base class for Cloud9 Editors. Each file that is opened
|
||||||
|
|
|
@ -657,20 +657,18 @@ define(function(require, module, exports) {
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get group(){
|
get group(){
|
||||||
function getGroup(amlPane) {
|
var pNode = amlPane.parentNode;
|
||||||
var pNode = amlPane.parentNode;
|
|
||||||
|
|
||||||
if (pNode.localName.indexOf("splitbox") == -1)
|
if (pNode.localName.indexOf("splitbox") == -1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var result = pNode.childNodes.map(function(aml) {
|
var result = [];
|
||||||
return aml.cloud9pane;
|
pNode.childNodes.forEach(function(aml) {
|
||||||
});
|
if (aml.cloud9pane)
|
||||||
// result.__defineGetter__("group", function(){
|
result.push(aml.cloud9pane);
|
||||||
// return getGroup(pNode)
|
});
|
||||||
// });
|
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -703,7 +701,8 @@ define(function(require, module, exports) {
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get visible(){ return visible; },
|
get visible(){ return visible; },
|
||||||
set visible(v){ visible = v; },
|
set visible(v){ amlPane.setProperty("visible", v); visible = v; },
|
||||||
|
set _visible(v){ visible = v; },
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the meta object for this panel
|
* Retrieves the meta object for this panel
|
||||||
|
|
|
@ -137,7 +137,7 @@ define(function(require, module, exports) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function findItem(compressedItem) {
|
function findItem(compressedItem) {
|
||||||
return emit("itemFind", {state: compressedItem});
|
return emit("itemFind", { state: compressedItem });
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset(){
|
function reset(){
|
||||||
|
@ -205,8 +205,8 @@ define(function(require, module, exports) {
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* var undoManager = new UndoManager();
|
* var undoManager = new UndoManager();
|
||||||
* undoManager.add(new Item("a", 0)); // data = ["a"]
|
* undoManager.add(new Item("a").redo()); // data = ["a"]
|
||||||
* undoManager.add(new Item("b", 1)); // data = ["a", "b"]
|
* undoManager.add(new Item("b").redo()); // data = ["a", "b"]
|
||||||
*
|
*
|
||||||
* undoManager.undo(); // data = ["a"];
|
* undoManager.undo(); // data = ["a"];
|
||||||
* undoManager.undo(); // data = [];
|
* undoManager.undo(); // data = [];
|
||||||
|
|
|
@ -288,12 +288,12 @@ define(function(require, exports, module) {
|
||||||
return commands;
|
return commands;
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset(noReload){
|
function reset(noReload, toDefault){
|
||||||
commandManager.commandKeyBinding = {};
|
commandManager.commandKeyBinding = {};
|
||||||
|
|
||||||
Object.keys(commands).forEach(function(name) {
|
Object.keys(commands).forEach(function(name) {
|
||||||
var cmd = commands[name];
|
var cmd = commands[name];
|
||||||
bindKey(cmd.originalBindKey, cmd);
|
bindKey(toDefault ? cmd.originalBindKey : cmd.bindKey, cmd);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (noReload)
|
if (noReload)
|
||||||
|
|
|
@ -173,9 +173,10 @@ define(function(require, exports, module) {
|
||||||
"By resetting your keybindings to their "
|
"By resetting your keybindings to their "
|
||||||
+ "defaults you will lose all custom keybindings.",
|
+ "defaults you will lose all custom keybindings.",
|
||||||
function(){
|
function(){
|
||||||
|
settings.setJson("user/key-bindings", []);
|
||||||
settings.set("user/ace/@keyboardmode", "default");
|
settings.set("user/ace/@keyboardmode", "default");
|
||||||
settings.set("user/key-bindings/@platform", "auto");
|
settings.set("user/key-bindings/@platform", "auto");
|
||||||
reset();
|
commands.reset(false, true);
|
||||||
}, function(){});
|
}, function(){});
|
||||||
},
|
},
|
||||||
position: 90
|
position: 90
|
||||||
|
|
|
@ -16,7 +16,7 @@ define(function(require, exports, module) {
|
||||||
var plugin = new Plugin("Ajax.org", main.consumes);
|
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||||
var emit = plugin.getEmitter();
|
var emit = plugin.getEmitter();
|
||||||
|
|
||||||
var urlServers;
|
var urlServers, lastVfs;
|
||||||
var query = require("url").parse(document.location.href, true).query;
|
var query = require("url").parse(document.location.href, true).query;
|
||||||
if (query.vfs) {
|
if (query.vfs) {
|
||||||
if (!query.vfs.match(/^https:\/\/.*\/vfs$/))
|
if (!query.vfs.match(/^https:\/\/.*\/vfs$/))
|
||||||
|
@ -164,7 +164,6 @@ define(function(require, exports, module) {
|
||||||
return callback(new Error("Disconnected: Could not reach your workspace. Please try again later."));
|
return callback(new Error("Disconnected: Could not reach your workspace. Please try again later."));
|
||||||
|
|
||||||
var server = servers[i];
|
var server = servers[i];
|
||||||
|
|
||||||
auth.request(server.url + "/" + options.pid, {
|
auth.request(server.url + "/" + options.pid, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
timeout: 120000,
|
timeout: 120000,
|
||||||
|
@ -268,22 +267,24 @@ define(function(require, exports, module) {
|
||||||
};
|
};
|
||||||
|
|
||||||
var data = JSON.stringify(vfs);
|
var data = JSON.stringify(vfs);
|
||||||
var oldData = window.sessionStorage.getItem("vfsid");
|
|
||||||
|
var oldData = lastVfs || window.sessionStorage.getItem("vfsid");
|
||||||
if (oldData && oldData !== data)
|
if (oldData && oldData !== data)
|
||||||
deleteOldVfs();
|
deleteOldVfs();
|
||||||
|
|
||||||
try {
|
lastVfs = data;
|
||||||
window.sessionStorage.setItem("vfsid", data);
|
|
||||||
} catch(e) {
|
|
||||||
// could throw a quota exception
|
|
||||||
}
|
|
||||||
return vfs;
|
return vfs;
|
||||||
}
|
}
|
||||||
|
|
||||||
function recallVfs() {
|
function recallVfs() {
|
||||||
var vfs;
|
var vfs;
|
||||||
try {
|
try {
|
||||||
vfs = JSON.parse(window.sessionStorage.getItem("vfsid"));
|
vfs = JSON.parse(lastVfs || window.sessionStorage.getItem("vfsid"));
|
||||||
|
if (!lastVfs) {
|
||||||
|
window.sessionStorage.removeItem("vfsid");
|
||||||
|
lastVfs = JSON.stringify(vfs);
|
||||||
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
if (!vfs)
|
if (!vfs)
|
||||||
|
@ -300,10 +301,11 @@ define(function(require, exports, module) {
|
||||||
function deleteOldVfs() {
|
function deleteOldVfs() {
|
||||||
var vfs;
|
var vfs;
|
||||||
try {
|
try {
|
||||||
vfs = JSON.parse(window.sessionStorage.getItem("vfsid"));
|
vfs = JSON.parse(lastVfs || window.sessionStorage.getItem("vfsid"));
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
window.sessionStorage.removeItem("vfsid");
|
window.sessionStorage.removeItem("vfsid");
|
||||||
|
lastVfs = null;
|
||||||
if (!vfs) return;
|
if (!vfs) return;
|
||||||
|
|
||||||
auth.request(vfs.vfsid, {
|
auth.request(vfs.vfsid, {
|
||||||
|
@ -323,6 +325,22 @@ define(function(require, exports, module) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function saveToSessionStorage() {
|
||||||
|
try {
|
||||||
|
window.sessionStorage.setItem("vfsid", lastVfs);
|
||||||
|
} catch(e) {
|
||||||
|
// could throw a quota exception
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugin.on("load", function() {
|
||||||
|
window.addEventListener("unload", saveToSessionStorage);
|
||||||
|
});
|
||||||
|
|
||||||
|
plugin.on("unload", function() {
|
||||||
|
window.removeEventListener("unload", saveToSessionStorage);
|
||||||
|
});
|
||||||
|
|
||||||
/***** Register and define API *****/
|
/***** Register and define API *****/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -18,6 +18,7 @@ case "$uname" in
|
||||||
*x86_64*) arch=x64 ;;
|
*x86_64*) arch=x64 ;;
|
||||||
*i*86*) arch=x86 ;;
|
*i*86*) arch=x86 ;;
|
||||||
*armv6l*) arch=arm-pi ;;
|
*armv6l*) arch=arm-pi ;;
|
||||||
|
*armv7l*) arch=arm-pi ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if ! [[ -f ~/.c9/installed ]] && ! [[ $os == "windows" ]]; then
|
if ! [[ -f ~/.c9/installed ]] && ! [[ $os == "windows" ]]; then
|
||||||
|
|
|
@ -24,6 +24,7 @@ case "$uname" in
|
||||||
*x86_64*) arch=x64 ;;
|
*x86_64*) arch=x64 ;;
|
||||||
*i*86*) arch=x86 ;;
|
*i*86*) arch=x86 ;;
|
||||||
*armv6l*) arch=arm-pi ;;
|
*armv6l*) arch=arm-pi ;;
|
||||||
|
*armv7l*) arch=arm-pi ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue