Merge pull request +15131 from c9/ide-preview-issues

popout application preview to a tab in a separate process
pull/389/head
Harutyun Amirjanyan 2017-01-05 18:45:33 +04:00 zatwierdzone przez GitHub
commit 624ba1ca8b
5 zmienionych plików z 17 dodań i 8 usunięć

Wyświetl plik

@ -101,7 +101,7 @@
"c9.ide.newresource": "#636e7a7345", "c9.ide.newresource": "#636e7a7345",
"c9.ide.openfiles": "#2ae85a9e33", "c9.ide.openfiles": "#2ae85a9e33",
"c9.ide.preview": "#5f5fff0185", "c9.ide.preview": "#5f5fff0185",
"c9.ide.preview.browser": "#829f0ac50f", "c9.ide.preview.browser": "#9ecfff638d",
"c9.ide.preview.markdown": "#c3174d86e0", "c9.ide.preview.markdown": "#c3174d86e0",
"c9.ide.pubsub": "#99b7289040", "c9.ide.pubsub": "#99b7289040",
"c9.ide.readonly": "#7421caab61", "c9.ide.readonly": "#7421caab61",

Wyświetl plik

@ -1,8 +1,3 @@
/**
* Utilities for the Ajax.org Cloud IDE
*
* @copyright 2013, Ajax.org B.V.
*/
define(function(require, exports, module) { define(function(require, exports, module) {
main.consumes = ["c9", "Plugin"]; main.consumes = ["c9", "Plugin"];
main.provides = ["util"]; main.provides = ["util"];
@ -30,6 +25,19 @@ define(function(require, exports, module) {
return '"' + name + '"'; return '"' + name + '"';
}; };
// on chrome this opens tab in a new process
plugin.openNewWindow = function(url) {
var a = document.createElement("a");
a.rel = "noreferrer";
a.target = "_blank";
a.href = url;
document.body.appendChild(a);
a.click();
setTimeout(function() {
a.remove();
});
};
var SupportedIcons = (function() { var SupportedIcons = (function() {
var extToClass = Object.create(null); var extToClass = Object.create(null);
var classToExt = { var classToExt = {

Wyświetl plik

@ -184,7 +184,7 @@ define(function(require, exports, module) {
if (inPreview) if (inPreview)
commands.exec("preview", null, { path: href }); commands.exec("preview", null, { path: href });
else else
window.open(href); util.openNewWindow(href);
} }
function open(e) { function open(e) {

Wyświetl plik

@ -386,6 +386,7 @@ function Reloader(win, console) {
// Keys // Keys
var ckb; var ckb;
function setKeys(list) { function setKeys(list) {
if (window.opener) return; // do not forward keys when not in iframe
ckb = {}; ckb = {};
list.forEach(function(item) { list.forEach(function(item) {

Wyświetl plik

@ -84,7 +84,7 @@ function main(argv, config, onLoaded) {
.describe("exclude", "Exclude specified service") .describe("exclude", "Exclude specified service")
.describe("include", "Include only specified service") .describe("include", "Include only specified service")
.describe("helpWithSudo", "Ask for sudo password on startup") .describe("helpWithSudo", "Ask for sudo password on startup")
.default("domains", inContainer && process.env.C9_HOSTNAME || process.env.C9_DOMAINS) .default("domains", inContainer && [process.env.C9_HOSTNAME || process.env.C9_DOMAINS, "c9.io"])
.boolean("help") .boolean("help")
.describe("help", "Show command line options."); .describe("help", "Show command line options.");