Bug 970807

Summary: When you click a Docbuilder Edit Topic link, it doesn't open in a new tab.
Product: [Community] PressGang CCMS Reporter: Jared MORGAN <jmorgan>
Component: DocBook-builderAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.1   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jared MORGAN 2013-06-05 00:36:17 UTC
Description of problem:

When you are proofing a Docbuilder doc, and spot an error in the document, you click the edit topic link and the topic opens in the same tab. You fix the error, then use the back button to return to docbuilder. But your position is lost and you have to try and remember where you were up to again. 


Version-Release number of selected component (if applicable):

Build 201305221423

How reproducible:

100%

Steps to Reproduce:
1. From a docbuilder build, click an Edit this topic link.
2. Click back to the docbuilder build.
3. Observe the behavior.

Actual results:

The position in the docbuilder build resets to the top of the book, not where you previously were. This may have something to do with the fact that there are no IDREFs in the URL like there are on docs-stage.

Expected results:

You are returned to the position you were in in the document, or the edit topic window opens in a new tab.

Additional info:

This was encountered on Chrome.

Comment 1 Lee Newson 2013-06-05 00:49:50 UTC
Unfortunately this is something we can't do anything about easily and would have to do some post processing to achieve this (ie after a publican build). The problem is that to make it open in a new tab you have to set the href target to "_blank", however this has to be done during the XSL transformation and the docbook xsl stylesheets only allow the target parameter to be set on a global scale.

So to do this, here are some steps that I see we could take:

1. Do a second XSL transformation on the HTML to fix the Edit Links.
2. Alter the HTML and include some JavaScript to make the edit links open in a new window.
3. Look into incorporating the Anchor used for the current placement into the GWT application url (although this still wouldn't work when scrolling the document)

Comment 2 Jared MORGAN 2013-06-05 01:28:17 UTC
As a work-around, you just need to remember to use your muscle memory and "open in new tab". Which I'm quite happy to develop in the short term. 

Could we just use a combination of Greasemonkey scripts in the short term? One that treats all Edit this topic links as new tabs? I know it isn't a solid long term solution, but it could be a quick fix in the short term?

Comment 3 Lee Newson 2013-06-05 01:54:06 UTC
Hehe, I was actually going to create a GreaseMonkey script to do that anyways :)

Comment 5 Joshua Wulf 2013-12-15 23:13:18 UTC
Additional reason: there is a lot of javascript processing happening on the page. You click a "edit this topic" link and you lose all of that spell checking, link checking, duplicate topic checking, etc.

When you realize that you opened the topic in the same tab to edit it, and click back, the page has to do all that client-side work again, and it takes a significant amount of time.

Using javascript to make the topics open in a new tab is pretty easy. It could be added to the Presszilla script.

Comment 6 Joshua Wulf 2013-12-15 23:15:02 UTC
*** Bug 1043319 has been marked as a duplicate of this bug. ***