Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

open notebook copy in different tabs #2128

Merged
merged 1 commit into from Jul 12, 2012

Conversation

Projects
None yet
3 participants
Owner

Carreau commented Jul 12, 2012

use time since epoch to avoid reusing the same tab
fixes #2120
as long as one dos not open more that one tab per second.

Owner

ellisonbg commented Jul 12, 2012

This looks great.

Owner

minrk commented Jul 12, 2012

I think this is the wrong approach. The target should just be _blank, which is always a new tab/window. No sensitivity to time or anything.

Owner

ellisonbg commented Jul 12, 2012

So what is causing it to open in the same tab then?

On Thu, Jul 12, 2012 at 8:56 AM, Min RK
reply@reply.github.com
wrote:

I think this is the wrong approach. The target should just be _blank, which is always a new tab/window. No sensitivity to time or anything.


Reply to this email directly or view it on GitHub:
#2128 (comment)

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

Owner

ellisonbg commented Jul 12, 2012

I could swear that it used to work perfectly.

On Thu, Jul 12, 2012 at 9:00 AM, Brian Granger ellisonbg@gmail.com wrote:

So what is causing it to open in the same tab then?

On Thu, Jul 12, 2012 at 8:56 AM, Min RK
reply@reply.github.com
wrote:

I think this is the wrong approach. The target should just be _blank, which is always a new tab/window. No sensitivity to time or anything.


Reply to this email directly or view it on GitHub:
#2128 (comment)

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

Owner

Carreau commented Jul 12, 2012

it does the same with _blank if any of the main page or its fork call window.open(url,'_blank') it will load in the forked tabs.

Owner

Carreau commented Jul 12, 2012

Note that it works the first time correctly but not afterward, as if _newtab was an identifier of the newly open tab.
You can try from js console in any website, it does the same. That not from our side.

Owner

Carreau commented Jul 12, 2012

Also I used time to be sure to have 2 different number, I can write a randint function but that's more line of code and overkill.

Owner

minrk commented Jul 12, 2012

@Carreau - that is not true of _blank. _blank is a special identifier, and you can click on the same link a hundred times and it will open a hundred new tabs.

For example:

target=_new_tab

target=_blank

Owner

Carreau commented Jul 12, 2012

@minrk
That was my first thought; but I tried and it wasn't working... I might have mistyped, i'll try again.

open notebook copy in different tabs
returning false to allow modifier+click,
otherwise open 2 tabs at once.
Owner

Carreau commented Jul 12, 2012

So my bad, I should have misstype, but I can swear that this was the first thing I tryed.
updated and force pushed.
A ended with a return false otherwise ctrl-click open both the copy and the curent notebook in 2 new tabs.
It has the side effect of opening in a new tab instead of a new window also.
I let you merge.

Owner

minrk commented Jul 12, 2012

No worries.

This looks good to me now. Thanks!

Owner

Carreau commented Jul 12, 2012

cool, merging !

Carreau added a commit that referenced this pull request Jul 12, 2012

Merge pull request #2128 from Carreau/fixes-2120
open notebook copy in different tabs

@Carreau Carreau merged commit 6ce7c7a into ipython:master Jul 12, 2012

Carreau added a commit to Carreau/ipython that referenced this pull request Jul 13, 2012

open notebook copy in different tabs
returning false to allow modifier+click,
otherwise open 2 tabs at once.

fixes #2120

backported to 0.13.1 from PR #2128

minrk added a commit that referenced this pull request Jul 21, 2012

Backport PR #2128: open notebook copy in different tabs
use time since epoch to avoid reusing the same tab
fixes #2120
as long as one dos not open more that one tab per second.

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014

Merge pull request #2128 from Carreau/fixes-2120
open notebook copy in different tabs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment