diff --git a/IPython/html/static/base/js/namespace.js b/IPython/html/static/base/js/namespace.js
index 291e113..8b5b76b 100644
--- a/IPython/html/static/base/js/namespace.js
+++ b/IPython/html/static/base/js/namespace.js
@@ -5,5 +5,6 @@ var IPython = IPython || {};
define([], function(){
"use strict";
IPython.version = "3.0.0-dev";
+ IPython._target = '_blank';
return IPython;
});
diff --git a/IPython/html/static/edit/js/menubar.js b/IPython/html/static/edit/js/menubar.js
index 5b7dac5..ef5f9ae 100644
--- a/IPython/html/static/edit/js/menubar.js
+++ b/IPython/html/static/edit/js/menubar.js
@@ -49,7 +49,7 @@ define([
// File
this.element.find('#new-file').click(function () {
- var w = window.open();
+ var w = window.open(undefined, IPython._target);
// Create a new file in the current directory
var parent = utils.url_path_split(editor.file_path)[0];
editor.contents.new_untitled(parent, {type: "file"}).then(
diff --git a/IPython/html/static/notebook/js/kernelselector.js b/IPython/html/static/notebook/js/kernelselector.js
index 0c45116..62ad606 100644
--- a/IPython/html/static/notebook/js/kernelselector.js
+++ b/IPython/html/static/notebook/js/kernelselector.js
@@ -273,7 +273,7 @@ define([
KernelSelector.prototype.new_notebook = function (kernel_name) {
- var w = window.open();
+ var w = window.open(undefined, IPython._target);
// Create a new notebook in the same path as the current
// notebook's path.
var that = this;
diff --git a/IPython/html/static/notebook/js/menubar.js b/IPython/html/static/notebook/js/menubar.js
index 270ba38..24464fd 100644
--- a/IPython/html/static/notebook/js/menubar.js
+++ b/IPython/html/static/notebook/js/menubar.js
@@ -76,7 +76,7 @@ define([
notebook_path
) + "?download=" + download.toString();
- var w = window.open();
+ var w = window.open(undefined, IPython._target);
if (this.notebook.dirty) {
this.notebook.save_notebook().then(function() {
w.location = url;
@@ -101,7 +101,7 @@ define([
this.element.find('#open_notebook').click(function () {
var parent = utils.url_path_split(that.notebook.notebook_path)[0];
- window.open(utils.url_join_encode(that.base_url, 'tree', parent));
+ window.open(utils.url_join_encode(that.base_url, 'tree', parent), IPython._target);
});
this.element.find('#copy_notebook').click(function () {
that.notebook.copy_notebook();
diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js
index 9569a6f..d9c68f3 100644
--- a/IPython/html/static/notebook/js/notebook.js
+++ b/IPython/html/static/notebook/js/notebook.js
@@ -2033,7 +2033,7 @@ define(function (require) {
Notebook.prototype.copy_notebook = function () {
var that = this;
var base_url = this.base_url;
- var w = window.open();
+ var w = window.open(undefined, IPython._target);
var parent = utils.url_path_split(this.notebook_path)[0];
this.contents.copy(this.notebook_path, parent).then(
function (data) {
diff --git a/IPython/html/static/tree/js/newnotebook.js b/IPython/html/static/tree/js/newnotebook.js
index c4183a3..2256bfa 100644
--- a/IPython/html/static/tree/js/newnotebook.js
+++ b/IPython/html/static/tree/js/newnotebook.js
@@ -75,7 +75,7 @@ define([
/** create and open a new notebook */
var that = this;
kernel_name = kernel_name || this.default_kernel;
- var w = window.open();
+ var w = window.open(undefined, IPython._target);
this.contents.new_untitled(that.notebook_path, {type: "notebook"}).then(
function (data) {
var url = utils.url_join_encode(
diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js
index b4b191b..901cc14 100644
--- a/IPython/html/static/tree/js/notebooklist.js
+++ b/IPython/html/static/tree/js/notebooklist.js
@@ -73,7 +73,7 @@ define([
if (!NotebookList._bound_singletons) {
NotebookList._bound_singletons = true;
$('#new-file').click(function(e) {
- var w = window.open();
+ var w = window.open(undefined, IPython._target);
that.contents.new_untitled(that.notebook_path || '', {type: 'file', ext: '.txt'}).then(function(data) {
var url = utils.url_join_encode(
that.base_url, 'edit', data.path
@@ -568,7 +568,7 @@ define([
// directory nav doesn't open new tabs
// files, notebooks do
if (model.type !== "directory") {
- link.attr('target','_blank');
+ link.attr('target',IPython._target);
}
};
diff --git a/IPython/html/static/tree/js/terminallist.js b/IPython/html/static/tree/js/terminallist.js
index b7524ce..8616549 100644
--- a/IPython/html/static/tree/js/terminallist.js
+++ b/IPython/html/static/tree/js/terminallist.js
@@ -42,7 +42,7 @@ define([
};
TerminalList.prototype.new_terminal = function () {
- var w = window.open();
+ var w = window.open(undefined, IPython._target);
var base_url = this.base_url;
var settings = {
type : "POST",
@@ -93,7 +93,7 @@ define([
item.find(".item_icon").addClass("fa fa-terminal");
var link = item.find("a.item_link")
.attr('href', utils.url_join_encode(this.base_url, "terminals", name));
- link.attr('target', '_blank');
+ link.attr('target', IPython._target||'_blank');
this.add_shutdown_button(name, item);
};