kopia lustrzana https://github.com/c9/core
Merge pull request +10423 from c9/update-experiments
Update experiments, make FTP experimental for new userspull/223/head
commit
22403f13c4
|
@ -90,7 +90,7 @@
|
|||
"c9.ide.imgeditor": "#03a313cbab",
|
||||
"c9.ide.immediate": "#a962119bec",
|
||||
"c9.ide.installer": "#0fde9f0067",
|
||||
"c9.ide.mount": "#3e017a3324",
|
||||
"c9.ide.mount": "#c4b3a1e4b7",
|
||||
"c9.ide.navigate": "#c191d9b92f",
|
||||
"c9.ide.newresource": "#981a408a7b",
|
||||
"c9.ide.openfiles": "#7fa4a97fed",
|
||||
|
@ -106,9 +106,9 @@
|
|||
"c9.ide.run.build": "#0598fff697",
|
||||
"c9.ide.run.debug.xdebug": "#61dcbd0180",
|
||||
"c9.ide.save": "#76cf52ab6d",
|
||||
"c9.ide.scm": "#7b0f69a149",
|
||||
"c9.ide.scm": "#bd5ca2557c",
|
||||
"c9.ide.terminal.monitor": "#b76f1c9f24",
|
||||
"c9.ide.test": "#a1c0d9e5e0",
|
||||
"c9.ide.test": "#f3e5dad5cc",
|
||||
"c9.ide.test.mocha": "#586fb0cdc2",
|
||||
"c9.ide.theme.flat": "#92cda0fb40",
|
||||
"c9.ide.threewaymerge": "#229382aa0b",
|
||||
|
|
|
@ -42,7 +42,7 @@ define(function(require, exports, module) {
|
|||
var plugins = [];
|
||||
|
||||
var ENABLED = c9.location.indexOf("debug=2") > -1;
|
||||
var HASSDK = experimental.addExperiment("sdk=0", "SDK/Load Custom Plugins");;
|
||||
var HASSDK = experimental.addExperiment("sdk", false, "SDK/Load Custom Plugins");;
|
||||
|
||||
var reParts = /^(builders|keymaps|modes|outline|runners|snippets|themes)\/(.*)/;
|
||||
var reModule = /(?:_highlight_rules|_test|_worker|_fold|_behaviou?r)\.js$/;
|
||||
|
|
|
@ -27,7 +27,7 @@ define(function(require, exports, module) {
|
|||
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||
var emit = plugin.getEmitter();
|
||||
|
||||
var HASSDK = experimental.addExperiment("sdk=0", "SDK/Load Custom Plugins");
|
||||
var HASSDK = experimental.addExperiment("sdk", false, "SDK/Load Custom Plugins");
|
||||
|
||||
var installing;
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ define(function(require, exports, module) {
|
|||
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||
// var emit = plugin.getEmitter();
|
||||
|
||||
var ENABLED = experimental.addExperiment("plugins=0", "SDK/Load Plugins From Workspace");
|
||||
var HASSDK = experimental.addExperiment("sdk=0", "SDK/Load Custom Plugins");
|
||||
var ENABLED = experimental.addExperiment("plugins", false, "SDK/Load Plugins From Workspace");
|
||||
var HASSDK = experimental.addExperiment("sdk", false, "SDK/Load Custom Plugins");
|
||||
|
||||
var plugins = options.plugins;
|
||||
var loadFromDisk = options.loadFromDisk
|
||||
|
|
|
@ -96,19 +96,19 @@ define(function(require, exports, module) {
|
|||
|
||||
/***** Initialization *****/
|
||||
|
||||
var ENABLED = c9.location.indexOf("debug=2") > -1
|
||||
|| experimental.addExperiment("plugin-manager", false, "SDK/Plugin Manager");
|
||||
|
||||
var plugin = new PreferencePanel("Ajax.org", main.consumes, {
|
||||
caption: "Plugin Manager",
|
||||
className: "plugins",
|
||||
form: false,
|
||||
noscroll: true,
|
||||
index: 200
|
||||
index: 200,
|
||||
visible: ENABLED,
|
||||
});
|
||||
// var emit = plugin.getEmitter();
|
||||
|
||||
// var HASSDK = experimental.addExperiment("sdk=0", "SDK/Load Custom Plugins");
|
||||
var ENABLED = c9.location.indexOf("debug=2") > -1;
|
||||
var MANAGER = experimental.addExperiment("plugin-manager=1", "SDK/Plugin Manager");
|
||||
|
||||
var model, datagrid, filterbox;
|
||||
var btnUninstall, btnReport, btnReadme, btnCloud9, btnReload;
|
||||
|
||||
|
@ -117,7 +117,7 @@ define(function(require, exports, module) {
|
|||
if (loaded) return false;
|
||||
loaded = true;
|
||||
|
||||
if (!MANAGER && !ENABLED) return;
|
||||
if (!ENABLED) return;
|
||||
|
||||
// @TODO enable/disable plugins -> move to ext
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ define(function(require, exports, module) {
|
|||
var emit = handle.getEmitter();
|
||||
emit.setMaxListeners(1000);
|
||||
|
||||
var HASSDK = experimental.addExperiment("sdk=0", "SDK/Load Custom Plugins");
|
||||
var HASSDK = experimental.addExperiment("sdk", false, "SDK/Load Custom Plugins");
|
||||
|
||||
function focusOpenPackages(){
|
||||
var pages = tabs.getTabs();
|
||||
|
|
|
@ -50,7 +50,7 @@ define(function(require, exports, module) {
|
|||
intro.$int.innerHTML =
|
||||
'<h1>Experimental Features (reload to apply changes)</h1><p style="white-space:normal">Cloud9 is continuously in '
|
||||
+ 'development. New features in alpha or beta are first hidden '
|
||||
+ 'and can be enabled via this page. <i>Use at your own risk</i></p>';
|
||||
+ 'and can be enabled via this page. <i>Use at your own risk</i>.</p>';
|
||||
}
|
||||
|
||||
/***** Methods *****/
|
||||
|
@ -58,12 +58,10 @@ define(function(require, exports, module) {
|
|||
// =0 means the value should be set to 0 to disable otherwise it is enabled
|
||||
// =1 means the value should be set to 1 to enable otherwise it is disabled
|
||||
var found = {};
|
||||
function addExperiment(query, name){
|
||||
var key = query.split("=");
|
||||
var defValue = Number(key[1]); key = key[0];
|
||||
var uniqueId = key.replace(/\//g, "-");
|
||||
function addExperiment(name, defaultValue, caption){
|
||||
var uniqueId = name.replace(/\//g, "-");
|
||||
|
||||
var parts = name.split("/");
|
||||
var parts = caption.split("/");
|
||||
var current, obj = { "Experimental": current = {} };
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
current[parts[i]] = current = {};
|
||||
|
@ -79,18 +77,18 @@ define(function(require, exports, module) {
|
|||
}
|
||||
};
|
||||
|
||||
if (!found[name])
|
||||
if (!found[caption])
|
||||
plugin.add(obj, plugin);
|
||||
found[name] = true;
|
||||
found[caption] = true;
|
||||
|
||||
settings.setDefaults("state/experiments", [[uniqueId, !defValue]]);
|
||||
settings.setDefaults("state/experiments", [[uniqueId, Number(defaultValue)]]);
|
||||
|
||||
// return value from url if present, otherwise return the setting
|
||||
var idx = c9.location.indexOf(key + "=");
|
||||
var idx = c9.location.indexOf(name + "=");
|
||||
if (idx !== -1) {
|
||||
if (c9.location.indexOf(key + "=0") != -1)
|
||||
if (c9.location.indexOf(name + "=0") != -1)
|
||||
return false;
|
||||
if (c9.location.indexOf(key + "=1") != -1)
|
||||
if (c9.location.indexOf(name + "=1") != -1)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -122,7 +120,15 @@ define(function(require, exports, module) {
|
|||
],
|
||||
|
||||
/**
|
||||
* Define a new experimental feature.
|
||||
*
|
||||
* @param {String} name The internal name of this experiment, e.g. foo
|
||||
*
|
||||
* @param {Boolean} defaultValue The default state of this experiment when not configure
|
||||
*
|
||||
* @param {String} caption The name of this setting in the UI, e.g. SDK/Plugin Manager
|
||||
*
|
||||
* @return {Boolean} true if this experiment is currently enabled
|
||||
*/
|
||||
addExperiment: addExperiment
|
||||
});
|
||||
|
|
|
@ -18,6 +18,7 @@ define(function(require, module, exports) {
|
|||
var caption = options.caption;
|
||||
var noscroll = options.noscroll;
|
||||
var className = options.className || "";
|
||||
var visible = options.visible == null || options.visible;
|
||||
var index = options.index || 100;
|
||||
var headings = {};
|
||||
var subHeadings = {};
|
||||
|
@ -240,6 +241,8 @@ define(function(require, module, exports) {
|
|||
/***** LifeCycle *****/
|
||||
|
||||
plugin.on("load", function(){
|
||||
if (!visible) return;
|
||||
|
||||
navHtml = prefs.addNavigation(caption, index, null, plugin);
|
||||
navHtml.addEventListener("mousedown", function(){
|
||||
prefs.activate(plugin);
|
||||
|
|
Ładowanie…
Reference in New Issue