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) {
|
||||
plugins.push("plugins/c9.ide.analytics/mock_analytics");
|
||||
plugins.push(
|
||||
"plugins/c9.ide.analytics/mock_analytics",
|
||||
"plugins/c9.ide.services/linked-services-mock"
|
||||
);
|
||||
}
|
||||
|
||||
// Collab
|
||||
|
|
|
@ -350,7 +350,7 @@ module.exports = function setup(fsOptions) {
|
|||
|
||||
// This helper function doesn't follow node conventions in the callback,
|
||||
// there is no err, only entry.
|
||||
function createStatEntry(file, fullpath, callback) {
|
||||
function createStatEntry(file, fullpath, callback, _loop) {
|
||||
fs.lstat(fullpath, function (err, stat) {
|
||||
var entry = {
|
||||
name: file
|
||||
|
@ -378,26 +378,29 @@ module.exports = function setup(fsOptions) {
|
|||
return callback(entry);
|
||||
}
|
||||
fs.readlink(fullpath, function (err, link) {
|
||||
if (entry.name == link) {
|
||||
entry.linkStatErr = "ELOOP: recursive symlink";
|
||||
return callback(entry);
|
||||
}
|
||||
|
||||
if (err) {
|
||||
entry.linkErr = err.stack;
|
||||
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;
|
||||
resolvePath(pathResolve(dirname(fullpath), link), {alreadyRooted: true}, function (err, newpath) {
|
||||
if (err) {
|
||||
entry.linkStatErr = err;
|
||||
return callback(entry);
|
||||
}
|
||||
createStatEntry(basename(newpath), newpath, function (linkStat) {
|
||||
entry.linkStat = linkStat;
|
||||
linkStat.fullPath = newpath.substr(base.length) || "/";
|
||||
return callback(entry);
|
||||
});
|
||||
resolvePath(fullLinkPath, {alreadyRooted: true}, function (err, newpath) {
|
||||
if (err) {
|
||||
entry.linkErr = err;
|
||||
return callback(entry);
|
||||
}
|
||||
createStatEntry(basename(newpath), newpath, function (linkStat) {
|
||||
entry.linkStat = linkStat;
|
||||
linkStat.fullPath = newpath.substr(base.length) || "/";
|
||||
return callback(entry);
|
||||
}, _loop);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "c9",
|
||||
"description": "New Cloud9 Client",
|
||||
"version": "3.1.176",
|
||||
"version": "3.1.207",
|
||||
"author": "Ajax.org B.V. <info@ajax.org>",
|
||||
"private": true,
|
||||
"main": "bin/c9",
|
||||
|
|
|
@ -561,8 +561,8 @@ define(function(require, exports, module) {
|
|||
node.size = stat.size;
|
||||
if (stat.mtime != undefined)
|
||||
node.mtime = stat.mtime;
|
||||
if (original_stat)
|
||||
node.link = stat.fullPath;
|
||||
if (original_stat || stat.linkErr)
|
||||
node.link = stat.fullPath || stat.linkErr;
|
||||
node.isFolder = isFolder;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,39 +23,17 @@ define(function(require, exports, module) {
|
|||
|
||||
function main(options, imports, register) {
|
||||
var Plugin = imports.Plugin;
|
||||
var showError = imports["dialog.error"].show;
|
||||
|
||||
/***** Initialization *****/
|
||||
|
||||
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||
|
||||
var requested, nativeObject;
|
||||
var nativeObject;
|
||||
|
||||
var loaded = false;
|
||||
function load(){
|
||||
if (loaded) return false;
|
||||
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 *****/
|
||||
|
@ -94,10 +72,7 @@ define(function(require, exports, module) {
|
|||
};
|
||||
document.addEventListener("copy", setData, true);
|
||||
|
||||
// @todo test if this is sync
|
||||
requested = true;
|
||||
var result = execCommand("copy");
|
||||
requested = false;
|
||||
|
||||
document.removeEventListener("copy", setData, true);
|
||||
|
||||
|
@ -123,10 +98,7 @@ define(function(require, exports, module) {
|
|||
};
|
||||
document.addEventListener("paste", getData, true);
|
||||
|
||||
// @todo test if this is sync
|
||||
requested = true;
|
||||
var result = execCommand("paste");
|
||||
requested = false;
|
||||
|
||||
document.removeEventListener("paste", getData, true);
|
||||
|
||||
|
@ -173,6 +145,7 @@ define(function(require, exports, module) {
|
|||
});
|
||||
plugin.on("unload", function(){
|
||||
loaded = false;
|
||||
nativeObject = null;
|
||||
});
|
||||
|
||||
/***** Register and define API *****/
|
||||
|
|
|
@ -259,12 +259,19 @@ define(function(require, module, exports) {
|
|||
return;
|
||||
}
|
||||
|
||||
var currentValue = plugin.document.value;
|
||||
|
||||
editorType = type;
|
||||
amlTab.setAttribute("type", "editor::" + type);
|
||||
|
||||
if (amlPane.getPage() == amlTab) {
|
||||
amlPane.activepage = -1;
|
||||
amlPane.set(amlTab);
|
||||
|
||||
plugin.document.value = currentValue;
|
||||
// TODO undo managers for different editors conflict
|
||||
// however, resetting removes changed state
|
||||
// plugin.document.undoManager.reset();
|
||||
}
|
||||
|
||||
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":
|
||||
var dropdown = el.lastChild;
|
||||
|
||||
var data = item.items.map(function(item) {
|
||||
return "<item value='" + item.value
|
||||
+ "'><![CDATA[" + item.caption + "]]></item>";
|
||||
}).join("");
|
||||
if (data) {
|
||||
setTimeout(function(){
|
||||
dropdown.$model.load("<items>" + data + "</items>");
|
||||
|
||||
if (item.items) {
|
||||
var data = item.items.map(function(item) {
|
||||
return "<item value='" + item.value
|
||||
+ "'><![CDATA[" + item.caption + "]]></item>";
|
||||
}).join("");
|
||||
if (data) {
|
||||
setTimeout(function(){
|
||||
var value = item.value || dropdown.value;
|
||||
dropdown.value = -999;
|
||||
dropdown.setAttribute("value", value);
|
||||
dropdown.$model.load("<items>" + data + "</items>");
|
||||
|
||||
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;
|
||||
default:
|
||||
|
|
|
@ -41,10 +41,12 @@ function getDefaultSettings() {
|
|||
|
||||
var suffix = hostname.trim().split("-").pop() || "";
|
||||
var modes = {
|
||||
"workflowstaging": "workflow-staging",
|
||||
"prod": "deploy",
|
||||
"beta": "beta",
|
||||
"dev": "devel",
|
||||
"onlinedev": "onlinedev"
|
||||
"onlinedev": "onlinedev",
|
||||
"test": "test"
|
||||
};
|
||||
return modes[suffix] || "devel";
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue