kopia lustrzana https://github.com/c9/core
Merge remote-tracking branch 'origin/master' into single-sign-out
commit
ddfb81c264
|
@ -748,7 +748,10 @@ module.exports = function(options) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!hosted) {
|
if (!hosted) {
|
||||||
plugins.push("plugins/c9.ide.analytics/mock_analytics");
|
plugins.push(
|
||||||
|
"plugins/c9.ide.analytics/mock_analytics",
|
||||||
|
"plugins/c9.ide.services/linked-services-mock"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collab
|
// Collab
|
||||||
|
|
|
@ -350,7 +350,7 @@ module.exports = function setup(fsOptions) {
|
||||||
|
|
||||||
// This helper function doesn't follow node conventions in the callback,
|
// This helper function doesn't follow node conventions in the callback,
|
||||||
// there is no err, only entry.
|
// there is no err, only entry.
|
||||||
function createStatEntry(file, fullpath, callback) {
|
function createStatEntry(file, fullpath, callback, _loop) {
|
||||||
fs.lstat(fullpath, function (err, stat) {
|
fs.lstat(fullpath, function (err, stat) {
|
||||||
var entry = {
|
var entry = {
|
||||||
name: file
|
name: file
|
||||||
|
@ -378,26 +378,29 @@ module.exports = function setup(fsOptions) {
|
||||||
return callback(entry);
|
return callback(entry);
|
||||||
}
|
}
|
||||||
fs.readlink(fullpath, function (err, link) {
|
fs.readlink(fullpath, function (err, link) {
|
||||||
if (entry.name == link) {
|
|
||||||
entry.linkStatErr = "ELOOP: recursive symlink";
|
|
||||||
return callback(entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
entry.linkErr = err.stack;
|
entry.linkErr = err.stack;
|
||||||
return callback(entry);
|
return callback(entry);
|
||||||
}
|
}
|
||||||
|
var fullLinkPath = pathResolve(dirname(fullpath), link);
|
||||||
|
if (!_loop) {
|
||||||
|
_loop = {fullLinkPath: fullpath, max: 100};
|
||||||
|
}
|
||||||
|
if (fullLinkPath.toLowerCase() == _loop.fullLinkPath.toLowerCase() || _loop.max --< 0) {
|
||||||
|
entry.linkErr = "ELOOP: recursive symlink";
|
||||||
|
return callback(entry);
|
||||||
|
}
|
||||||
entry.link = link;
|
entry.link = link;
|
||||||
resolvePath(pathResolve(dirname(fullpath), link), {alreadyRooted: true}, function (err, newpath) {
|
resolvePath(fullLinkPath, {alreadyRooted: true}, function (err, newpath) {
|
||||||
if (err) {
|
if (err) {
|
||||||
entry.linkStatErr = err;
|
entry.linkErr = err;
|
||||||
return callback(entry);
|
return callback(entry);
|
||||||
}
|
}
|
||||||
createStatEntry(basename(newpath), newpath, function (linkStat) {
|
createStatEntry(basename(newpath), newpath, function (linkStat) {
|
||||||
entry.linkStat = linkStat;
|
entry.linkStat = linkStat;
|
||||||
linkStat.fullPath = newpath.substr(base.length) || "/";
|
linkStat.fullPath = newpath.substr(base.length) || "/";
|
||||||
return callback(entry);
|
return callback(entry);
|
||||||
});
|
}, _loop);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "c9",
|
"name": "c9",
|
||||||
"description": "New Cloud9 Client",
|
"description": "New Cloud9 Client",
|
||||||
"version": "3.1.176",
|
"version": "3.1.207",
|
||||||
"author": "Ajax.org B.V. <info@ajax.org>",
|
"author": "Ajax.org B.V. <info@ajax.org>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "bin/c9",
|
"main": "bin/c9",
|
||||||
|
|
|
@ -561,8 +561,8 @@ define(function(require, exports, module) {
|
||||||
node.size = stat.size;
|
node.size = stat.size;
|
||||||
if (stat.mtime != undefined)
|
if (stat.mtime != undefined)
|
||||||
node.mtime = stat.mtime;
|
node.mtime = stat.mtime;
|
||||||
if (original_stat)
|
if (original_stat || stat.linkErr)
|
||||||
node.link = stat.fullPath;
|
node.link = stat.fullPath || stat.linkErr;
|
||||||
node.isFolder = isFolder;
|
node.isFolder = isFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,39 +23,17 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
function main(options, imports, register) {
|
function main(options, imports, register) {
|
||||||
var Plugin = imports.Plugin;
|
var Plugin = imports.Plugin;
|
||||||
var showError = imports["dialog.error"].show;
|
|
||||||
|
|
||||||
/***** Initialization *****/
|
/***** Initialization *****/
|
||||||
|
|
||||||
var plugin = new Plugin("Ajax.org", main.consumes);
|
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||||
|
|
||||||
var requested, nativeObject;
|
var nativeObject;
|
||||||
|
|
||||||
var loaded = false;
|
var loaded = false;
|
||||||
function load(){
|
function load(){
|
||||||
if (loaded) return false;
|
if (loaded) return false;
|
||||||
loaded = true;
|
loaded = true;
|
||||||
|
|
||||||
// Chrome Specific
|
|
||||||
if (window.chrome && window.chrome.permissions) {
|
|
||||||
var chrome = window.chrome;
|
|
||||||
var permissions = {
|
|
||||||
permissions: ["clipboardRead", "clipboardWrite"],
|
|
||||||
origins: [location.origin]
|
|
||||||
};
|
|
||||||
|
|
||||||
chrome.permissions.contains(permissions, function(allowed) {
|
|
||||||
if (!allowed) {
|
|
||||||
chrome.permissions.request(permissions, function(result) {
|
|
||||||
if (result) {
|
|
||||||
showError("The browser has granted copy "
|
|
||||||
+ "and paste permissions. Restart the "
|
|
||||||
+ "browser to enable these permissions");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Methods *****/
|
/***** Methods *****/
|
||||||
|
@ -94,10 +72,7 @@ define(function(require, exports, module) {
|
||||||
};
|
};
|
||||||
document.addEventListener("copy", setData, true);
|
document.addEventListener("copy", setData, true);
|
||||||
|
|
||||||
// @todo test if this is sync
|
|
||||||
requested = true;
|
|
||||||
var result = execCommand("copy");
|
var result = execCommand("copy");
|
||||||
requested = false;
|
|
||||||
|
|
||||||
document.removeEventListener("copy", setData, true);
|
document.removeEventListener("copy", setData, true);
|
||||||
|
|
||||||
|
@ -123,10 +98,7 @@ define(function(require, exports, module) {
|
||||||
};
|
};
|
||||||
document.addEventListener("paste", getData, true);
|
document.addEventListener("paste", getData, true);
|
||||||
|
|
||||||
// @todo test if this is sync
|
|
||||||
requested = true;
|
|
||||||
var result = execCommand("paste");
|
var result = execCommand("paste");
|
||||||
requested = false;
|
|
||||||
|
|
||||||
document.removeEventListener("paste", getData, true);
|
document.removeEventListener("paste", getData, true);
|
||||||
|
|
||||||
|
@ -173,6 +145,7 @@ define(function(require, exports, module) {
|
||||||
});
|
});
|
||||||
plugin.on("unload", function(){
|
plugin.on("unload", function(){
|
||||||
loaded = false;
|
loaded = false;
|
||||||
|
nativeObject = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
/***** Register and define API *****/
|
/***** Register and define API *****/
|
||||||
|
|
|
@ -258,6 +258,8 @@ define(function(require, module, exports) {
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var currentValue = plugin.document.value;
|
||||||
|
|
||||||
editorType = type;
|
editorType = type;
|
||||||
amlTab.setAttribute("type", "editor::" + type);
|
amlTab.setAttribute("type", "editor::" + type);
|
||||||
|
@ -265,6 +267,11 @@ define(function(require, module, exports) {
|
||||||
if (amlPane.getPage() == amlTab) {
|
if (amlPane.getPage() == amlTab) {
|
||||||
amlPane.activepage = -1;
|
amlPane.activepage = -1;
|
||||||
amlPane.set(amlTab);
|
amlPane.set(amlTab);
|
||||||
|
|
||||||
|
plugin.document.value = currentValue;
|
||||||
|
// TODO undo managers for different editors conflict
|
||||||
|
// however, resetting removes changed state
|
||||||
|
// plugin.document.undoManager.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
callback();
|
callback();
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
define(function(require, exports, module) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
main.consumes = ["Plugin"];
|
||||||
|
main.provides = ["linked-services"];
|
||||||
|
return main;
|
||||||
|
|
||||||
|
function main(options, imports, register) {
|
||||||
|
var Plugin = imports.Plugin;
|
||||||
|
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||||
|
|
||||||
|
function getServices(callback) {
|
||||||
|
setTimeout(function() {
|
||||||
|
callback(null, options.services || {
|
||||||
|
"github": {
|
||||||
|
"visible": true,
|
||||||
|
"hasRepositories": true,
|
||||||
|
"service": "github",
|
||||||
|
"title": "GitHub",
|
||||||
|
"accounts": [],
|
||||||
|
"maxAccounts": 1,
|
||||||
|
"maxProjects": 100
|
||||||
|
},
|
||||||
|
"mbed": {
|
||||||
|
"visible": false,
|
||||||
|
"hasRepositories": false,
|
||||||
|
"service": "mbed",
|
||||||
|
"title": "Mbed",
|
||||||
|
"accounts": [{
|
||||||
|
"id": "mbed:154229",
|
||||||
|
"login": "fjakobs",
|
||||||
|
"metadata": {},
|
||||||
|
"projects": []
|
||||||
|
}],
|
||||||
|
"maxAccounts": 1,
|
||||||
|
"maxProjects": 100
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAccessToken(serviceId, callback) {
|
||||||
|
callback(new Error("Not Implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides client-side Salesforce API access
|
||||||
|
* @singleton
|
||||||
|
**/
|
||||||
|
plugin.freezePublicAPI({
|
||||||
|
getServices: getServices,
|
||||||
|
getAccessToken: getAccessToken
|
||||||
|
});
|
||||||
|
|
||||||
|
register(null, {
|
||||||
|
"linked-services": plugin
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
|
@ -456,20 +456,25 @@ define(function(require, exports, module) {
|
||||||
case "dropdown":
|
case "dropdown":
|
||||||
var dropdown = el.lastChild;
|
var dropdown = el.lastChild;
|
||||||
|
|
||||||
var data = item.items.map(function(item) {
|
if (item.items) {
|
||||||
return "<item value='" + item.value
|
var data = item.items.map(function(item) {
|
||||||
+ "'><![CDATA[" + item.caption + "]]></item>";
|
return "<item value='" + item.value
|
||||||
}).join("");
|
+ "'><![CDATA[" + item.caption + "]]></item>";
|
||||||
if (data) {
|
}).join("");
|
||||||
setTimeout(function(){
|
if (data) {
|
||||||
dropdown.$model.load("<items>" + data + "</items>");
|
|
||||||
|
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
var value = item.value || dropdown.value;
|
dropdown.$model.load("<items>" + data + "</items>");
|
||||||
dropdown.value = -999;
|
|
||||||
dropdown.setAttribute("value", value);
|
setTimeout(function(){
|
||||||
|
var value = item.value || dropdown.value;
|
||||||
|
dropdown.value = -999;
|
||||||
|
dropdown.setAttribute("value", value);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
else if (item.value) {
|
||||||
|
dropdown.setAttribute("value", item.value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -41,10 +41,12 @@ function getDefaultSettings() {
|
||||||
|
|
||||||
var suffix = hostname.trim().split("-").pop() || "";
|
var suffix = hostname.trim().split("-").pop() || "";
|
||||||
var modes = {
|
var modes = {
|
||||||
|
"workflowstaging": "workflow-staging",
|
||||||
"prod": "deploy",
|
"prod": "deploy",
|
||||||
"beta": "beta",
|
"beta": "beta",
|
||||||
"dev": "devel",
|
"dev": "devel",
|
||||||
"onlinedev": "onlinedev"
|
"onlinedev": "onlinedev",
|
||||||
|
"test": "test"
|
||||||
};
|
};
|
||||||
return modes[suffix] || "devel";
|
return modes[suffix] || "devel";
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue