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
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