This repository was archived by the owner on Oct 8, 2021. It is now read-only.
Patch for issue #1024 (Duplicate pages created in DOM)#1456
Closed
okoskimi wants to merge 9 commits into
Closed
Conversation
added 9 commits
April 8, 2011 15:22
Conflicts: js/jquery.mobile.navigation.js tests/unit/navigation/index.html tests/unit/navigation/navigation_core.js
Conflicts: js/jquery.mobile.navigation.js tests/unit/navigation/navigation_core.js
|
Great work. We'll take a look at this and get back to you with some feedback soon! |
|
This issue should be fixed in latest, as all URLs are now normalized to a full absolute path. I'm closing this one out, but please let us know if you find any issues with the current build. Again, thanks so much for the ideas. They really helped! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1024
This patch extends path.clean() in jquery.mobile.navigation.js to canonicalize URLs:
The patch changes the semantics for a "hash-absolute" url of type "#/dir1/dir2/file.html". Before the patch, this referred to file /dir1/dir2/file.html. However, you get the same semantics also without the hash, i.e. "/dir1/dir2/file.html" means the same thing. The patch changes the semantics to be so that "#/" refers to$.mobile.firstPage (i.e. location.pathname), and anything after that is interpreted as being relative to location.pathname (i.e. "#/dir1/dir2/file.html" is interpreted the same as the "#dir1/dir2/file.html"). The idea is that the "hash-absolute" urls now let you refer to both $ .mobile.firstPage and other files in a consistent way.
See path.clean() comments for more details.
Unit tests have been added for the new functionality. Tested on Chrome, Firefox and IE8. Unit tests pass where they pass for the original code (i.e. there are some tests that did not work for IE8 in the original code either).
BR,
--Oskari