Commit graph

44 commits

Author SHA1 Message Date
jrburke
096e90bbfe Update to relative AMD dependencies, allows proper use of source in an AMD project. 2012-01-24 14:43:24 -08:00
Ghislain Seguin
948d39b898 Added dependency on jquery 2012-01-12 21:22:00 -08:00
John Bender
0b07290873 fix timing issue where the pushstate plugin expected popstate generated hashchanges to happen before a given timeout 2012-01-10 10:47:56 -08:00
Mat Marquis
d7afc8aa78 Added download builder metadata. 2012-01-06 19:31:31 -05:00
Ghislain Seguin
57a1129bfb Discovered r.js' pragmas use them instead of the hacky solution provided by amd-stripper.js 2011-12-15 18:15:42 -08:00
Ghislain Seguin
cf04068eba Assume jquery is loaded so don't require it 2011-12-08 10:02:36 -08:00
Ghislain Seguin
63292b805d AMDized 2011-12-01 17:28:08 -08:00
Eddie Monge
5535e24c46 Update to add license to root, update individual files to not have license, add license to built and testing files 2011-11-08 15:43:36 -08:00
Eddie Monge
f6e319ef8a Standardize licenses in files and match jQuery core min license in min files 2011-10-25 11:15:19 -07:00
Kin Blas
c297f9675b Fix for issue #2644 - Navigating to root "/" does not generate clean URL if root page has id="*"
- Fixed a bug in the hashchange handler for the pushstate/replacestate plugin that was incorrectly resolving hashchanges for ids against the current location.href, which could be a different document. We now resolve id hashes against the document URL.

- Modified changePage() so that it sets the settings.dataUrl option to the documentUrl, when navigating to the first-page of the application document. This prevents any id on the first-page from being added to the location hash. This means that URLs that used to be produced like this:

	http://site.com/apps/#first-page-id

will now display as:

		http://site.com/apps/

Developers that wish to get the old behavior back can register a pagebeforechange handler and do something like this:

	$( document ).bind( "pagebeforechange", function( e, data ) {
		var toPage = data.toPage;
		if ( typeof toPage === "object" && !data.options.dataUrl && toPage[ 0 ] === $.mobile.firstPage[ 0 ] && toPage[ 0 ].id ) {
			data.options.dataUrl = "#" + toPage[ 0 ].id;
		}
	});

The handler above will make sure that any page changes to the first-page will always display as:

	http://site.com/apps/#first-page-id
2011-10-10 11:04:04 -07:00
John Bender
15cb663e52 suggestion from @jblas to save a bit of execution 2011-09-15 10:45:27 -07:00
John Bender
1a385db664 prevent known hash change handling from firing from popstate hashchange Fixes #2444 2011-09-14 15:37:31 -07:00
Kin Blas
1a92be0240 Fix for issue 2406 - Navigation from one page back to multi-page template
- Make sure that our hashchange resolves non-path hashes against the documentBase. This prevents the resulting changePath() call from incorrectly resolving against the URL for the current active (external) page.

- Fixed a problem in the push-state code. A hashchange event is *NOT* fired when navigating back (window.history.back()) from an external page to an internal page. This makes sense when you think about it since hashchange is only ever fired when the hash of the current document url changes, not when the document url itself changes. The fix was to make sure that the pushstate hashchange callback always sets a state object, even on embedded page URLs. This allows the hashchange callback to be triggered from within onPopState().
2011-09-13 00:23:03 -07:00
scottjehl
bf02fc880d increased timeout that waits for a potential hashchange event to fire as a result of pop. 2011-09-08 12:31:59 -04:00
John Bender
a3487e620d simplified the default hash handling prevention back to somthing akin to @scottjehl's original implementation 2011-08-27 02:47:54 -07:00
John Bender
76d5c49b78 minor refactor and check for defined attr 2011-08-27 01:01:54 -07:00
John Bender
6b010492b2 minor refactors in nav and pushstate for clarity 2011-08-27 01:01:54 -07:00
John Bender
82cce1fa60 fix the chrome bug and reduce the number of crazy hash juggles we do 2011-08-27 01:01:54 -07:00
John Bender
3a13a6ec75 renamed replacestate key handling method 2011-08-27 01:01:53 -07:00
John Bender
b569c1cc8b fix for dialog and subpage key url issues with replace state 2011-08-26 14:54:27 -07:00
John Bender
df9e23390f extra comments for clarity 2011-08-25 11:51:01 -07:00
John Bender
8a994d3dfa add config option for pushstate 2011-08-25 11:42:32 -07:00
John Bender
7d68059dd6 removed initial disable for spurious popstate and moved to doc ready init for late inclusion in the document instead of monkey patching 2011-08-24 15:59:06 -07:00
John Bender
657f6b8c3f make sure the popstate replacestate call uses the full href 2011-08-23 12:07:52 -07:00
John Bender
2c7789b6a3 clean scoping add, comment 2011-08-22 14:58:42 -07:00
John Bender
49eeccdde3 rescope self 2011-08-22 14:31:14 -07:00
John Bender
e3fb2e285b handle query strings for initial replaceState 2011-08-20 07:29:21 -07:00
John Bender
547afbf184 manually hoist variables 2011-08-20 07:21:49 -07:00
John Bender
1dd791175a proposed solution to the navigate, refresh, back button pushstate bug. the determination of the hash to be stored in the replaced state is done in a consistent fashion where, if there is no hash, its defaulted to the original load path by puting the logic in a central method. @scottjehl give it a try and let me know if this works for you 2011-08-19 18:54:29 -07:00
scottjehl
b438472fec if no hash is present, run a replacestate. All nav tests still passing. 2011-08-18 22:41:13 -04:00
John Bender
2c3d9bc2f1 removed extra replace state fire, need to check with @scottjehl 2011-08-18 16:25:21 -07:00
John Bender
fb5d9df56f simplified the pushstate some more 2011-08-17 16:32:59 -07:00
John Bender
b197e760fd simplified the hash handling with help from @jblas 2011-08-17 16:22:09 -07:00
John Bender
eba4e7eeb4 switched path helper 2011-08-16 17:06:55 -07:00
John Bender
b41b0573d2 leverage the path helpers to get this right 2011-08-16 13:25:04 -07:00
John Bender
72ce65767e support embedded pages as a hash since the concatenated form represents a file 2011-08-16 12:55:03 -07:00
John Bender
43b1b776d9 minor refactor for comprehension 2011-08-15 17:01:37 -07:00
scottjehl
0512916e72 centralized the hashchange fired flag 2011-08-14 10:20:14 -04:00
scottjehl
854ce44179 timeout number is arbitrary. Still looking for a way around it though. 2011-08-14 10:03:16 -04:00
scottjehl
2d29880f4c whitespace stuff 2011-08-14 09:57:12 -04:00
scottjehl
3ebe7b4218 just use location.pathname. same thing, in hindsight. 2011-08-14 09:30:33 -04:00
scottjehl
6d2f9737db conditionally trigger the hashchange after a popstate, only if it doesn't trigger its own. 2011-08-12 12:53:07 -04:00
scottjehl
e1fbaf9cce updated to support deep links to nested lists and dialog parent pages. Still battling a 2x back history issue on those. 2011-08-05 18:49:16 -04:00
scottjehl
e564eb1c5f first pass at implementing pushstate support from an external file. 2011-08-05 18:49:16 -04:00