diff --git a/.eslintrc b/.eslintrc index ec9e26df..36d90769 100644 --- a/.eslintrc +++ b/.eslintrc @@ -54,30 +54,23 @@ rules: no-did-update-set-state: 1 no-direct-mutation-state: 1 no-is-mounted: 1 - no-multi-comp: 1 - no-set-state: 1 - no-string-refs: 1 no-unknown-property: 1 prefer-es6-class: [1, "never"] prop-types: 1 react-in-jsx-scope: 1 - require-extension: [1, { extensions: [".js", ".jsx"] }] self-closing-comp: 1 sort-comp: 1 wrap-multilines: 1 jsx-boolean-value: [1, "always"] jsx-equals-spacing: 1 - jsx-handler-names: 1 jsx-indent-props: 1 jsx-key: 1 jsx-indent: 1 - jsx-max-props-per-line: [1, { maximum: 3 }] + jsx-max-props-per-line: [1, { maximum: 5 }] jsx-no-bind: 1 jsx-no-duplicate-props: 1 - jsx-no-literals: 1 jsx-no-undef: 1 jsx-pascal-case: 1 - jsx-sort-props: 1 jsx-uses-react: 1 default-case: 3 diff --git a/configs/client-default.js b/configs/client-default.js index b3379962..d8cf7b69 100644 --- a/configs/client-default.js +++ b/configs/client-default.js @@ -261,6 +261,7 @@ module.exports = function(options) { "plugins/c9.ide.dialog.common/fileremove", "plugins/c9.ide.dialog.common/info", "plugins/c9.ide.dialog.common/question", + "plugins/c9.ide.dialog.common/upsell", { packagePath: "plugins/c9.ide.dialog.common/error", staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic" @@ -545,7 +546,7 @@ module.exports = function(options) { { packagePath: "plugins/c9.ide.layout.classic/preload", themePrefix: options.themePrefix, - defaultTheme: options.defaultTheme || "flat-light" + defaultTheme: options.defaultTheme || "dark" }, { packagePath: "plugins/c9.ide.tree/tree", diff --git a/node_modules/architect-build/compress.js b/node_modules/architect-build/compress.js index 343f5d70..75cf9808 100644 --- a/node_modules/architect-build/compress.js +++ b/node_modules/architect-build/compress.js @@ -11,8 +11,9 @@ function compress(sources, opts) { var literals = []; sources.forEach(function(pkg){ - if (/^"disable compress"/.test(pkg.source)) + if (/"disable compress"/.test(pkg.source)) { return literals.push(pkg.source); + } if (pkg.file) console.log("Adding '" + pkg.file + "'."); diff --git a/package.json b/package.json index c202dff7..b6d6ec5e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "c9", "description": "New Cloud9 Client", - "version": "3.1.1421", + "version": "3.1.1451", "author": "Ajax.org B.V. ", "private": true, "main": "bin/c9", @@ -87,7 +87,7 @@ "c9.ide.dialog.wizard": "#7667ec79a8", "c9.ide.fontawesome": "#781602c5d8", "c9.ide.format": "#5ec97fb083", - "c9.ide.help.support": "#98a1b45962", + "c9.ide.help.support": "#af5c4055b2", "c9.ide.imgeditor": "#612e75ef4f", "c9.ide.immediate": "#a962119bec", "c9.ide.installer": "#0fde9f0067", diff --git a/plugins/c9.ide.dialog.common/upsell.js b/plugins/c9.ide.dialog.common/upsell.js new file mode 100644 index 00000000..0200a9ba --- /dev/null +++ b/plugins/c9.ide.dialog.common/upsell.js @@ -0,0 +1,85 @@ +define(function(require, module, exports) { + main.consumes = ["Dialog", "util"]; + main.provides = ["dialog.upsell"]; + return main; + + function main(options, imports, register) { + var Dialog = imports.Dialog; + var util = imports.util; + + /***** Initialization *****/ + + var plugin = new Dialog("Ajax.org", main.consumes, { + name: "dialog.upsell", + allowClose: true, + modal: true, + elements: [ + { type: "filler" }, + { type: "button", id: "no", caption: "Cancel", hotkey: "ESC", skin: "c9-simple-btn", margin: "7 10 0 0" }, + { type: "button", id: "yes", caption: "Go Premium!", color: "green", "default": true, hotkey: "Y" } + ] + }); + + /***** Methods *****/ + + function show(onYes, onNo, title, header, msg, options) { + if (!options) + options = {isHTML: true}; + + return plugin.queue(function(){ + var all = options.all; + var cancel = options.cancel; + var showDontAsk = options.showDontAsk; + var metadata = options.metadata; + + title = title || "This is a Premium feature"; + header = header || "Get Premium Support Now!"; + msg = msg || 'Help is just a few clicks away. Check out our amazing premium plans.' + + plugin.title = title; + plugin.heading = options && options.isHTML ? header : util.escapeXml(header); + plugin.body = options && options.isHTML ? msg : util.escapeXml(msg).replace(/\n/g, "
"); + + plugin.getElement("yes").setCaption(options.yes || "Go Premium!"); + plugin.getElement("no").setCaption(options.no || "Cancel"); + + plugin.allowClose = cancel; + + var gotYesNo = false; + plugin.once("hide", function(){ + !gotYesNo && cancel && onNo(false, true, metadata); + }); + + plugin.update([ + { id: "yes", onclick: function(){ + gotYesNo = true; + plugin.hide(); + onYes(false, metadata); + }}, + { id: "no", onclick: function(){ + gotYesNo = true; + plugin.hide(); + onNo(false, false, metadata); + }} + ]); + }, options.queue === false); + } + + /***** Register *****/ + + /** + * + */ + plugin.freezePublicAPI({ + + /** + * + */ + show: show + }); + + register("", { + "dialog.upsell": plugin + }); + } +}); \ No newline at end of file diff --git a/plugins/c9.ide.dialog/dialog.js b/plugins/c9.ide.dialog/dialog.js index d7fc753d..bf5d15e3 100644 --- a/plugins/c9.ide.dialog/dialog.js +++ b/plugins/c9.ide.dialog/dialog.js @@ -301,7 +301,7 @@ define(function(require, module, exports) { break; case "button": node = new ui.button({ - skin: "btn-default-css3", + skin: options.skin || "btn-default-css3", "class" : options.color ? "btn-" + options.color : "", margin: options.margin, caption: options.caption || "", diff --git a/plugins/c9.vfs.client/endpoint.js b/plugins/c9.vfs.client/endpoint.js index 50e6bb85..c90ff5e3 100644 --- a/plugins/c9.vfs.client/endpoint.js +++ b/plugins/c9.vfs.client/endpoint.js @@ -87,7 +87,7 @@ define(function(require, exports, module) { // first time take the ones from the options var _servers = servers; - if (_servers) { + if (_servers && _servers.length) { servers = null; return callback(null, _servers); }