Fixes +9934. Show alert when using the experimental panel

pull/223/head
Ruben Daniels 2015-11-12 19:56:35 +00:00
rodzic ff93a89502
commit d568e250e4
2 zmienionych plików z 16 dodań i 6 usunięć

Wyświetl plik

@ -1,17 +1,16 @@
define(function(require, exports, module) { define(function(require, exports, module) {
main.consumes = [ main.consumes = [
"PreferencePanel", "ui", "dialog.confirm", "settings", "PreferencePanel", "ui", "dialog.alert", "settings", "c9"
"preferences", "c9"
]; ];
main.provides = ["preferences.experimental"]; main.provides = ["preferences.experimental"];
return main; return main;
function main(options, imports, register) { function main(options, imports, register) {
var PreferencePanel = imports.PreferencePanel; var PreferencePanel = imports.PreferencePanel;
var prefs = imports.preferences;
var settings = imports.settings; var settings = imports.settings;
var ui = imports.ui; var ui = imports.ui;
var c9 = imports.c9; var c9 = imports.c9;
var alert = imports["dialog.alert"].show;
/***** Initialization *****/ /***** Initialization *****/
@ -23,7 +22,7 @@ define(function(require, exports, module) {
var emit = plugin.getEmitter(); var emit = plugin.getEmitter();
emit.setMaxListeners(1000); emit.setMaxListeners(1000);
var intro; var intro, hasAlerted;
var loaded = false; var loaded = false;
function load() { function load() {
@ -71,6 +70,14 @@ define(function(require, exports, module) {
} }
current.type = "checkbox"; current.type = "checkbox";
current.setting = "state/experiments/@" + uniqueId; current.setting = "state/experiments/@" + uniqueId;
current.onchange = function(e){
if (!hasAlerted) {
alert("Refresh Needed",
"Please Refresh Cloud9 To Activate This Change",
"To see the effect of this change, please refresh Cloud9.");
hasAlerted = true;
}
}
if (!found[name]) if (!found[name])
plugin.add(obj, plugin); plugin.add(obj, plugin);

Wyświetl plik

@ -190,8 +190,11 @@ define(function(require, exports, module) {
? createBind(options.path) ? createBind(options.path)
: (options.defaultValue || ""), : (options.defaultValue || ""),
values: options.values, values: options.values,
skin: "cboffline" skin: "cboffline",
// width: "55" onafterchange: function(e) {
if (options.onchange)
options.onchange({ value: e.value });
}
}) })
]; ];
break; break;