Closed Bug 505526 Opened 17 years ago Closed 15 years ago

"Go Back" link should be disabled when the page is directly linked

Categories

(support.mozilla.org :: General, defect)

x86
All
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: krupa.mozbugs, Assigned: jsocol)

References

()

Details

Attachments

(1 file, 3 obsolete files)

steps to reproduce: 1.Set a watch on any of the articles. 2.Ensure that the article is modified. 3.In the email notification,right click on the link under -"If you don't want to receive these notifications follow this link:" message and open it in a new window expected results: "go back" link in the page is disabled actual result: "go back" is active and nothing happens on clicking on it
This affects a broad-range of pages so we should discuss what pages of this type should look like before we decide what the fix should involve.
Assignee: nobody → paul.craciunoiu
Target Milestone: 1.2.1 → 1.3
I've been thinking about this. Implementation-wise, here are a few suggestions on a better approach: * Show "go back" if the tab has history * Show a URL to _somewhere_ otherwise
Attached patch patch, v1 (obsolete) — — Splinter Review
Attachment #391424 - Flags: review?(laura)
Comment on attachment 391424 [details] [diff] [review] patch, v1 The referer and js history are not strictly interchangable...test it on the client side.
Attachment #391424 - Flags: review?(laura) → review-
(In reply to comment #4) > (From update of attachment 391424 [details] [diff] [review]) > The referer and js history are not strictly interchangable...test it on the > client side. I know. I misspoke in comment 2. Do we want the patch to rely on JS? I think doing it with PHP makes things much simpler.
The advantage of using JS is if they come from a non SUMO website they can go back there.
Attached patch patch, v1 (obsolete) — — Splinter Review
This uses javascript history.
Attachment #391424 - Attachment is obsolete: true
Attachment #394085 - Flags: review?(laura)
Attachment #394085 - Flags: review?(jsocol)
IE's history.length starts at 0, not 1, hiding the links in IE if it's the second page the user visits. Maybe we can put the links in by default with some extra class, then remove them onload via jQuery? That would also eliminate document.write().
Sounds good James, want a stab at it?
Attachment #394085 - Flags: review?(jsocol) → review-
Attachment #394085 - Attachment is obsolete: true
Attachment #394085 - Flags: review?(laura)
Attached patch patch,v3 (obsolete) — — Splinter Review
Uses jQuery to strip out the links instead of using document.write() to add them, and fixes the behavior in IE6/7.
Attachment #394138 - Flags: review?(paul.craciunoiu)
Comment on attachment 394138 [details] [diff] [review] patch,v3 I like the implementation, here's should be changed: * instead of adding the JS inside the page, use $headerlib->add_js + $headerlib->add_js file (see webroot/lib/headerlib.php). This will all be output in webroot/templates/styles/mozkb/footer.tpl * We are also using minify which already loads jquery.min.js - see webroot/minify.php:27
Attachment #394138 - Flags: review?(paul.craciunoiu) → review-
(In reply to comment #11) sorry, I meant ->add_js_file
Attached patch patch, v4 — — Splinter Review
Moved JavaScript to $headerlib->add_js(), stopped including jQuery, and moved the .go-back class to containing elements when applicable.
Attachment #394138 - Attachment is obsolete: true
Attachment #394329 - Flags: review?(paul.craciunoiu)
Comment on attachment 394329 [details] [diff] [review] patch, v4 What's {ldelim} and {rdelim}? I had to remove those to get the link to hide. That worked, but there's too much white space left over. Let's just leave this bug till we do more p12n stuff.
Attachment #394329 - Flags: review?(paul.craciunoiu) → review-
{ldelim} and {rdelim} are how you get braces into code parsed by Smarty. I had to add them because it was parsing the JavaScript as Smarty code: function(){if Taking them out caused fatal PHP errors on mine. But we can definitely hold off, it's hardly crucial.
Some minor fixes on this. James, if you have time after we're done with p12n bugs, you can patch this up too. But no worries :)
Assignee: paul.craciunoiu → jsocol
Target Milestone: 1.3 → ---
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: