Merge branch 'theme-refactoring' of https://bitbucket.org/bachysoucy/materio-base-d7 into homeV2
This commit is contained in:
commit
2686166df2
@ -146,7 +146,7 @@ function materio_user_block_view($delta = '') {
|
||||
break;
|
||||
case 'front_link':
|
||||
$block['subject'] = '';
|
||||
$block['content'] = l('<i class="icon-home"></i><span class="text">'.t('home').'</span>', '<front>', array('html'=>true));
|
||||
$block['content'] = l('<i class="fi-home"></i><span class="text">'.t('home').'</span>', '<front>', array('html'=>true));
|
||||
break;
|
||||
}
|
||||
return $block;
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
23
sites/all/themes/gui/materiobasetheme/bower.json
Normal file
23
sites/all/themes/gui/materiobasetheme/bower.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "materiobasetheme",
|
||||
"version": "1.0.0",
|
||||
"authors": [
|
||||
"sarah garcin <sarah@g-u-i.me>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"homepage": "http://materio.com",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
],
|
||||
"dependencies": {
|
||||
"foundation": "~5.5.1",
|
||||
"history.js": "~1.8.0",
|
||||
"jquery.columnizer": "~1.6.2",
|
||||
"jquery.hotkeys": "jeresig/jquery.hotkeys#~0.2.0",
|
||||
"jquery.lazyload": "~1.9.5"
|
||||
}
|
||||
}
|
15
sites/all/themes/gui/materiobasetheme/bower_components/history.js/.bower.json
vendored
Normal file
15
sites/all/themes/gui/materiobasetheme/bower_components/history.js/.bower.json
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "history.js",
|
||||
"version": "1.8.0",
|
||||
"homepage": "https://github.com/browserstate/history.js",
|
||||
"_release": "1.8.0",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.8.0",
|
||||
"commit": "6c6c8b951b03fa725adb11b1087d73b0b6f0ac82"
|
||||
},
|
||||
"_source": "git://github.com/browserstate/history.js.git",
|
||||
"_target": "~1.8.0",
|
||||
"_originalSource": "history.js",
|
||||
"_direct": true
|
||||
}
|
4
sites/all/themes/gui/materiobasetheme/bower_components/history.js/.gitignore
vendored
Normal file
4
sites/all/themes/gui/materiobasetheme/bower_components/history.js/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
.build
|
||||
/node_modules
|
||||
/.idea
|
||||
npm-debug.log
|
141
sites/all/themes/gui/materiobasetheme/bower_components/history.js/History.md
vendored
Normal file
141
sites/all/themes/gui/materiobasetheme/bower_components/history.js/History.md
vendored
Normal file
@ -0,0 +1,141 @@
|
||||
## History
|
||||
|
||||
- v1.8b2 - June 22 2013
|
||||
- Introduced uncompressed bundled files #287
|
||||
- Copied component.json to bower.json #291 and used right tag #286
|
||||
- Fixed wrong argument passed to History.getHash() #305, #297, #292 (@Izkata)
|
||||
|
||||
- v1.8b1 - May 31 2013
|
||||
- Fixed "encoded string automatically unencoded on html5 browsers" #282, #236, #272
|
||||
|
||||
- v1.8a4 - February 13 2013
|
||||
- Fixed coffee script warnings (ExtJS & Dojo adapter, IE 6 iFrame)
|
||||
- Updated qUnit to release 1.11.0, jQuery to release 1.9.1
|
||||
|
||||
- v1.8a3 - February 5 2013
|
||||
- Added tests for Dojo and ExtJS
|
||||
- Changed setting of title and url
|
||||
- Testing status
|
||||
- All HTML5 Native Adapter fail in all browsers on Test 10
|
||||
- All other HTML5 tests work fine
|
||||
- All other HTML4 tests fail in Test 4 (in IE)
|
||||
|
||||
- v1.8a2 - January 21 2013
|
||||
- Fixed hashchange / statechange triggers: e.g. if a user in a HTML5 browser clicks a link, statechange is fired, in a HTML4 browser only hashchange, but state has also changed
|
||||
- UTF8 / url encoding / decoding tested and so resolved: #64, #107, #108, #162, #177, #187, #205, #207, #210, #228, #251
|
||||
- Fixed #244
|
||||
|
||||
- v1.8a1 - January 19 2013
|
||||
- Pass options to `init()` as json is now supported
|
||||
- Added unicode demo
|
||||
- Introduced `getCurrentIndex()`, so you can get previous state by `History.getStateByIndex(getCurrentIndex()-1)`
|
||||
- Fixed HTML4 endless loop when url starts with a slash (e.g. /welcome/hello) #239, #232, #185
|
||||
- Bundled and compressed all scripts
|
||||
- Responsed (and therefore solved) or old issues from balupton repository: #250, #242, #238, #234, #224, #213, #206, #195, #183, #181, #180, #179, #175, #168
|
||||
- Fixed (or merged and therefore fixed) old issues from balupton repository: #248, #239, #236, #235, #229, #221, #220, #218, #215, #214, #212, #203, #191, #189, #172, #171, #166
|
||||
- Feedback for UTF8 / url encode issues necessary, related problems (thanks to riyad)
|
||||
- #64, #107, #108, #162, #177, #187, #205, #207, #210, #228
|
||||
|
||||
- v1.7.2 - January 18 2013
|
||||
- Updated project README
|
||||
- Integrated ExtJS Adapter (thanks to @seanadkinson!)
|
||||
- Merged from forks
|
||||
- added option to force no suid (@hrunting, @sbearcsiro)
|
||||
- provide a consistent URI-encoded document.location.href (@hrunting, @sbearcsiro)
|
||||
- Change History.getHash to return consistent hash, ala History.getLocationHref (@sbearcsiro)
|
||||
- Fix an issue where HTML4 replaceState wasn't firing when SUIDs were disabled and the url didn't change (@sbearcsiro)
|
||||
- Make extractId ignore the fragment if one is present (normally the hash is passed without an fragment) (@sbearcsiro)
|
||||
- Remove all encoding / decoding of URLs except when creating or extracting a fragment, based on the assumption that all inputs to replaceState / pushState are appropriately encoded (@sbearcsiro)
|
||||
- Change escapeHash/unescapeHash methods to use encodeURI/decodeURI instead of window.escape/unescape (@sbearcsiro)
|
||||
- Fixed issue #158 (@sbearcsiro)
|
||||
- isEmptyObject should use hasOwnProperty: prevents from always returning true if the Object.prototype is extended (@Alexander Johansson)
|
||||
- Add potential fix for IE8 not returning full hashed url from getLocationHref when hash contains encoded characters (@sbearcsiro)
|
||||
- Match current W3C popState event semantics for HTML4 (@STRML)
|
||||
- Added History.options.html4Mode for easier debugging (@gigafied)
|
||||
- Added History.options.delayInit (Boolean). (@gigafied)
|
||||
- Added error testing and quota relief for sessionStorage.setItem (@jamie-pate)
|
||||
- Fix IE 6 HTTPS warning (@Daniel15)
|
||||
- Fixed bug in html4 pushState function which left History in a busy state (@joelarson4)
|
||||
- Disable session storage if it's present but not working, thanks to @paulschreiber (@sbearcsiro)
|
||||
- Add Lakin Wecker's dojo adapter (@sbearcsiro)
|
||||
- Add dojo 1.8 tests (@sbearcsiro)
|
||||
- Change dojo adapter to not use dojo events, it seems to break other parts of dojo (@sbearcsiro)
|
||||
- Removes stray spaces so that the build script can run. (@billmag)
|
||||
- fixed an issue in Safari's Private Browsing mode where setItem throws an exception (@billmag)
|
||||
- Adds better error handling for the quota exceeded problem seen with the iPad. (@billmag)
|
||||
- Consolidated var in sessionStorage to the top of the function. Re-build compressed and bundled. (@billmag)
|
||||
|
||||
- v1.7.1 - October 4 2011
|
||||
- Added a new native adapter which is framework agnostic (can be used with, or without any framework)
|
||||
- Provided bundled files
|
||||
- Added RightJS adapter
|
||||
- Updated supported browser listing
|
||||
- Added sessionStorage support in core instead of optional Amplify.js Store support
|
||||
- Fixed issue with state id generation growing slower over time
|
||||
- Closes #104, #95, #102, #92, #81, #90, #94, #93, #91, #67, #83, #54, #45
|
||||
|
||||
- v1.7.0 - April 1 2011
|
||||
- Added `History.enabled` property (refer to usage section). This reflects whether or not History.js is enabled for our particular browser. For instance, if we have not included support for a HTML4 browser and we are accessing through a HTML4 browser then `History.enabled` will be `false`.
|
||||
- Added (optional but recommended) Data Persistance and Synchronisation Support thanks to [AppendTo's](http://appendto.com/) [Amplify.js](http://amplifyjs.com/) (refer to installation and compatibility sections for details)
|
||||
- Made HTML5 SUIDs more transparent - [Reported](https://github.com/balupton/history.js/issues#issue/34) by [azago](https://github.com/azago) and [Mark Jaquith](http://markjaquith.com/)
|
||||
- Fixed Session Storage Issue - Reported by a whole bunch of different people; [one](https://github.com/balupton/history.js/issues#issue/36), [two](https://github.com/balupton/history.js/issues#issue/37), [three](http://getsatisfaction.com/balupton/topics/history_js_1_6_losing_state_after_manual_page_reload)
|
||||
- Fixed URL Encoding Issue - [Reported](https://github.com/balupton/history.js/issues/#issue/33) by [Rob Madole](http://robmadole.com/)
|
||||
- Disabled support for IE6,7,8 when using the Prototype Adapter (there is nothing we can do about this, it is due to a bug in the prototype library) - [Reported](https://github.com/balupton/history.js/issues#issue/39) by [Sindre Wimberger](http://sindre.at/)
|
||||
- URLs in the State Hashes for HTML4 Browsers are now even shorter - [Discussion](https://github.com/balupton/history.js/issues#issue/28)
|
||||
- Fixed a issue with the MooTools Adapter and JSON with IE7 and IE8
|
||||
|
||||
- v1.6.0 - March 22 2011
|
||||
- Added Zepto adapter thanks to [Matt Garrett](http://twitter.com/#!/matthewgarrett)
|
||||
- The readme now references the supported versions of the libraries we use
|
||||
- Updated vendors to the most recent versions. jQuery 1.5.1 and Mootools 1.3.1
|
||||
- Reverted versions of Safari iOS prior to version 4.3 to be HTML4 browsers, Safari iOS 4.3 is a HTML5 browser
|
||||
- Refined code in History.js and its adapters
|
||||
- Fixed issue with extra state being inserted on Safari 5 requiring an extra click on the back button to go home - [Reported](https://github.com/balupton/history.js/issues#issue/17) by [Rob Madole](http://robmadole.com/)
|
||||
- Fixed issue with Safari 5 and Safari iOS 4 sometimes failing to apply the state change under busy conditions - Solution conceived with [Matt Garrett](http://twitter.com/matthewgarrett)
|
||||
- Fixed issue with HTML4 browsers requiring a query-string in the urls of states - [Reported](https://github.com/balupton/history.js/issues#issue/26) by [azago](https://github.com/azago)
|
||||
- Fixed issue with HTML4 browsers requiring title in the states in order to use state data - [Reported](https://github.com/balupton/history.js/issues#issue/25) by [Jonathan McLaughlin](http://system-werks.com/)
|
||||
- Fixed issue with HTML4 browsers failing is a state is pushed/replaced twice in a row - [Reported](https://github.com/balupton/history.js/issues#issue/17) by [Joey Baker](http://byjoeybaker.com/)
|
||||
- **B/C BREAK:** The `statechange` event now only fires if the state has changed; it no longer fires on page initialisation. This is following the [Firefox 4 History API Changes](http://hacks.mozilla.org/2011/03/history-api-changes-in-firefox-4/) which we agree with - this breaks standard, but makes more sense.
|
||||
|
||||
- v1.5.0 - February 12 2011
|
||||
- Moved to UglifyJS instead of Google Closure
|
||||
- Split HTML4 functionality from HTML5 functionality
|
||||
- Installation details have changed (the filenames are different)
|
||||
|
||||
- v1.4.1 - February 10 2011
|
||||
- Added HTML History API Support for Safari 5 and Safari iOS 4.2.1
|
||||
- Cleaned code a bit (mostly with unit tests)
|
||||
|
||||
- v1.4.0 - February 10 2011
|
||||
- Unit Testing now uses [QUnit](http://docs.jquery.com/Qunit)
|
||||
- Corrected Safari 5 Support
|
||||
- Now uses queues instead of timeouts
|
||||
- This means the API works exactly as expected, no more need to wrap calls in timeouts
|
||||
- Included a Subscribe Form in the Demo for Version Updates via Email
|
||||
- Small updates to Documentation
|
||||
|
||||
- v1.3.1 - February 4 2011
|
||||
- Improved Documentation
|
||||
|
||||
- v1.3.0 - January 31 2011
|
||||
- Support for cleaner HTML4 States
|
||||
|
||||
- v1.2.1 - January 30 2011
|
||||
- Fixed History.log always being called - [reported by dlee](https://github.com/balupton/history.js/issues/#issue/2)
|
||||
- Re-Added `History.go(index)` support
|
||||
|
||||
- v1.2.0 - January 25 2011
|
||||
- Support for HTML4 States in HTML5 Browsers (added test)
|
||||
- Updates of Documentation
|
||||
|
||||
- v1.1.0 - January 24 2011
|
||||
- Developed a series of automated test cases
|
||||
- Fixed issue with traditional anchors
|
||||
- Fixed issue with differing replaceState functionality in HTML4 Browsers
|
||||
- Fixed issue with Google Chrome artefacts being carried over to the initial state
|
||||
- Provided `onstatechange` and `onanchorchange` events
|
||||
|
||||
- v1.0.0 - January 22 2011
|
||||
- Supported `History.pushState` and `History.replaceState` degradation
|
||||
- Supported jQuery, MooTools and Prototype Frameworks
|
||||
|
292
sites/all/themes/gui/materiobasetheme/bower_components/history.js/README.md
vendored
Normal file
292
sites/all/themes/gui/materiobasetheme/bower_components/history.js/README.md
vendored
Normal file
@ -0,0 +1,292 @@
|
||||
Welcome to History.js <br/> v1.8b2, June 22 2013
|
||||
==================
|
||||
|
||||
[](https://flattr.com/submit/auto?user_id=balupton&url=https://github.com/browserstate/history.js&title=History.js&language=&tags=github&category=software)
|
||||
|
||||
## News
|
||||
- 22/06/2013: Beta 2 of v1.8 is released. Fixes and uncompressed bundled files.
|
||||
- 31/05/2013: Beta 1 of v1.8 is released. Fixes.
|
||||
- 14/02/2013: Alpha 4 of v1.8 is released. Fixes.
|
||||
- 05/02/2013: Alpha 3 of v1.8 is released. Tests updated.
|
||||
- 21/01/2013: Alpha 2 of v1.8 is released. Correct statechange behaviour.
|
||||
- 19/01/2013: Alpha 1 of v1.8 is released. Started to categorize old balupton's issues.
|
||||
|
||||
### History
|
||||
|
||||
See the [`History.md`](https://github.com/browserstate/history.js/blob/master/History.md#files) file for a detailed list of features, changes, solved issues and bugs
|
||||
|
||||
### Involve
|
||||
|
||||
Please create an issue if something doesn't work or if there is a browser specific bug. I'll try to fix it as soon as possible. Please send me your Pull requests if you have a nice solution! I'm also going to review old issues in balupton's repository and try to solve them too.
|
||||
|
||||
## Aims
|
||||
|
||||
- Follow the [HTML5 History API](https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history) as much as possible
|
||||
- Provide a cross-compatible experience for all HTML5 Browsers (they all implement the HTML5 History API a little bit differently causing different behaviours and sometimes bugs - History.js fixes this ensuring the experience is as expected / the same / great throughout the HTML5 browsers)
|
||||
- Provide a backwards-compatible experience for all HTML4 Browsers using a hash-fallback (including continued support for the HTML5 History API's `data`, `title`, `pushState` and `replaceState`) with the option to [remove HTML4 support if it is not right for your application](https://github.com/browserstate/history.js/wiki/Intelligent-State-Handling)
|
||||
- Provide a forwards-compatible experience for HTML4 States to HTML5 States (so if a hash-fallbacked url is accessed by a HTML5 browser it is naturally transformed into its non-hashed url equivalent)
|
||||
- Provide support for as many javascript frameworks as possible via adapters; especially [Dojo](http://dojotoolkit.org/), [ExtJS](http://www.sencha.com/), [jQuery](http://jquery.com/), [MooTools](http://mootools.net/), [Right.js](http://rightjs.org/) and [Zepto](http://zeptojs.com/).
|
||||
|
||||
## Usage
|
||||
|
||||
### Instant
|
||||
|
||||
To ajaxify your entire website with the HTML5 History API, History.js and jQuery the [Ajaxify Script](https://github.com/browserstate/ajaxify) is all you need. It's that easy.
|
||||
|
||||
### Ruby On Rails
|
||||
|
||||
If you are using Rails, then the easiest way for you to try History.js would be to use [Wiselinks](https://github.com/igor-alexandrov/wiselinks) gem. Wiselinks integrates into Rails application and allows you to start using History.js with three lines of code.
|
||||
|
||||
### Working with History.js directly
|
||||
|
||||
``` javascript
|
||||
(function(window,undefined){
|
||||
|
||||
// Bind to StateChange Event
|
||||
History.Adapter.bind(window,'statechange',function(){ // Note: We are using statechange instead of popstate
|
||||
var State = History.getState(); // Note: We are using History.getState() instead of event.state
|
||||
});
|
||||
|
||||
// Change our States
|
||||
History.pushState({state:1}, "State 1", "?state=1"); // logs {state:1}, "State 1", "?state=1"
|
||||
History.pushState({state:2}, "State 2", "?state=2"); // logs {state:2}, "State 2", "?state=2"
|
||||
History.replaceState({state:3}, "State 3", "?state=3"); // logs {state:3}, "State 3", "?state=3"
|
||||
History.pushState(null, null, "?state=4"); // logs {}, '', "?state=4"
|
||||
History.back(); // logs {state:3}, "State 3", "?state=3"
|
||||
History.back(); // logs {state:1}, "State 1", "?state=1"
|
||||
History.back(); // logs {}, "Home Page", "?"
|
||||
History.go(2); // logs {state:3}, "State 3", "?state=3"
|
||||
|
||||
})(window);
|
||||
```
|
||||
|
||||
### How would the above operations look in a HTML5 Browser?
|
||||
|
||||
1. www.mysite.com
|
||||
1. www.mysite.com/?state=1
|
||||
1. www.mysite.com/?state=2
|
||||
1. www.mysite.com/?state=3
|
||||
1. www.mysite.com/?state=4
|
||||
1. www.mysite.com/?state=3
|
||||
1. www.mysite.com/?state=1
|
||||
1. www.mysite.com
|
||||
1. www.mysite.com/?state=3
|
||||
|
||||
> Note: These urls also work in HTML4 browsers and Search Engines. So no need for the hashbang (`#!`) fragment-identifier that google ["recommends"](https://github.com/browserstate/history.js/wiki/Intelligent-State-Handling).
|
||||
|
||||
### How would they look in a HTML4 Browser?
|
||||
|
||||
1. www.mysite.com
|
||||
1. www.mysite.com/#?state=1&_suid=1
|
||||
1. www.mysite.com/#?state=2&_suid=2
|
||||
1. www.mysite.com/#?state=3&_suid=3
|
||||
1. www.mysite.com/#?state=4
|
||||
1. www.mysite.com/#?state=3&_suid=3
|
||||
1. www.mysite.com/#?state=1&_suid=1
|
||||
1. www.mysite.com
|
||||
1. www.mysite.com/#?state=3&_suid=3
|
||||
|
||||
> Note 1: These urls also work in HTML5 browsers - we use `replaceState` to transform these HTML4 states into their HTML5 equivalents so the user won't even notice :-)
|
||||
>
|
||||
> Note 2: These urls will be automatically url-encoded in IE6 to prevent certain browser-specific bugs.
|
||||
>
|
||||
> Note 3: Support for HTML4 browsers (this hash fallback) is optional [- why supporting HTML4 browsers could be either good or bad based on my app's use cases](https://github.com/browserstate/history.js/wiki/Intelligent-State-Handling)
|
||||
|
||||
### What's the deal with the SUIDs used in the HTML4 States?
|
||||
|
||||
- SUIDs (State Unique Identifiers) are used when we utilise a `title` and/or `data` in our state. Adding a SUID allows us to associate particular states with data and titles while keeping the urls as simple as possible (don't worry it's all tested, working and a lot smarter than I'm making it out to be).
|
||||
- If you aren't utilising `title` or `data` then we don't even include a SUID (as there is no need for it) - as seen by State 4 above :-)
|
||||
- We also shrink the urls to make sure that the smallest url will be used. For instance we will adjust `http://www.mysite.com/#http://www.mysite.com/projects/History.js` to become `http://www.mysite.com/#/projects/History.js` automatically. (again tested, working, and smarter).
|
||||
- It works with domains, subdomains, subdirectories, whatever - doesn't matter where you put it. It's smart.
|
||||
- Safari 5 will also have a SUID appended to the URL, it is entirely transparent but just a visible side-effect. It is required to fix a bug with Safari 5.
|
||||
|
||||
### Is there a working demo?
|
||||
|
||||
- Sure is, give it a download and navigate to the demo directory in your browser :-)
|
||||
- If you are after something a bit more adventurous than a end-user demo, open up the tests directory in your browser and editor - it'll rock your world and show all the vast use cases that History.js supports.
|
||||
|
||||
## Download & Installation
|
||||
|
||||
- Download History.js and upload it to your webserver. Download links: [tar.gz](https://github.com/browserstate/history.js/tarball/master) or [zip](https://github.com/browserstate/history.js/zipball/master)
|
||||
|
||||
- Include History.js
|
||||
|
||||
- For [Dojo](http://dojotoolkit.org/) v1.8+
|
||||
|
||||
``` html
|
||||
<script src="http://www.yourwebsite.com/history.js/scripts/bundled/html4+html5/dojo.history.js"></script>
|
||||
```
|
||||
|
||||
- For [ExtJs](http://www.sencha.com/) v1.8+
|
||||
|
||||
``` html
|
||||
<script src="http://www.yourwebsite.com/history.js/scripts/bundled/html4+html5/extjs.history.js"></script>
|
||||
```
|
||||
|
||||
- For [jQuery](http://jquery.com/) v1.3+
|
||||
|
||||
``` html
|
||||
<script src="http://www.yourwebsite.com/history.js/scripts/bundled/html4+html5/jquery.history.js"></script>
|
||||
```
|
||||
|
||||
- For [Mootools](http://mootools.net/) v1.3+
|
||||
|
||||
``` html
|
||||
<script src="http://www.yourwebsite.com/history.js/scripts/bundled/html4+html5/mootools.history.js"></script>
|
||||
```
|
||||
|
||||
- For [Right.js](http://rightjs.org/) v2.2+
|
||||
|
||||
``` html
|
||||
<script src="http://www.yourwebsite.com/history.js/scripts/bundled/html4+html5/right.history.js"></script>
|
||||
```
|
||||
|
||||
- For [Zepto](http://zeptojs.com/) v0.5+
|
||||
|
||||
``` html
|
||||
<script src="http://www.yourwebsite.com/history.js/scripts/bundled/html4+html5/zepto.history.js"></script>
|
||||
```
|
||||
|
||||
- For everything else
|
||||
|
||||
``` html
|
||||
<script src="http://www.yourwebsite.com/history.js/scripts/bundled/html4+html5/native.history.js"></script>
|
||||
```
|
||||
|
||||
> Note: If you want to only support HTML5 Browsers and not HTML4 Browsers (so no hash fallback support) then just change the `/html4+html5/` part in the urls to just `/html5/`. See [Why supporting HTML4 browsers could be either good or bad based on my app's use cases](https://github.com/browserstate/history.js/wiki/Intelligent-State-Handling)
|
||||
|
||||
|
||||
## Get Updates
|
||||
|
||||
- For Commit RSS/Atom Updates:
|
||||
- You can subscribe via the [GitHub Commit Atom Feed](http://feeds.feedburner.com/historyjs)
|
||||
- For GitHub News Feed Updates:
|
||||
- You can click the "watch" button up the top right of History.js's [GitHub Project Page](https://github.com/browserstate/history.js)
|
||||
|
||||
|
||||
## Get Support
|
||||
|
||||
- History.js is maintained by people like you. If you find a bug, report it to the [GitHub Issue Tracker](https://github.com/browserstate/history.js/issues). If you've fixed a bug submit a [Pull Request](https://github.com/browserstate/history.js/pulls) and add your fork to the [Network Wiki Page](https://github.com/browserstate/history.js/wiki/Network).
|
||||
|
||||
- If you would like paid support and trainings, or have job offers, then refer to the [Network Wiki Page](https://github.com/browserstate/history.js/wiki/Network). If you are qualified with History.js, then be sure to add your details to that page too.
|
||||
|
||||
- If your company uses History.js on your projects, and would like to see it grow and prosper (better documentation, bugfixes, upgrades, maintenance, etc.) and would love to become a corporate sponsor then do email sponsor@bevry.me
|
||||
|
||||
- If you would like free support for History.js, then [post your question](http://stackoverflow.com/questions/ask) on [Stackoverflow](http://stackoverflow.com/about) and be sure to use the `history.js` tag when asking your question.
|
||||
|
||||
- If you've created a website that uses History.js, or know of one, be sure to add it to the [Showcase Wiki Page](https://github.com/browserstate/history.js/wiki/Showcase).
|
||||
|
||||
- If you'd love to +1 or like this project, then be sure to tweet about it and click the "watch" button up the top of its [Project Page](https://github.com/browserstate/history.js).
|
||||
|
||||
- For anything else, refer to the [History.js GitHub Wiki Site](https://github.com/browserstate/history.js/wiki).
|
||||
|
||||
Thanks! every bit of help really does make a difference!
|
||||
|
||||
|
||||
## Browsers: Tested and Working In
|
||||
|
||||
### HTML5 Browsers
|
||||
|
||||
- Firefox 4+
|
||||
- Chrome 8+
|
||||
- Opera 11.5+
|
||||
- Safari 5.0+
|
||||
- Safari iOS 4.3+
|
||||
|
||||
### HTML4 Browsers
|
||||
|
||||
- IE 6, 7, 8, 9, (10)
|
||||
- Firefox 3
|
||||
- Opera 10, 11.0
|
||||
- Safari 4
|
||||
- Safari iOS 4.2, 4.1, 4.0, 3.2
|
||||
|
||||
|
||||
## Exposed API
|
||||
|
||||
### Functions
|
||||
|
||||
#### States
|
||||
- `History.pushState(data,title,url)` <br/> Pushes a new state to the browser; `data` can be null or an object, `title` can be null or a string, `url` must be a string
|
||||
- `History.replaceState(data,title,url)` <br/> Replaces the existing state with a new state to the browser; `data` can be null or an object, `title` can be null or a string, `url` must be a string
|
||||
- `History.getState()` <br/> Gets the current state of the browser, returns an object with `data`, `title` and `url`
|
||||
- `History.getStateByIndex` <br/> Gets a state by the index
|
||||
- `History.getCurrentIndex` <br/> Gets the current index
|
||||
- `History.getHash()` <br/> Gets the current hash of the browser
|
||||
|
||||
#### Adapter
|
||||
- `History.Adapter.bind(element,event,callback)` <br/> A framework independent event binder, you may either use this or your framework's native event binder.
|
||||
- `History.Adapter.trigger(element,event)` <br/> A framework independent event trigger, you may either use this or your framework's native event trigger.
|
||||
- `History.Adapter.onDomLoad(callback)` <br/> A framework independent onDomLoad binder, you may either use this or your framework's native onDomLoad binder.
|
||||
|
||||
#### Navigation
|
||||
- `History.back()` <br/> Go back once through the history (same as hitting the browser's back button)
|
||||
- `History.forward()` <br/> Go forward once through the history (same as hitting the browser's forward button)
|
||||
- `History.go(X)` <br/> If X is negative go back through history X times, if X is positive go forwards through history X times
|
||||
|
||||
#### Debug
|
||||
- `History.log(...)` <br/> Logs messages to the console, the log element, and fallbacks to alert if neither of those two exist
|
||||
- `History.debug(...)` <br/> Same as `History.log` but only runs if `History.debug.enable === true`
|
||||
|
||||
|
||||
|
||||
### Options
|
||||
|
||||
- `History.options.hashChangeInterval` <br/> How long should the interval be before hashchange checks
|
||||
- `History.options.safariPollInterval` <br/> How long should the interval be before safari poll checks
|
||||
- `History.options.doubleCheckInterval` <br/> How long should the interval be before we perform a double check
|
||||
- `History.options.disableSuid` <br/> Force History not to append suid
|
||||
- `History.options.storeInterval` <br/> How long should we wait between store calls
|
||||
- `History.options.busyDelay` <br/> How long should we wait between busy events
|
||||
- `History.options.debug` <br/> If true will enable debug messages to be logged
|
||||
- `History.options.initialTitle` <br/> What is the title of the initial state
|
||||
- `History.options.html4Mode` <br/> If true, will force HTMl4 mode (hashtags)
|
||||
- `History.options.delayInit` <br/> Want to override default options and call init manually.
|
||||
|
||||
### Events
|
||||
|
||||
- `window.onstatechange` <br/> Fired when the state of the page changes (does not include hash changes)
|
||||
- `window.onanchorchange` <br/> Fired when the anchor of the page changes (does not include state hashes)
|
||||
|
||||
|
||||
## Known Issues
|
||||
- Opera 11 fails to create history entries when under stressful loads (events fire perfectly, just the history events fail) - there is nothing we can do about this
|
||||
- Mercury iOS fails to apply url changes (hashes and HTML5 History API states) - there is nothing we can do about this
|
||||
|
||||
|
||||
## Notes on Compatibility
|
||||
|
||||
- History.js **solves** the following browser bugs:
|
||||
- HTML5 Browsers
|
||||
- Chrome 8 sometimes does not contain the correct state data when traversing back to the initial state
|
||||
- Safari 5, Safari iOS 4 and Firefox 3 and 4 do not fire the `onhashchange` event when the page is loaded with a hash
|
||||
- Safari 5 and Safari iOS 4 do not fire the `onpopstate` event when the hash has changed unlike the other browsers
|
||||
- Safari 5 and Safari iOS 4 fail to return to the correct state once a hash is replaced by a `replaceState` call / [bug report](https://bugs.webkit.org/show_bug.cgi?id=56249)
|
||||
- Safari 5 and Safari iOS 4 sometimes fail to apply the state change under busy conditions / [bug report](https://bugs.webkit.org/show_bug.cgi?id=42940)
|
||||
- Google Chrome 8,9,10 and Firefox 4 prior to the RC will always fire `onpopstate` once the page has loaded / [change recommendation](http://hacks.mozilla.org/2011/03/history-api-changes-in-firefox-4/)
|
||||
- Safari iOS 4.0, 4.1, 4.2 have a working HTML5 History API - although the actual back buttons of the browsers do not work, therefore we treat them as HTML4 browsers
|
||||
- None of the HTML5 browsers actually utilise the `title` argument to the `pushState` and `replaceState` calls
|
||||
- HTML4 Browsers
|
||||
- Old browsers like MSIE 6,7 and Firefox 2 do not have a `onhashchange` event
|
||||
- MSIE 6 and 7 sometimes do not apply a hash even it was told to (requiring a second call to the apply function)
|
||||
- Non-Opera HTML4 browsers sometimes do not apply the hash when the hash is not `urlencoded`
|
||||
- All Browsers
|
||||
- State data and titles do not persist once the site is left and then returned (includes page refreshes)
|
||||
- State titles are never applied to the `document.title`
|
||||
- ReplaceState functionality is emulated in HTML4 browsers by discarding the replaced state, so when the discarded state is accessed it is skipped using the appropriate `History.back()` / `History.forward()` call
|
||||
- Data persistance and synchronisation works like so: Every second or so, the SUIDs and URLs of the states will synchronise between the store and the local session. When a new session opens a familiar state (via the SUID or the URL) and it is not found locally then it will attempt to load the last known stored state with that information.
|
||||
- URLs will be unescaped to the maximum, so for instance the URL `?key=a%20b%252c` will become `?key=a b c`. This is to ensure consistency between browser url encodings.
|
||||
- Changing the hash of the page causes `onpopstate` to fire (this is expected/standard functionality). To ensure correct compatibility between HTML5 and HTML4 browsers the following events have been created:
|
||||
- `window.onstatechange`: this is the same as the `onpopstate` event except it does not fire for traditional anchors
|
||||
- `window.onanchorchange`: this is the same as the `onhashchange` event except it does not fire for states
|
||||
|
||||
|
||||
## History
|
||||
|
||||
You can discover the history inside the [History.md](https://github.com/browserstate/history.js/blob/master/History.md#files) file
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Licensed under the [New BSD License](http://opensource.org/licenses/BSD-3-Clause)
|
||||
<br/>Copyright © 2011+ [Benjamin Arthur Lupton](http://balupton.com)
|
4
sites/all/themes/gui/materiobasetheme/bower_components/history.js/bower.json
vendored
Normal file
4
sites/all/themes/gui/materiobasetheme/bower_components/history.js/bower.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "history.js",
|
||||
"version": "1.8.0"
|
||||
}
|
372
sites/all/themes/gui/materiobasetheme/bower_components/history.js/buildr-uncompressed.coffee
vendored
Normal file
372
sites/all/themes/gui/materiobasetheme/bower_components/history.js/buildr-uncompressed.coffee
vendored
Normal file
@ -0,0 +1,372 @@
|
||||
# Requires
|
||||
buildr = require 'buildr'
|
||||
util = require 'util'
|
||||
|
||||
# Options
|
||||
options =
|
||||
watch: false
|
||||
compress: false
|
||||
|
||||
# Configs
|
||||
configs =
|
||||
standard:
|
||||
# Options
|
||||
name: 'standard'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Checking
|
||||
checkScripts: true
|
||||
jshintOptions:
|
||||
browser: true
|
||||
laxbreak: true
|
||||
boss: true
|
||||
undef: true
|
||||
onevar: true
|
||||
strict: true
|
||||
noarg: true
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
other: [
|
||||
|
||||
# -----------------------------
|
||||
# Dojo Toolkit
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+dojo'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.dojo.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/dojo.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+dojo'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.dojo.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/dojo.history.js'
|
||||
}
|
||||
|
||||
# -----------------------------
|
||||
# ExtJS
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+extjs'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.extjs.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/extjs.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+extjs'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.extjs.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/extjs.history.js'
|
||||
}
|
||||
|
||||
# -----------------------------
|
||||
# JQUERY
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+jquery'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.jquery.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/jquery.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+jquery'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.jquery.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/jquery.history.js'
|
||||
}
|
||||
|
||||
|
||||
# -----------------------------
|
||||
# MOOTOOLS
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+mootools'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.mootools.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/mootools.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+mootools'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.mootools.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/mootools.history.js'
|
||||
}
|
||||
|
||||
|
||||
# -----------------------------
|
||||
# NATIVE
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+native'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.native.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/native.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+native'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.native.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/native.history.js'
|
||||
}
|
||||
|
||||
|
||||
# -----------------------------
|
||||
# RIGHT.JS
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+right'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.right.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/right.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+right'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.right.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/right.history.js'
|
||||
}
|
||||
|
||||
|
||||
# -----------------------------
|
||||
# ZEPTO
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+zepto'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.zepto.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/zepto.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+zepto'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.zepto.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/zepto.history.js'
|
||||
}
|
||||
]
|
||||
|
||||
# Standard
|
||||
standardConfig = configs.standard
|
||||
standardConfig.successHandler = ->
|
||||
for config in configs.other
|
||||
buildrInstance = buildr.createInstance config
|
||||
buildrInstance.process()
|
||||
|
||||
# Process
|
||||
standardBuildr = buildr.createInstance configs.standard
|
||||
standardBuildr.process()
|
373
sites/all/themes/gui/materiobasetheme/bower_components/history.js/buildr.coffee
vendored
Normal file
373
sites/all/themes/gui/materiobasetheme/bower_components/history.js/buildr.coffee
vendored
Normal file
@ -0,0 +1,373 @@
|
||||
# Requires
|
||||
buildr = require 'buildr'
|
||||
util = require 'util'
|
||||
|
||||
# Options
|
||||
options =
|
||||
watch: false
|
||||
compress: true
|
||||
|
||||
# Configs
|
||||
configs =
|
||||
standard:
|
||||
# Options
|
||||
name: 'standard'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
outPath: __dirname+'/scripts/compressed'
|
||||
|
||||
# Checking
|
||||
checkScripts: true
|
||||
jshintOptions:
|
||||
browser: true
|
||||
laxbreak: true
|
||||
boss: true
|
||||
undef: true
|
||||
onevar: true
|
||||
strict: true
|
||||
noarg: true
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
other: [
|
||||
|
||||
# -----------------------------
|
||||
# Dojo Toolkit
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+dojo'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.dojo.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/dojo.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+dojo'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.dojo.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html5/dojo.history.js'
|
||||
}
|
||||
|
||||
# -----------------------------
|
||||
# ExtJS
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+extjs'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.extjs.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/extjs.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+extjs'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.extjs.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html5/extjs.history.js'
|
||||
}
|
||||
|
||||
# -----------------------------
|
||||
# JQUERY
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+jquery'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.jquery.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/jquery.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+jquery'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.jquery.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html5/jquery.history.js'
|
||||
}
|
||||
|
||||
|
||||
# -----------------------------
|
||||
# MOOTOOLS
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+mootools'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.mootools.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/mootools.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+mootools'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.mootools.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html5/mootools.history.js'
|
||||
}
|
||||
|
||||
|
||||
# -----------------------------
|
||||
# NATIVE
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+native'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.native.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/native.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+native'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.native.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html5/native.history.js'
|
||||
}
|
||||
|
||||
|
||||
# -----------------------------
|
||||
# RIGHT.JS
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+right'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.right.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/right.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+right'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.right.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html5/right.history.js'
|
||||
}
|
||||
|
||||
|
||||
# -----------------------------
|
||||
# ZEPTO
|
||||
|
||||
{
|
||||
# Options
|
||||
name: 'html4+html5+zepto'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'json2.js'
|
||||
'history.adapter.zepto.js'
|
||||
'history.html4.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/zepto.history.js'
|
||||
}
|
||||
{
|
||||
# Options
|
||||
name: 'html5+zepto'
|
||||
watch: options.watch
|
||||
|
||||
# Paths
|
||||
srcPath: __dirname+'/scripts/uncompressed'
|
||||
|
||||
# Compression (without outPath only the generated bundle files are compressed)
|
||||
compressScripts: options.compress # Array or true or false
|
||||
|
||||
# Order
|
||||
scriptsOrder: [
|
||||
'history.adapter.zepto.js'
|
||||
'history.js'
|
||||
]
|
||||
|
||||
# Bundling
|
||||
bundleScriptPath: __dirname+'/scripts/bundled/html5/zepto.history.js'
|
||||
}
|
||||
]
|
||||
|
||||
# Standard
|
||||
standardConfig = configs.standard
|
||||
standardConfig.successHandler = ->
|
||||
for config in configs.other
|
||||
buildrInstance = buildr.createInstance config
|
||||
buildrInstance.process()
|
||||
|
||||
# Process
|
||||
standardBuildr = buildr.createInstance configs.standard
|
||||
standardBuildr.process()
|
4
sites/all/themes/gui/materiobasetheme/bower_components/history.js/component.json
vendored
Normal file
4
sites/all/themes/gui/materiobasetheme/bower_components/history.js/component.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "history.js",
|
||||
"version": "1.8.0"
|
||||
}
|
58
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/bcherry-orig.html
vendored
Normal file
58
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/bcherry-orig.html
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<title>WebKit is Dropping HTML5 "popstate" Events</title>
|
||||
|
||||
<link rel="stylesheet" href="/static/lib/css/blueprint/blueprint.min.css" media="screen, projection" />
|
||||
<link rel="stylesheet" href="/static/lib/css/blueprint/print.min.css" media="print" />
|
||||
<!--[if lt IE 8]>
|
||||
<link rel="stylesheet" href="/static/lib/css/blueprint/ie.min.css" media="screen, projection">
|
||||
<![endif]-->
|
||||
<link href="/static/lib/css/bcherry.css" rel="stylesheet" media="screen" />
|
||||
<style>
|
||||
#n {
|
||||
font-size: 48px;
|
||||
}
|
||||
p {
|
||||
padding: 0 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" src="../vendor/jquery.js"></script>
|
||||
<script type="text/javascript" src="../scripts/uncompressed/history.adapter.jquery.js"></script>
|
||||
<script type="text/javascript" src="../scripts/uncompressed/history.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="n"></div>
|
||||
<p>There's a bug in the HTML5 "popstate" event, as implemented in WebKit (Safari and Chrome). View this page in one of those browsers. Your browser has had history entries added from #0 to #19 (you should start at #19). Hitting back/forward will navigate through these. On each URL, the large number above should reflect the hash value. If you hit back/forward quickly, you'll notice that your number gets out of sync with the URL. This is because WebKit is dropping popstate events (they are not firing). It seems to happen when outbound network requests are in progress when the user navigates in their browser happens. In this case, your browser is downloading an image that takes 1s to serve on every popstate, so you'll have to wait 1s between backs/forwards to have the feature work correctly. You could also cause constant network traffic by putting an image download in a setInterval, in which case your popstate events will never fire. This implementation simulates an AJAX application that makes a network request when you navigate between URLs using pushState/popstate. View the source for more info.</p>
|
||||
<p>This was filed as <a href="https://bugs.webkit.org/show_bug.cgi?id=42940">Bug 42940</a> with WebKit on July 24, 2010. The Firefox 4 beta does not have this bug, which is good news.</p>
|
||||
<p>This is put together by <a href="http://www.adequatelygood.com">Ben Cherry</a>. Ben is a front-end engineer at <a href="http://twitter.com/">Twitter</a>, and you can follow him at <a href="http://twitter.com/bcherry">@bcherry</a>.</p>
|
||||
<script>
|
||||
// Bind to popstate
|
||||
$(window).bind("popstate", function(e) {
|
||||
var State = e.state;
|
||||
|
||||
// log that this event was fired, and the current URL
|
||||
if (window.console && window.console.log) {
|
||||
console.log("popstate", State, window.location.href);
|
||||
}
|
||||
// update the page
|
||||
$("#n").text(typeof State.n !== 'undefined' ? State.n : document.location.href);
|
||||
|
||||
// Make an outbound image request that will take 1s. This request seems to be the cause of dropped popstates.
|
||||
// Removing this, or replacing it with something else, avoids the issue. Even if it's replaced with slow, blocking code (i.e. 1s of execution) events are not dropped.
|
||||
(new Image()).src = "http://www.bcherry.net/playground/pushstate.jpg";
|
||||
});
|
||||
|
||||
// Seed the browser history
|
||||
for (var i = 0; i < 20; i++) {
|
||||
window.history.pushState({n:i}, i, "?" + i);
|
||||
$("#n").text(i);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
62
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/bcherry.html
vendored
Normal file
62
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/bcherry.html
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<title>WebKit is Dropping HTML5 "popstate" Events</title>
|
||||
|
||||
<link rel="stylesheet" href="/static/lib/css/blueprint/blueprint.min.css" media="screen, projection" />
|
||||
<link rel="stylesheet" href="/static/lib/css/blueprint/print.min.css" media="print" />
|
||||
<!--[if lt IE 8]>
|
||||
<link rel="stylesheet" href="/static/lib/css/blueprint/ie.min.css" media="screen, projection">
|
||||
<![endif]-->
|
||||
<link href="/static/lib/css/bcherry.css" rel="stylesheet" media="screen" />
|
||||
<style>
|
||||
#n {
|
||||
font-size: 48px;
|
||||
}
|
||||
p {
|
||||
padding: 0 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" src="../vendor/jquery.js"></script>
|
||||
<script type="text/javascript" src="../scripts/uncompressed/history.adapter.jquery.js"></script>
|
||||
<script type="text/javascript" src="../scripts/uncompressed/history.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="n"></div>
|
||||
<p>There's a bug in the HTML5 "popstate" event, as implemented in WebKit (Safari and Chrome). View this page in one of those browsers. Your browser has had history entries added from #0 to #19 (you should start at #19). Hitting back/forward will navigate through these. On each URL, the large number above should reflect the hash value. If you hit back/forward quickly, you'll notice that your number gets out of sync with the URL. This is because WebKit is dropping popstate events (they are not firing). It seems to happen when outbound network requests are in progress when the user navigates in their browser happens. In this case, your browser is downloading an image that takes 1s to serve on every popstate, so you'll have to wait 1s between backs/forwards to have the feature work correctly. You could also cause constant network traffic by putting an image download in a setInterval, in which case your popstate events will never fire. This implementation simulates an AJAX application that makes a network request when you navigate between URLs using pushState/popstate. View the source for more info.</p>
|
||||
<p>This was filed as <a href="https://bugs.webkit.org/show_bug.cgi?id=42940">Bug 42940</a> with WebKit on July 24, 2010. The Firefox 4 beta does not have this bug, which is good news.</p>
|
||||
<p>This is put together by <a href="http://www.adequatelygood.com">Ben Cherry</a>. Ben is a front-end engineer at <a href="http://twitter.com/">Twitter</a>, and you can follow him at <a href="http://twitter.com/bcherry">@bcherry</a>.</p>
|
||||
<p>This bug was fixed in <a href="http://github.com/balupton/history.js">History.js</a> by <a href="http://balupton.com">Benjamin Lupton</a>. Benjamin is a freelance web 2.0 consultant, and you can follow him at <a href="http://twitter.com/balupton">@balupton</a>.</p>
|
||||
<script>
|
||||
// Prepare
|
||||
window.History.debug.enable = true;
|
||||
|
||||
// Bind to popstate
|
||||
$(window).bind("statechange", function(e) {
|
||||
var State = window.History.getState();
|
||||
|
||||
// log that this event was fired, and the current URL
|
||||
if (window.console && window.console.log) {
|
||||
console.log("popstate", State, window.location.href);
|
||||
}
|
||||
// update the page
|
||||
$("#n").text(typeof State.data.n !== 'undefined' ? State.data.n : State.url);
|
||||
|
||||
// Make an outbound image request that will take 1s. This request seems to be the cause of dropped popstates.
|
||||
// Removing this, or replacing it with something else, avoids the issue. Even if it's replaced with slow, blocking code (i.e. 1s of execution) events are not dropped.
|
||||
(new Image()).src = "http://www.bcherry.net/playground/pushstate.jpg";
|
||||
});
|
||||
|
||||
// Seed the browser history
|
||||
for (var i = 0; i < 20; i++) {
|
||||
window.History.pushState({n:i}, i, "?" + i);
|
||||
$("#n").text(i);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
37
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/chrome.html
vendored
Normal file
37
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/chrome.html
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Chrome History API Data Artifact</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>This demo demonstrates an issue with Google Chrome versions 8-10 (possibly 11) where if you push a state with data, then do history.back to the initial state, the event.state will contain the pushed states data instead of being null.</p>
|
||||
<p>Note: The issue requires a clean history list, as such this should always be opened in a new tab/window where there are no prior history items.</p>
|
||||
<p>Reported by <a href="http://balupton.com">Benjamin Lupton</a> author of <a href="http://github.com/balupton/history.js">History.js</a></p>
|
||||
<button id="bug">bug</button>
|
||||
<button id="reset">reset</button>
|
||||
<textarea id="log" style="width:100%;height:200px;margin-top:1em;"></textarea>
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
|
||||
window.onpopstate = function(event) {
|
||||
var message = ("onpopstate: location: " + document.location.href + ", data: " + JSON.stringify(event.state));
|
||||
document.getElementById('log').innerHTML += message+"\n\n";
|
||||
};
|
||||
|
||||
document.getElementById('bug').onclick = function(){
|
||||
setTimeout(function(){
|
||||
history.pushState({state:'new'},'New State','?new');
|
||||
},1e3);
|
||||
|
||||
setTimeout(function(){
|
||||
history.back();
|
||||
},2e3);
|
||||
};
|
||||
|
||||
document.getElementById('reset').onclick = function(){
|
||||
document.location.href = document.location.href.replace(/[\#\?].*/,"");
|
||||
};
|
||||
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
84
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/index.html
vendored
Normal file
84
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/index.html
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
History.js
|
||||
</title>
|
||||
</head>
|
||||
<body style="padding-bottom:40px">
|
||||
<!-- Scripts -->
|
||||
<script>if ( typeof window.JSON === 'undefined' ) { document.write('<script src="../scripts/uncompressed/json2.js"><\/script>'); }</script>
|
||||
<script src="../vendor/jquery.js"></script>
|
||||
<script src="../scripts/bundled/html4+html5/jquery.history.js"></script>
|
||||
|
||||
<!-- HTML -->
|
||||
<div id="wrap">
|
||||
<!-- Intro -->
|
||||
<h1>History.js</h1>
|
||||
<p>History.js gracefully supports the <a href="https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history">HTML5 History/State APIs</a> (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState. Supports <a href="http://jquery.com/">jQuery</a>, <a href="http://mootools.net">MooTools</a> and <a href="http://prototypejs.org">Prototype</a>. For HTML5 browsers this means that you can modify the URL directly, without needing to use hashes anymore. For HTML4 browsers it will revert back to using the old onhashchange functionality.</p>
|
||||
|
||||
<!-- Textarea for Logging -->
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- Note -->
|
||||
<p>Click through the buttons in order and you'll get the results demonstrated in the <a href="../README.md">README.md</a> file.</p>
|
||||
|
||||
<!-- Buttons -->
|
||||
<ul id="buttons">
|
||||
</ul>
|
||||
|
||||
<!-- Our Script -->
|
||||
<script>
|
||||
(function(window,undefined){
|
||||
|
||||
// Check Location
|
||||
if ( document.location.protocol === 'file:' ) {
|
||||
alert('The HTML5 History API (and thus History.js) do not work on files, please upload it to a server.');
|
||||
}
|
||||
|
||||
// Establish Variables
|
||||
var
|
||||
State = History.getState(),
|
||||
$log = $('#log');
|
||||
|
||||
// Log Initial State
|
||||
History.log('initial:', State.data, State.title, State.url);
|
||||
|
||||
// Bind to State Change
|
||||
History.Adapter.bind(window,'statechange',function(){ // Note: We are using statechange instead of popstate
|
||||
// Log the State
|
||||
var State = History.getState(); // Note: We are using History.getState() instead of event.state
|
||||
History.log('statechange:', State.data, State.title, State.url);
|
||||
});
|
||||
|
||||
// Prepare Buttons
|
||||
var
|
||||
buttons = document.getElementById('buttons'),
|
||||
scripts = [
|
||||
'History.pushState({state:1,rand:Math.random()}, "State 1", "?state=1"); // logs {state:1,rand:"some random value"}, "State 1", "?state=1"',
|
||||
'History.pushState({state:2,rand:Math.random()}, "State 2", "?state=2"); // logs {state:2,rand:"some random value"}, "State 2", "?state=2"',
|
||||
'History.replaceState({state:3,rand:Math.random()}, "State 3", "?state=3"); // logs {state:3,rand:"some random value"}, "State 3", "?state=3"',
|
||||
'History.pushState(null, null, "?state=4"); // logs {}, "", "?state=4"',
|
||||
'History.back(); // logs {state:3}, "State 3", "?state=3"',
|
||||
'History.back(); // logs {state:1}, "State 1", "?state=1"',
|
||||
'History.back(); // logs {}, "The page you started at", "?"',
|
||||
'History.go(2); // logs {state:3}, "State 3", "?state=3"'
|
||||
],
|
||||
buttonsHTML = ''
|
||||
;
|
||||
|
||||
// Add Buttons
|
||||
for ( var i=0,n=scripts.length; i<n; ++i ) {
|
||||
var _script = scripts[i];
|
||||
buttonsHTML +=
|
||||
'<li><button onclick=\'javascript:'+_script+'\'>'+_script+'</button></li>';
|
||||
}
|
||||
buttons.innerHTML = buttonsHTML;
|
||||
|
||||
})(window);
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/native-auto.html
vendored
Normal file
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/native-auto.html
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
|
||||
window.onpopstate = function(event) {
|
||||
console.log("onpopstate: location: " + document.location.href + ", data: " + JSON.stringify(event.state));
|
||||
};
|
||||
window.onhashchange = function(event) {
|
||||
console.log("onhashchange: location: " + document.location.href);
|
||||
};
|
||||
|
||||
setTimeout(function(){
|
||||
history.pushState({page: 1}, "title 1", "?page=1");
|
||||
},1e3);
|
||||
setTimeout(function(){
|
||||
history.pushState({page: 2}, "title 2", "?page=2");
|
||||
},2e3);
|
||||
setTimeout(function(){
|
||||
history.replaceState({page: 3}, "title 3", "?page=3");
|
||||
},3e3);
|
||||
setTimeout(function(){
|
||||
document.location.hash = 'asd';
|
||||
},4e3);
|
||||
setTimeout(function(){
|
||||
history.back(); // alerts "location: http://example.com/example.html?page=3#asd, state: {"page":3}"
|
||||
},5e3);
|
||||
setTimeout(function(){
|
||||
history.back(); // alerts "location: http://example.com/example.html?page=1, state: {"page":1}"
|
||||
},6e3);
|
||||
setTimeout(function(){
|
||||
history.back(); // alerts "location: http://example.com/example.html, state: null
|
||||
},7e3);
|
||||
setTimeout(function(){
|
||||
history.go(2); // alerts "location: http://example.com/example.html?page=3, state: {"page":3}
|
||||
},8e3);
|
||||
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
62
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/native.html
vendored
Normal file
62
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/native.html
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML5 History API Demo</title>
|
||||
</head>
|
||||
<body>
|
||||
<textarea id="log" style="width:100%;height:400px;margin:1em;"></textarea>
|
||||
<div id="url" style="border:1px black dotted;height:1em;margin:1em;"></div>
|
||||
<div id="buttons" style="margin:1em;"></div>
|
||||
<script type="text/javascript">
|
||||
var $url = document.getElementById('url'), $log = document.getElementById('log');
|
||||
|
||||
window.onpopstate = function(event) {
|
||||
var message =
|
||||
"onpopstate: "+
|
||||
"location: " + location.href + ", " +
|
||||
"data: " + JSON.stringify(event.state) +
|
||||
"\n\n"
|
||||
;
|
||||
|
||||
$url.innerHTML = location.href;
|
||||
$log.innerHTML += message;
|
||||
console.log(message);
|
||||
};
|
||||
|
||||
window.onhashchange = function(event) {
|
||||
var message =
|
||||
"onhashchange: "+
|
||||
"location: " + location.href + ", "+
|
||||
"hash: " + location.hash +
|
||||
"\n\n"
|
||||
;
|
||||
|
||||
$url.innerHTML = location.href;
|
||||
$log.innerHTML += message;
|
||||
console.log(message);
|
||||
};
|
||||
|
||||
// Prepare Buttons
|
||||
var
|
||||
buttons = document.getElementById('buttons'),
|
||||
scripts = [
|
||||
'history.pushState({state:1}, "State 1", "?state=1");',
|
||||
'history.pushState({state:2}, "State 2", "?state=2");',
|
||||
'history.replaceState({state:3}, "State 3", "?state=3");',
|
||||
'location.hash = Math.random();',
|
||||
'history.back();',
|
||||
'history.forward();',
|
||||
'document.location.href = document.location.href.replace(/[\#\?].*/,"");'
|
||||
],
|
||||
buttonsHTML = ''
|
||||
;
|
||||
|
||||
// Add Buttons
|
||||
for ( var i=0,n=scripts.length; i<n; ++i ) {
|
||||
var _script = scripts[i];
|
||||
buttonsHTML +=
|
||||
'<li><button onclick=\'javascript:'+_script+'\'>'+_script+'</button></li>';
|
||||
}
|
||||
buttons.innerHTML = buttonsHTML;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
23
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/navigator.html
vendored
Normal file
23
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/navigator.html
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Navigator Output
|
||||
</title>
|
||||
<style>
|
||||
label { font-weight:bold; }
|
||||
label:after { content: ":"; margin-right:5px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="nav"></div>
|
||||
<script>
|
||||
var nav = document.getElementById('nav'), i,v;
|
||||
for ( i in navigator ) {
|
||||
var v = navigator[i];
|
||||
nav.innerHTML += '<div><label>'+i+'</label>'+v+'</div>';
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
61
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/safari.html
vendored
Normal file
61
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/safari.html
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Safari Hash ReplaceState History Traversal Bug</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>This demo demonstrates an issue with Safari 5.0.4 (6533.20.27) handing of hashes and replace state. When a hash is set, and then replaced using replaceState the history list are then broken, when traversing back the hash does not change.</p>
|
||||
<p>Note: The issue requires a clean history list, as such this should always be opened in a new tab/window where there are no prior history items.</p>
|
||||
<p>Reported by <a href="http://balupton.com">Benjamin Lupton</a> author of <a href="http://github.com/balupton/history.js">History.js</a></p>
|
||||
<button id="bug">bug</button>
|
||||
<button id="workaround">workaround</button>
|
||||
<button id="reset">reset</button>
|
||||
<textarea id="log" style="width:100%;height:200px;margin-top:1em;"></textarea>
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
|
||||
window.onpopstate = function(event) {
|
||||
var message = ("onpopstate: location: " + document.location.href);
|
||||
document.getElementById('log').innerHTML += message+"\n\n";
|
||||
};
|
||||
|
||||
window.onhashchange = function(event) {
|
||||
var message = ("onhashchange: location: " + document.location.href);
|
||||
document.getElementById('log').innerHTML += message+"\n\n";
|
||||
};
|
||||
|
||||
document.getElementById('bug').onclick = function(){
|
||||
setTimeout(function(){
|
||||
document.location.hash = Math.random();
|
||||
},1e3);
|
||||
|
||||
setTimeout(function(){
|
||||
history.replaceState(null,'','?blah');
|
||||
},2e3);
|
||||
|
||||
setTimeout(function(){
|
||||
history.back(); // should take us to the initial page, it doesn't
|
||||
},3e3);
|
||||
};
|
||||
|
||||
document.getElementById('workaround').onclick = function(){
|
||||
setTimeout(function(){
|
||||
history.pushState(null,'','#'+Math.random());
|
||||
},1e3);
|
||||
|
||||
setTimeout(function(){
|
||||
history.replaceState(null,'','?blah');
|
||||
},2e3);
|
||||
|
||||
setTimeout(function(){
|
||||
history.back(); // will take us to the initial page
|
||||
},3e3);
|
||||
};
|
||||
|
||||
document.getElementById('reset').onclick = function(){
|
||||
document.location.href = document.location.href.replace(/[\#\?].*/,"");
|
||||
};
|
||||
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
79
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/unicode.html
vendored
Normal file
79
sites/all/themes/gui/materiobasetheme/bower_components/history.js/demo/unicode.html
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
History.js
|
||||
</title>
|
||||
</head>
|
||||
<body style="padding-bottom:40px">
|
||||
<!-- Scripts -->
|
||||
<script>if ( typeof window.JSON === 'undefined' ) { document.write('<script src="../scripts/uncompressed/json2.js"><\/script>'); }</script>
|
||||
<script src="../vendor/jquery.js"></script>
|
||||
<script src="../scripts/bundled/html4+html5/jquery.history.js"></script>
|
||||
|
||||
<!-- HTML -->
|
||||
<div id="wrap">
|
||||
<!-- Intro -->
|
||||
<h1>History.js</h1>
|
||||
<p>History.js gracefully supports unicode.</p>
|
||||
|
||||
<!-- Textarea for Logging -->
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- Buttons -->
|
||||
<ul id="buttons">
|
||||
</ul>
|
||||
|
||||
<!-- Our Script -->
|
||||
<script>
|
||||
(function(window,undefined){
|
||||
|
||||
// Check Location
|
||||
if ( document.location.protocol === 'file:' ) {
|
||||
alert('The HTML5 History API (and thus History.js) do not work on files, please upload it to a server.');
|
||||
}
|
||||
|
||||
// Establish Variables
|
||||
var
|
||||
State = History.getState(),
|
||||
$log = $('#log');
|
||||
|
||||
// Log Initial State
|
||||
History.log('initial:', State.data, State.title, State.url);
|
||||
|
||||
// Bind to State Change
|
||||
History.Adapter.bind(window,'statechange',function(){ // Note: We are using statechange instead of popstate
|
||||
// Log the State
|
||||
var State = History.getState(); // Note: We are using History.getState() instead of event.state
|
||||
History.log('statechange:', State.data, State.title, State.url);
|
||||
});
|
||||
|
||||
// Prepare Buttons
|
||||
var
|
||||
buttons = document.getElementById('buttons'),
|
||||
scripts = [
|
||||
'History.pushState({state:1,rand:Math.random()}, "State 1", "?läu=ßüs"); // logs {state:1,rand:"some random value"}, "State 1", "?l#äu=ßüs"',
|
||||
'History.pushState({state:2,rand:Math.random()}, "State 2", "?chinese=リオれ"); // logs {state:2,rand:"some random value"}, "State 2", "/chinese/2"',
|
||||
'History.back(); // logs {state:3}, "State 3", "?state=3"',
|
||||
'History.back(); // logs {state:1}, "State 1", "?state=1"',
|
||||
'History.back(); // logs {}, "The page you started at", "?"',
|
||||
'History.go(2); // logs {state:3}, "State 3", "?state=3"'
|
||||
],
|
||||
buttonsHTML = ''
|
||||
;
|
||||
|
||||
// Add Buttons
|
||||
for ( var i=0,n=scripts.length; i<n; ++i ) {
|
||||
var _script = scripts[i];
|
||||
buttonsHTML +=
|
||||
'<li><button onclick=\'javascript:'+_script+'\'>'+_script+'</button></li>';
|
||||
}
|
||||
buttons.innerHTML = buttonsHTML;
|
||||
|
||||
})(window);
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
10
sites/all/themes/gui/materiobasetheme/bower_components/history.js/license.txt
vendored
Normal file
10
sites/all/themes/gui/materiobasetheme/bower_components/history.js/license.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
Copyright (c) 2011, Benjamin Arthur Lupton
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
• Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
• Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
• Neither the name of Benjamin Arthur Lupton nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
67
sites/all/themes/gui/materiobasetheme/bower_components/history.js/package.json
vendored
Normal file
67
sites/all/themes/gui/materiobasetheme/bower_components/history.js/package.json
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
{
|
||||
"name": "history.js",
|
||||
"version": "1.8.0",
|
||||
"description": "History.js gracefully supports the HTML5 History/State APIs (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState. Supports jQuery, MooTools and Prototype. For HTML5 browsers this means that you can modify the URL directly, without needing to use hashes anymore. For HTML4 browsers it will revert back to using the old onhashchange functionality.",
|
||||
"homepage": "https://github.com/browserstate/history.js",
|
||||
"keywords": [
|
||||
"javascript",
|
||||
"html5 history api",
|
||||
"hashchange",
|
||||
"popstate",
|
||||
"pushstate",
|
||||
"replacestate",
|
||||
"hashes",
|
||||
"hashbang"
|
||||
],
|
||||
"author": {
|
||||
"name": "Benjamin Lupton",
|
||||
"email": "b@lupton.cc",
|
||||
"web": "http://balupton.com"
|
||||
},
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Benjamin Lupton",
|
||||
"email": "b@lupton.cc",
|
||||
"web": "http://balupton.com"
|
||||
},
|
||||
{
|
||||
"name": "Andreas Bernhard",
|
||||
"email": "andreas@bernhard.im",
|
||||
"web": "http://www.bs-infosys.com"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Benjamin Lupton",
|
||||
"email": "b@lupton.cc",
|
||||
"web": "http://balupton.com"
|
||||
},
|
||||
{
|
||||
"name": "Andreas Bernhard",
|
||||
"email": "andreas@bernhard.im",
|
||||
"web": "http://www.bs-infosys.com"
|
||||
}
|
||||
],
|
||||
"bugs": {
|
||||
"web": "https://github.com/browserstate/history.js/issues"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "New-BSD",
|
||||
"url": "http://creativecommons.org/licenses/BSD/"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/browserstate/history.js.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"buildr": "0.8.x"
|
||||
},
|
||||
"engines": {
|
||||
},
|
||||
"directories": {
|
||||
"out": "./scripts/compressed",
|
||||
"src": "./scripts/uncompressed"
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
(function(e,t){"use strict";var n=e.History=e.History||{},r=e.require;if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={handlers:{},_uid:1,uid:function(e){return e._uid||(e._uid=n.Adapter._uid++)},bind:function(e,t,r){var i=n.Adapter.uid(e);n.Adapter.handlers[i]=n.Adapter.handlers[i]||{},n.Adapter.handlers[i][t]=n.Adapter.handlers[i][t]||[],n.Adapter.handlers[i][t].push(r),e["on"+t]=function(e,t){return function(r){n.Adapter.trigger(e,t,r)}}(e,t)},trigger:function(e,t,r){r=r||{};var i=n.Adapter.uid(e),s,o;n.Adapter.handlers[i]=n.Adapter.handlers[i]||{},n.Adapter.handlers[i][t]=n.Adapter.handlers[i][t]||[];for(s=0,o=n.Adapter.handlers[i][t].length;s<o;++s)n.Adapter.handlers[i][t][s].apply(this,[r])},extractEventData:function(e,n){var r=n&&n[e]||t;return r},onDomLoad:function(e){r(["dojo/ready"],function(t){t(e)})}},typeof n.init!="undefined"&&n.init()})(window)
|
@ -0,0 +1 @@
|
||||
(function(e,t){"use strict";var n=e.History=e.History||{},r=e.Ext;e.JSON={stringify:r.JSON.encode,parse:r.JSON.decode};if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={observables:{},bind:function(e,t,n,i){r.EventManager.addListener(e,t,n,i);var s=r.id(e,"history-"),o=this.observables[s];o||(o=r.create("Ext.util.Observable"),this.observables[s]=o),o.on(t,n,i)},trigger:function(e,t,n){var i=r.id(e,"history-"),s=this.observables[i];s&&s.fireEvent(t,n)},extractEventData:function(e,n,r){var i=n&&n.browserEvent&&n.browserEvent[e]||r&&r[e]||t;return i},onDomLoad:function(e){r.onReady(e)}},typeof n.init!="undefined"&&n.init()})(window)
|
@ -0,0 +1 @@
|
||||
(function(e,t){"use strict";var n=e.History=e.History||{},r=e.jQuery;if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={bind:function(e,t,n){r(e).bind(t,n)},trigger:function(e,t,n){r(e).trigger(t,n)},extractEventData:function(e,n,r){var i=n&&n.originalEvent&&n.originalEvent[e]||r&&r[e]||t;return i},onDomLoad:function(e){r(e)}},typeof n.init!="undefined"&&n.init()})(window)
|
@ -0,0 +1 @@
|
||||
(function(e,t){"use strict";var n=e.History=e.History||{},r=e.MooTools,i=e.Element;if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");Object.append(i.NativeEvents,{popstate:2,hashchange:2}),n.Adapter={bind:function(e,t,n){var r=typeof e=="string"?document.id(e):e;r.addEvent(t,n)},trigger:function(e,t,n){var r=typeof e=="string"?document.id(e):e;r.fireEvent(t,n)},extractEventData:function(e,n){var r=n&&n.event&&n.event[e]||n&&n[e]||t;return r},onDomLoad:function(t){e.addEvent("domready",t)}},typeof n.init!="undefined"&&n.init()})(window)
|
@ -0,0 +1 @@
|
||||
(function(e,t){"use strict";var n=e.History=e.History||{};if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={handlers:{},_uid:1,uid:function(e){return e._uid||(e._uid=n.Adapter._uid++)},bind:function(e,t,r){var i=n.Adapter.uid(e);n.Adapter.handlers[i]=n.Adapter.handlers[i]||{},n.Adapter.handlers[i][t]=n.Adapter.handlers[i][t]||[],n.Adapter.handlers[i][t].push(r),e["on"+t]=function(e,t){return function(r){n.Adapter.trigger(e,t,r)}}(e,t)},trigger:function(e,t,r){r=r||{};var i=n.Adapter.uid(e),s,o;n.Adapter.handlers[i]=n.Adapter.handlers[i]||{},n.Adapter.handlers[i][t]=n.Adapter.handlers[i][t]||[];for(s=0,o=n.Adapter.handlers[i][t].length;s<o;++s)n.Adapter.handlers[i][t][s].apply(this,[r])},extractEventData:function(e,n){var r=n&&n[e]||t;return r},onDomLoad:function(t){var n=e.setTimeout(function(){t()},2e3);e.onload=function(){clearTimeout(n),t()}}},typeof n.init!="undefined"&&n.init()})(window)
|
@ -0,0 +1 @@
|
||||
(function(e,t){"use strict";var n=e.History=e.History||{},r=e.document,i=e.RightJS,s=i.$;if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={bind:function(e,t,n){s(e).on(t,n)},trigger:function(e,t,n){s(e).fire(t,n)},extractEventData:function(e,n){var r=n&&n._&&n._[e]||t;return r},onDomLoad:function(e){s(r).onReady(e)}},typeof n.init!="undefined"&&n.init()})(window)
|
@ -0,0 +1 @@
|
||||
(function(e,t){"use strict";var n=e.History=e.History||{},r=e.Zepto;if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={bind:function(e,t,n){(new r(e)).bind(t,n)},trigger:function(e,t){(new r(e)).trigger(t)},extractEventData:function(e,n){var r=n&&n[e]||t;return r},onDomLoad:function(e){new r(e)}},typeof n.init!="undefined"&&n.init()})(window)
|
@ -0,0 +1 @@
|
||||
(function(e,t){"use strict";var n=e.document,r=e.setTimeout||r,i=e.clearTimeout||i,s=e.setInterval||s,o=e.History=e.History||{};if(typeof o.initHtml4!="undefined")throw new Error("History.js HTML4 Support has already been loaded...");o.initHtml4=function(){if(typeof o.initHtml4.initialized!="undefined")return!1;o.initHtml4.initialized=!0,o.enabled=!0,o.savedHashes=[],o.isLastHash=function(e){var t=o.getHashByIndex(),n;return n=e===t,n},o.isHashEqual=function(e,t){return e=encodeURIComponent(e).replace(/%25/g,"%"),t=encodeURIComponent(t).replace(/%25/g,"%"),e===t},o.saveHash=function(e){return o.isLastHash(e)?!1:(o.savedHashes.push(e),!0)},o.getHashByIndex=function(e){var t=null;return typeof e=="undefined"?t=o.savedHashes[o.savedHashes.length-1]:e<0?t=o.savedHashes[o.savedHashes.length+e]:t=o.savedHashes[e],t},o.discardedHashes={},o.discardedStates={},o.discardState=function(e,t,n){var r=o.getHashByState(e),i;return i={discardedState:e,backState:n,forwardState:t},o.discardedStates[r]=i,!0},o.discardHash=function(e,t,n){var r={discardedHash:e,backState:n,forwardState:t};return o.discardedHashes[e]=r,!0},o.discardedState=function(e){var t=o.getHashByState(e),n;return n=o.discardedStates[t]||!1,n},o.discardedHash=function(e){var t=o.discardedHashes[e]||!1;return t},o.recycleState=function(e){var t=o.getHashByState(e);return o.discardedState(e)&&delete o.discardedStates[t],!0},o.emulated.hashChange&&(o.hashChangeInit=function(){o.checkerFunction=null;var t="",r,i,u,a,f=Boolean(o.getHash());return o.isInternetExplorer()?(r="historyjs-iframe",i=n.createElement("iframe"),i.setAttribute("id",r),i.setAttribute("src","#"),i.style.display="none",n.body.appendChild(i),i.contentWindow.document.open(),i.contentWindow.document.close(),u="",a=!1,o.checkerFunction=function(){if(a)return!1;a=!0;var n=o.getHash(),r=o.getHash(i.contentWindow.document);return n!==t?(t=n,r!==n&&(u=r=n,i.contentWindow.document.open(),i.contentWindow.document.close(),i.contentWindow.document.location.hash=o.escapeHash(n)),o.Adapter.trigger(e,"hashchange")):r!==u&&(u=r,f&&r===""?o.back():o.setHash(r,!1)),a=!1,!0}):o.checkerFunction=function(){var n=o.getHash()||"";return n!==t&&(t=n,o.Adapter.trigger(e,"hashchange")),!0},o.intervalList.push(s(o.checkerFunction,o.options.hashChangeInterval)),!0},o.Adapter.onDomLoad(o.hashChangeInit)),o.emulated.pushState&&(o.onHashChange=function(t){var n=t&&t.newURL||o.getLocationHref(),r=o.getHashByUrl(n),i=null,s=null,u=null,a;return o.isLastHash(r)?(o.busy(!1),!1):(o.doubleCheckComplete(),o.saveHash(r),r&&o.isTraditionalAnchor(r)?(o.Adapter.trigger(e,"anchorchange"),o.busy(!1),!1):(i=o.extractState(o.getFullUrl(r||o.getLocationHref()),!0),o.isLastSavedState(i)?(o.busy(!1),!1):(s=o.getHashByState(i),a=o.discardedState(i),a?(o.getHashByIndex(-2)===o.getHashByState(a.forwardState)?o.back(!1):o.forward(!1),!1):(o.pushState(i.data,i.title,encodeURI(i.url),!1),!0))))},o.Adapter.bind(e,"hashchange",o.onHashChange),o.pushState=function(t,n,r,i){r=encodeURI(r).replace(/%25/g,"%");if(o.getHashByUrl(r))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(i!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.pushState,args:arguments,queue:i}),!1;o.busy(!0);var s=o.createStateObject(t,n,r),u=o.getHashByState(s),a=o.getState(!1),f=o.getHashByState(a),l=o.getHash(),c=o.expectedStateId==s.id;return o.storeState(s),o.expectedStateId=s.id,o.recycleState(s),o.setTitle(s),u===f?(o.busy(!1),!1):(o.saveState(s),c||o.Adapter.trigger(e,"statechange"),!o.isHashEqual(u,l)&&!o.isHashEqual(u,o.getShortUrl(o.getLocationHref()))&&o.setHash(u,!1),o.busy(!1),!0)},o.replaceState=function(t,n,r,i){r=encodeURI(r).replace(/%25/g,"%");if(o.getHashByUrl(r))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(i!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.replaceState,args:arguments,queue:i}),!1;o.busy(!0);var s=o.createStateObject(t,n,r),u=o.getHashByState(s),a=o.getState(!1),f=o.getHashByState(a),l=o.getStateByIndex(-2);return o.discardState(a,s,l),u===f?(o.storeState(s),o.expectedStateId=s.id,o.recycleState(s),o.setTitle(s),o.saveState(s),o.Adapter.trigger(e,"statechange"),o.busy(!1)):o.pushState(s.data,s.title,s.url,!1),!0}),o.emulated.pushState&&o.getHash()&&!o.emulated.hashChange&&o.Adapter.onDomLoad(function(){o.Adapter.trigger(e,"hashchange")})},typeof o.init!="undefined"&&o.init()})(window)
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
typeof JSON!="object"&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n<s;n+=1)u[n]=str(n,a)||"null";return i=u.length===0?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+o+"]":"["+u.join(",")+"]",gap=o,i}if(rep&&typeof rep=="object"){s=rep.length;for(n=0;n<s;n+=1)typeof rep[n]=="string"&&(r=rep[n],i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i))}else for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i));return i=u.length===0?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+o+"}":"{"+u.join(",")+"}",gap=o,i}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(e){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(e,t,n){var r;gap="",indent="";if(typeof n=="number")for(r=0;r<n;r+=1)indent+=" ";else typeof n=="string"&&(indent=n);rep=t;if(!t||typeof t=="function"||typeof t=="object"&&typeof t.length=="number")return str("",{"":e});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&typeof i=="object")for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r=walk(i,n),r!==undefined?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()
|
@ -0,0 +1,121 @@
|
||||
/**
|
||||
* History.js Dojo Adapter
|
||||
*
|
||||
* Essentially the same as the native adapter but uses dojo/ready for the dom load callback.
|
||||
*
|
||||
* @author Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
|
||||
*/
|
||||
|
||||
// Closure
|
||||
(function(window,undefined){
|
||||
"use strict";
|
||||
|
||||
// Localise Globals
|
||||
var History = window.History = window.History||{},
|
||||
require = window.require;
|
||||
|
||||
// Check Existence
|
||||
if ( typeof History.Adapter !== 'undefined' ) {
|
||||
throw new Error('History.js Adapter has already been loaded...');
|
||||
}
|
||||
|
||||
// Add the Adapter
|
||||
History.Adapter = {
|
||||
/**
|
||||
* History.Adapter.handlers[uid][eventName] = Array
|
||||
*/
|
||||
handlers: {},
|
||||
|
||||
/**
|
||||
* History.Adapter._uid
|
||||
* The current element unique identifier
|
||||
*/
|
||||
_uid: 1,
|
||||
|
||||
/**
|
||||
* History.Adapter.uid(element)
|
||||
* @param {Element} element
|
||||
* @return {String} uid
|
||||
*/
|
||||
uid: function(element){
|
||||
return element._uid || (element._uid = History.Adapter._uid++);
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.bind(el,event,callback)
|
||||
* @param {Element} element
|
||||
* @param {String} eventName - custom and standard events
|
||||
* @param {Function} callback
|
||||
* @return
|
||||
*/
|
||||
bind: function(element,eventName,callback){
|
||||
// Prepare
|
||||
var uid = History.Adapter.uid(element);
|
||||
|
||||
// Apply Listener
|
||||
History.Adapter.handlers[uid] = History.Adapter.handlers[uid] || {};
|
||||
History.Adapter.handlers[uid][eventName] = History.Adapter.handlers[uid][eventName] || [];
|
||||
History.Adapter.handlers[uid][eventName].push(callback);
|
||||
|
||||
// Bind Global Listener
|
||||
element['on'+eventName] = (function(element,eventName){
|
||||
return function(event){
|
||||
History.Adapter.trigger(element,eventName,event);
|
||||
};
|
||||
})(element,eventName);
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.trigger(el,event)
|
||||
* @param {Element} element
|
||||
* @param {String} eventName - custom and standard events
|
||||
* @param {Object} event - a object of event data
|
||||
* @return
|
||||
*/
|
||||
trigger: function(element,eventName,event){
|
||||
// Prepare
|
||||
event = event || {};
|
||||
var uid = History.Adapter.uid(element),
|
||||
i,n;
|
||||
|
||||
// Apply Listener
|
||||
History.Adapter.handlers[uid] = History.Adapter.handlers[uid] || {};
|
||||
History.Adapter.handlers[uid][eventName] = History.Adapter.handlers[uid][eventName] || [];
|
||||
|
||||
// Fire Listeners
|
||||
for ( i=0,n=History.Adapter.handlers[uid][eventName].length; i<n; ++i ) {
|
||||
History.Adapter.handlers[uid][eventName][i].apply(this,[event]);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.extractEventData(key,event,extra)
|
||||
* @param {String} key - key for the event data to extract
|
||||
* @param {String} event - custom and standard events
|
||||
* @return {mixed}
|
||||
*/
|
||||
extractEventData: function(key,event){
|
||||
var result = (event && event[key]) || undefined;
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.onDomLoad(callback)
|
||||
* @param {Function} callback
|
||||
* @return
|
||||
*/
|
||||
onDomLoad: function(callback) {
|
||||
require(["dojo/ready"], function(ready) {
|
||||
ready(callback);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Try to Initialise History
|
||||
if ( typeof History.init !== 'undefined' ) {
|
||||
History.init();
|
||||
}
|
||||
|
||||
})(window);
|
@ -0,0 +1,92 @@
|
||||
/**
|
||||
* History.js ExtJS Adapter
|
||||
* @author Sean Adkinson <sean.adkinson@gmail.com>
|
||||
* @copyright 2012 Sean Adkinson <sean.adkinson@gmail.com>
|
||||
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
|
||||
*/
|
||||
|
||||
// Closure
|
||||
(function(window,undefined){
|
||||
"use strict";
|
||||
|
||||
// Localise Globals
|
||||
var
|
||||
History = window.History = window.History||{},
|
||||
Ext = window.Ext;
|
||||
|
||||
window.JSON = {
|
||||
stringify: Ext.JSON.encode,
|
||||
parse: Ext.JSON.decode
|
||||
};
|
||||
|
||||
// Check Existence
|
||||
if ( typeof History.Adapter !== 'undefined' ) {
|
||||
throw new Error('History.js Adapter has already been loaded...');
|
||||
}
|
||||
|
||||
// Add the Adapter
|
||||
History.Adapter = {
|
||||
observables: {},
|
||||
|
||||
/**
|
||||
* History.Adapter.bind(el,event,callback)
|
||||
* @param {Element|string} el
|
||||
* @param {string} event - custom and standard events
|
||||
* @param {function} callback
|
||||
* @param {Object} scope
|
||||
* @return {void}
|
||||
*/
|
||||
bind: function(element,eventName,callback,scope){
|
||||
Ext.EventManager.addListener(element, eventName, callback, scope);
|
||||
|
||||
//bind an observable to the element that will let us "trigger" events on it
|
||||
var id = Ext.id(element, 'history-'), observable = this.observables[id];
|
||||
if (!observable) {
|
||||
observable = Ext.create('Ext.util.Observable');
|
||||
this.observables[id] = observable;
|
||||
}
|
||||
observable.on(eventName, callback, scope);
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.trigger(el,event)
|
||||
* @param {Element|string} el
|
||||
* @param {string} event - custom and standard events
|
||||
* @param {Object=} extra - a object of extra event data (optional)
|
||||
* @return {void}
|
||||
*/
|
||||
trigger: function(element,eventName,extra){
|
||||
var id = Ext.id(element, 'history-'), observable = this.observables[id];
|
||||
if (observable) {
|
||||
observable.fireEvent(eventName, extra);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.extractEventData(key,event,extra)
|
||||
* @param {string} key - key for the event data to extract
|
||||
* @param {string} event - custom and standard events
|
||||
* @param {Object=} extra - a object of extra event data (optional)
|
||||
* @return {mixed}
|
||||
*/
|
||||
extractEventData: function(key,event,extra){
|
||||
var result = (event && event.browserEvent && event.browserEvent[key]) || (extra && extra[key]) || undefined;
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.onDomLoad(callback)
|
||||
* @param {function} callback
|
||||
* @return {void}
|
||||
*/
|
||||
onDomLoad: function(callback) {
|
||||
Ext.onReady(callback);
|
||||
}
|
||||
};
|
||||
|
||||
// Try and Initialise History
|
||||
if ( typeof History.init !== 'undefined' ) {
|
||||
History.init();
|
||||
}
|
||||
|
||||
})(window);
|
@ -0,0 +1,77 @@
|
||||
/**
|
||||
* History.js jQuery Adapter
|
||||
* @author Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
|
||||
*/
|
||||
|
||||
// Closure
|
||||
(function(window,undefined){
|
||||
"use strict";
|
||||
|
||||
// Localise Globals
|
||||
var
|
||||
History = window.History = window.History||{},
|
||||
jQuery = window.jQuery;
|
||||
|
||||
// Check Existence
|
||||
if ( typeof History.Adapter !== 'undefined' ) {
|
||||
throw new Error('History.js Adapter has already been loaded...');
|
||||
}
|
||||
|
||||
// Add the Adapter
|
||||
History.Adapter = {
|
||||
/**
|
||||
* History.Adapter.bind(el,event,callback)
|
||||
* @param {Element|string} el
|
||||
* @param {string} event - custom and standard events
|
||||
* @param {function} callback
|
||||
* @return {void}
|
||||
*/
|
||||
bind: function(el,event,callback){
|
||||
jQuery(el).bind(event,callback);
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.trigger(el,event)
|
||||
* @param {Element|string} el
|
||||
* @param {string} event - custom and standard events
|
||||
* @param {Object=} extra - a object of extra event data (optional)
|
||||
* @return {void}
|
||||
*/
|
||||
trigger: function(el,event,extra){
|
||||
jQuery(el).trigger(event,extra);
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.extractEventData(key,event,extra)
|
||||
* @param {string} key - key for the event data to extract
|
||||
* @param {string} event - custom and standard events
|
||||
* @param {Object=} extra - a object of extra event data (optional)
|
||||
* @return {mixed}
|
||||
*/
|
||||
extractEventData: function(key,event,extra){
|
||||
// jQuery Native then jQuery Custom
|
||||
var result = (event && event.originalEvent && event.originalEvent[key]) || (extra && extra[key]) || undefined;
|
||||
|
||||
// Return
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.onDomLoad(callback)
|
||||
* @param {function} callback
|
||||
* @return {void}
|
||||
*/
|
||||
onDomLoad: function(callback) {
|
||||
jQuery(callback);
|
||||
}
|
||||
};
|
||||
|
||||
// Try and Initialise History
|
||||
if ( typeof History.init !== 'undefined' ) {
|
||||
History.init();
|
||||
}
|
||||
|
||||
})(window);
|
||||
|
@ -0,0 +1,84 @@
|
||||
/**
|
||||
* History.js MooTools Adapter
|
||||
* @author Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
|
||||
*/
|
||||
|
||||
// Closure
|
||||
(function(window,undefined){
|
||||
"use strict";
|
||||
|
||||
// Localise Globals
|
||||
var
|
||||
History = window.History = window.History||{},
|
||||
MooTools = window.MooTools,
|
||||
Element = window.Element;
|
||||
|
||||
// Check Existence
|
||||
if ( typeof History.Adapter !== 'undefined' ) {
|
||||
throw new Error('History.js Adapter has already been loaded...');
|
||||
}
|
||||
|
||||
// Make MooTools aware of History.js Events
|
||||
Object.append(Element.NativeEvents,{
|
||||
'popstate':2,
|
||||
'hashchange':2
|
||||
});
|
||||
|
||||
// Add the Adapter
|
||||
History.Adapter = {
|
||||
/**
|
||||
* History.Adapter.bind(el,event,callback)
|
||||
* @param {Element|string} el
|
||||
* @param {string} event - custom and standard events
|
||||
* @param {function} callback
|
||||
* @return {void}
|
||||
*/
|
||||
bind: function(el,event,callback){
|
||||
var El = typeof el === 'string' ? document.id(el) : el;
|
||||
El.addEvent(event,callback);
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.trigger(el,event)
|
||||
* @param {Element|string} el
|
||||
* @param {string} event - custom and standard events
|
||||
* @param {Object=} extra - a object of extra event data (optional)
|
||||
* @return void
|
||||
*/
|
||||
trigger: function(el,event,extra){
|
||||
var El = typeof el === 'string' ? document.id(el) : el;
|
||||
El.fireEvent(event,extra);
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.extractEventData(key,event,extra)
|
||||
* @param {string} key - key for the event data to extract
|
||||
* @param {string} event - custom and standard events
|
||||
* @return {mixed}
|
||||
*/
|
||||
extractEventData: function(key,event){
|
||||
// MooTools Native then MooTools Custom
|
||||
var result = (event && event.event && event.event[key]) || (event && event[key]) || undefined;
|
||||
|
||||
// Return
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.onDomLoad(callback)
|
||||
* @param {function} callback
|
||||
* @return {void}
|
||||
*/
|
||||
onDomLoad: function(callback) {
|
||||
window.addEvent('domready',callback);
|
||||
}
|
||||
};
|
||||
|
||||
// Try and Initialise History
|
||||
if ( typeof History.init !== 'undefined' ) {
|
||||
History.init();
|
||||
}
|
||||
|
||||
})(window);
|
@ -0,0 +1,121 @@
|
||||
/**
|
||||
* History.js Native Adapter
|
||||
* @author Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
|
||||
*/
|
||||
|
||||
// Closure
|
||||
(function(window,undefined){
|
||||
"use strict";
|
||||
|
||||
// Localise Globals
|
||||
var History = window.History = window.History||{};
|
||||
|
||||
// Check Existence
|
||||
if ( typeof History.Adapter !== 'undefined' ) {
|
||||
throw new Error('History.js Adapter has already been loaded...');
|
||||
}
|
||||
|
||||
// Add the Adapter
|
||||
History.Adapter = {
|
||||
/**
|
||||
* History.Adapter.handlers[uid][eventName] = Array
|
||||
*/
|
||||
handlers: {},
|
||||
|
||||
/**
|
||||
* History.Adapter._uid
|
||||
* The current element unique identifier
|
||||
*/
|
||||
_uid: 1,
|
||||
|
||||
/**
|
||||
* History.Adapter.uid(element)
|
||||
* @param {Element} element
|
||||
* @return {String} uid
|
||||
*/
|
||||
uid: function(element){
|
||||
return element._uid || (element._uid = History.Adapter._uid++);
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.bind(el,event,callback)
|
||||
* @param {Element} element
|
||||
* @param {String} eventName - custom and standard events
|
||||
* @param {Function} callback
|
||||
* @return
|
||||
*/
|
||||
bind: function(element,eventName,callback){
|
||||
// Prepare
|
||||
var uid = History.Adapter.uid(element);
|
||||
|
||||
// Apply Listener
|
||||
History.Adapter.handlers[uid] = History.Adapter.handlers[uid] || {};
|
||||
History.Adapter.handlers[uid][eventName] = History.Adapter.handlers[uid][eventName] || [];
|
||||
History.Adapter.handlers[uid][eventName].push(callback);
|
||||
|
||||
// Bind Global Listener
|
||||
element['on'+eventName] = (function(element,eventName){
|
||||
return function(event){
|
||||
History.Adapter.trigger(element,eventName,event);
|
||||
};
|
||||
})(element,eventName);
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.trigger(el,event)
|
||||
* @param {Element} element
|
||||
* @param {String} eventName - custom and standard events
|
||||
* @param {Object} event - a object of event data
|
||||
* @return
|
||||
*/
|
||||
trigger: function(element,eventName,event){
|
||||
// Prepare
|
||||
event = event || {};
|
||||
var uid = History.Adapter.uid(element),
|
||||
i,n;
|
||||
|
||||
// Apply Listener
|
||||
History.Adapter.handlers[uid] = History.Adapter.handlers[uid] || {};
|
||||
History.Adapter.handlers[uid][eventName] = History.Adapter.handlers[uid][eventName] || [];
|
||||
|
||||
// Fire Listeners
|
||||
for ( i=0,n=History.Adapter.handlers[uid][eventName].length; i<n; ++i ) {
|
||||
History.Adapter.handlers[uid][eventName][i].apply(this,[event]);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.extractEventData(key,event,extra)
|
||||
* @param {String} key - key for the event data to extract
|
||||
* @param {String} event - custom and standard events
|
||||
* @return {mixed}
|
||||
*/
|
||||
extractEventData: function(key,event){
|
||||
var result = (event && event[key]) || undefined;
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.onDomLoad(callback)
|
||||
* @param {Function} callback
|
||||
* @return
|
||||
*/
|
||||
onDomLoad: function(callback) {
|
||||
var timeout = window.setTimeout(function(){
|
||||
callback();
|
||||
},2000);
|
||||
window.onload = function(){
|
||||
clearTimeout(timeout);
|
||||
callback();
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// Try to Initialise History
|
||||
if ( typeof History.init !== 'undefined' ) {
|
||||
History.init();
|
||||
}
|
||||
|
||||
})(window);
|
@ -0,0 +1,78 @@
|
||||
/**
|
||||
* History.js RightJS Adapter
|
||||
* @author Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
|
||||
*/
|
||||
|
||||
// Closure
|
||||
(function(window,undefined){
|
||||
"use strict";
|
||||
|
||||
// Localise Globals
|
||||
var
|
||||
History = window.History = window.History||{},
|
||||
document = window.document,
|
||||
RightJS = window.RightJS,
|
||||
$ = RightJS.$;
|
||||
|
||||
// Check Existence
|
||||
if ( typeof History.Adapter !== 'undefined' ) {
|
||||
throw new Error('History.js Adapter has already been loaded...');
|
||||
}
|
||||
|
||||
// Add the Adapter
|
||||
History.Adapter = {
|
||||
/**
|
||||
* History.Adapter.bind(el,event,callback)
|
||||
* @param {Element|Selector} el
|
||||
* @param {String} event - custom and standard events
|
||||
* @param {Function} callback
|
||||
* @return
|
||||
*/
|
||||
bind: function(el,event,callback){
|
||||
$(el).on(event,callback);
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.trigger(el,event)
|
||||
* @param {Element|Selector} el
|
||||
* @param {String} event - custom and standard events
|
||||
* @param {Object} extraEventData - a object of extra event data
|
||||
* @return
|
||||
*/
|
||||
trigger: function(el,event,extraEventData){
|
||||
$(el).fire(event,extraEventData);
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.extractEventData(key,event,extra)
|
||||
* @param {String} key - key for the event data to extract
|
||||
* @param {String} event - custom and standard events
|
||||
* @return {mixed}
|
||||
*/
|
||||
extractEventData: function(key,event){
|
||||
// Right.js Native
|
||||
// Right.js Custom
|
||||
var result = (event && event._ && event._[key]) || undefined;
|
||||
|
||||
// Return
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.onDomLoad(callback)
|
||||
* @param {Function} callback
|
||||
* @return
|
||||
*/
|
||||
onDomLoad: function(callback) {
|
||||
$(document).onReady(callback);
|
||||
}
|
||||
};
|
||||
|
||||
// Try and Initialise History
|
||||
if ( typeof History.init !== 'undefined' ) {
|
||||
History.init();
|
||||
}
|
||||
|
||||
})(window);
|
@ -0,0 +1,74 @@
|
||||
/**
|
||||
* History.js Zepto Adapter
|
||||
* @author Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
|
||||
*/
|
||||
|
||||
// Closure
|
||||
(function(window,undefined){
|
||||
"use strict";
|
||||
|
||||
// Localise Globals
|
||||
var
|
||||
History = window.History = window.History||{},
|
||||
Zepto = window.Zepto;
|
||||
|
||||
// Check Existence
|
||||
if ( typeof History.Adapter !== 'undefined' ) {
|
||||
throw new Error('History.js Adapter has already been loaded...');
|
||||
}
|
||||
|
||||
// Add the Adapter
|
||||
History.Adapter = {
|
||||
/**
|
||||
* History.Adapter.bind(el,event,callback)
|
||||
* @param {Element|string} el
|
||||
* @param {string} event - custom and standard events
|
||||
* @param {function} callback
|
||||
* @return {void}
|
||||
*/
|
||||
bind: function(el,event,callback){
|
||||
new Zepto(el).bind(event,callback);
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.trigger(el,event)
|
||||
* @param {Element|string} el
|
||||
* @param {string} event - custom and standard events
|
||||
* @return {void}
|
||||
*/
|
||||
trigger: function(el,event){
|
||||
new Zepto(el).trigger(event);
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.extractEventData(key,event,extra)
|
||||
* @param {string} key - key for the event data to extract
|
||||
* @param {string} event - custom and standard events
|
||||
* @return {mixed}
|
||||
*/
|
||||
extractEventData: function(key,event){
|
||||
// Zepto Native
|
||||
var result = (event && event[key]) || undefined;
|
||||
|
||||
// Return
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* History.Adapter.onDomLoad(callback)
|
||||
* @param {function} callback
|
||||
* @return {void}
|
||||
*/
|
||||
onDomLoad: function(callback) {
|
||||
new Zepto(callback);
|
||||
}
|
||||
};
|
||||
|
||||
// Try and Initialise History
|
||||
if ( typeof History.init !== 'undefined' ) {
|
||||
History.init();
|
||||
}
|
||||
|
||||
})(window);
|
@ -0,0 +1,685 @@
|
||||
/**
|
||||
* History.js HTML4 Support
|
||||
* Depends on the HTML5 Support
|
||||
* @author Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
|
||||
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
|
||||
*/
|
||||
|
||||
(function(window,undefined){
|
||||
"use strict";
|
||||
|
||||
// ========================================================================
|
||||
// Initialise
|
||||
|
||||
// Localise Globals
|
||||
var
|
||||
document = window.document, // Make sure we are using the correct document
|
||||
setTimeout = window.setTimeout||setTimeout,
|
||||
clearTimeout = window.clearTimeout||clearTimeout,
|
||||
setInterval = window.setInterval||setInterval,
|
||||
History = window.History = window.History||{}; // Public History Object
|
||||
|
||||
// Check Existence
|
||||
if ( typeof History.initHtml4 !== 'undefined' ) {
|
||||
throw new Error('History.js HTML4 Support has already been loaded...');
|
||||
}
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Initialise HTML4 Support
|
||||
|
||||
// Initialise HTML4 Support
|
||||
History.initHtml4 = function(){
|
||||
// Initialise
|
||||
if ( typeof History.initHtml4.initialized !== 'undefined' ) {
|
||||
// Already Loaded
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
History.initHtml4.initialized = true;
|
||||
}
|
||||
|
||||
|
||||
// ====================================================================
|
||||
// Properties
|
||||
|
||||
/**
|
||||
* History.enabled
|
||||
* Is History enabled?
|
||||
*/
|
||||
History.enabled = true;
|
||||
|
||||
|
||||
// ====================================================================
|
||||
// Hash Storage
|
||||
|
||||
/**
|
||||
* History.savedHashes
|
||||
* Store the hashes in an array
|
||||
*/
|
||||
History.savedHashes = [];
|
||||
|
||||
/**
|
||||
* History.isLastHash(newHash)
|
||||
* Checks if the hash is the last hash
|
||||
* @param {string} newHash
|
||||
* @return {boolean} true
|
||||
*/
|
||||
History.isLastHash = function(newHash){
|
||||
// Prepare
|
||||
var oldHash = History.getHashByIndex(),
|
||||
isLast;
|
||||
|
||||
// Check
|
||||
isLast = newHash === oldHash;
|
||||
|
||||
// Return isLast
|
||||
return isLast;
|
||||
};
|
||||
|
||||
/**
|
||||
* History.isHashEqual(newHash, oldHash)
|
||||
* Checks to see if two hashes are functionally equal
|
||||
* @param {string} newHash
|
||||
* @param {string} oldHash
|
||||
* @return {boolean} true
|
||||
*/
|
||||
History.isHashEqual = function(newHash, oldHash){
|
||||
newHash = encodeURIComponent(newHash).replace(/%25/g, "%");
|
||||
oldHash = encodeURIComponent(oldHash).replace(/%25/g, "%");
|
||||
return newHash === oldHash;
|
||||
};
|
||||
|
||||
/**
|
||||
* History.saveHash(newHash)
|
||||
* Push a Hash
|
||||
* @param {string} newHash
|
||||
* @return {boolean} true
|
||||
*/
|
||||
History.saveHash = function(newHash){
|
||||
// Check Hash
|
||||
if ( History.isLastHash(newHash) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Push the Hash
|
||||
History.savedHashes.push(newHash);
|
||||
|
||||
// Return true
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* History.getHashByIndex()
|
||||
* Gets a hash by the index
|
||||
* @param {integer} index
|
||||
* @return {string}
|
||||
*/
|
||||
History.getHashByIndex = function(index){
|
||||
// Prepare
|
||||
var hash = null;
|
||||
|
||||
// Handle
|
||||
if ( typeof index === 'undefined' ) {
|
||||
// Get the last inserted
|
||||
hash = History.savedHashes[History.savedHashes.length-1];
|
||||
}
|
||||
else if ( index < 0 ) {
|
||||
// Get from the end
|
||||
hash = History.savedHashes[History.savedHashes.length+index];
|
||||
}
|
||||
else {
|
||||
// Get from the beginning
|
||||
hash = History.savedHashes[index];
|
||||
}
|
||||
|
||||
// Return hash
|
||||
return hash;
|
||||
};
|
||||
|
||||
|
||||
// ====================================================================
|
||||
// Discarded States
|
||||
|
||||
/**
|
||||
* History.discardedHashes
|
||||
* A hashed array of discarded hashes
|
||||
*/
|
||||
History.discardedHashes = {};
|
||||
|
||||
/**
|
||||
* History.discardedStates
|
||||
* A hashed array of discarded states
|
||||
*/
|
||||
History.discardedStates = {};
|
||||
|
||||
/**
|
||||
* History.discardState(State)
|
||||
* Discards the state by ignoring it through History
|
||||
* @param {object} State
|
||||
* @return {true}
|
||||
*/
|
||||
History.discardState = function(discardedState,forwardState,backState){
|
||||
//History.debug('History.discardState', arguments);
|
||||
// Prepare
|
||||
var discardedStateHash = History.getHashByState(discardedState),
|
||||
discardObject;
|
||||
|
||||
// Create Discard Object
|
||||
discardObject = {
|
||||
'discardedState': discardedState,
|
||||
'backState': backState,
|
||||
'forwardState': forwardState
|
||||
};
|
||||
|
||||
// Add to DiscardedStates
|
||||
History.discardedStates[discardedStateHash] = discardObject;
|
||||
|
||||
// Return true
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* History.discardHash(hash)
|
||||
* Discards the hash by ignoring it through History
|
||||
* @param {string} hash
|
||||
* @return {true}
|
||||
*/
|
||||
History.discardHash = function(discardedHash,forwardState,backState){
|
||||
//History.debug('History.discardState', arguments);
|
||||
// Create Discard Object
|
||||
var discardObject = {
|
||||
'discardedHash': discardedHash,
|
||||
'backState': backState,
|
||||
'forwardState': forwardState
|
||||
};
|
||||
|
||||
// Add to discardedHash
|
||||
History.discardedHashes[discardedHash] = discardObject;
|
||||
|
||||
// Return true
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* History.discardedState(State)
|
||||
* Checks to see if the state is discarded
|
||||
* @param {object} State
|
||||
* @return {bool}
|
||||
*/
|
||||
History.discardedState = function(State){
|
||||
// Prepare
|
||||
var StateHash = History.getHashByState(State),
|
||||
discarded;
|
||||
|
||||
// Check
|
||||
discarded = History.discardedStates[StateHash]||false;
|
||||
|
||||
// Return true
|
||||
return discarded;
|
||||
};
|
||||
|
||||
/**
|
||||
* History.discardedHash(hash)
|
||||
* Checks to see if the state is discarded
|
||||
* @param {string} State
|
||||
* @return {bool}
|
||||
*/
|
||||
History.discardedHash = function(hash){
|
||||
// Check
|
||||
var discarded = History.discardedHashes[hash]||false;
|
||||
|
||||
// Return true
|
||||
return discarded;
|
||||
};
|
||||
|
||||
/**
|
||||
* History.recycleState(State)
|
||||
* Allows a discarded state to be used again
|
||||
* @param {object} data
|
||||
* @param {string} title
|
||||
* @param {string} url
|
||||
* @return {true}
|
||||
*/
|
||||
History.recycleState = function(State){
|
||||
//History.debug('History.recycleState', arguments);
|
||||
// Prepare
|
||||
var StateHash = History.getHashByState(State);
|
||||
|
||||
// Remove from DiscardedStates
|
||||
if ( History.discardedState(State) ) {
|
||||
delete History.discardedStates[StateHash];
|
||||
}
|
||||
|
||||
// Return true
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
// ====================================================================
|
||||
// HTML4 HashChange Support
|
||||
|
||||
if ( History.emulated.hashChange ) {
|
||||
/*
|
||||
* We must emulate the HTML4 HashChange Support by manually checking for hash changes
|
||||
*/
|
||||
|
||||
/**
|
||||
* History.hashChangeInit()
|
||||
* Init the HashChange Emulation
|
||||
*/
|
||||
History.hashChangeInit = function(){
|
||||
// Define our Checker Function
|
||||
History.checkerFunction = null;
|
||||
|
||||
// Define some variables that will help in our checker function
|
||||
var lastDocumentHash = '',
|
||||
iframeId, iframe,
|
||||
lastIframeHash, checkerRunning,
|
||||
startedWithHash = Boolean(History.getHash());
|
||||
|
||||
// Handle depending on the browser
|
||||
if ( History.isInternetExplorer() ) {
|
||||
// IE6 and IE7
|
||||
// We need to use an iframe to emulate the back and forward buttons
|
||||
|
||||
// Create iFrame
|
||||
iframeId = 'historyjs-iframe';
|
||||
iframe = document.createElement('iframe');
|
||||
|
||||
// Adjust iFarme
|
||||
// IE 6 requires iframe to have a src on HTTPS pages, otherwise it will throw a
|
||||
// "This page contains both secure and nonsecure items" warning.
|
||||
iframe.setAttribute('id', iframeId);
|
||||
iframe.setAttribute('src', '#');
|
||||
iframe.style.display = 'none';
|
||||
|
||||
// Append iFrame
|
||||
document.body.appendChild(iframe);
|
||||
|
||||
// Create initial history entry
|
||||
iframe.contentWindow.document.open();
|
||||
iframe.contentWindow.document.close();
|
||||
|
||||
// Define some variables that will help in our checker function
|
||||
lastIframeHash = '';
|
||||
checkerRunning = false;
|
||||
|
||||
// Define the checker function
|
||||
History.checkerFunction = function(){
|
||||
// Check Running
|
||||
if ( checkerRunning ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Update Running
|
||||
checkerRunning = true;
|
||||
|
||||
// Fetch
|
||||
var
|
||||
documentHash = History.getHash(),
|
||||
iframeHash = History.getHash(iframe.contentWindow.document);
|
||||
|
||||
// The Document Hash has changed (application caused)
|
||||
if ( documentHash !== lastDocumentHash ) {
|
||||
// Equalise
|
||||
lastDocumentHash = documentHash;
|
||||
|
||||
// Create a history entry in the iframe
|
||||
if ( iframeHash !== documentHash ) {
|
||||
//History.debug('hashchange.checker: iframe hash change', 'documentHash (new):', documentHash, 'iframeHash (old):', iframeHash);
|
||||
|
||||
// Equalise
|
||||
lastIframeHash = iframeHash = documentHash;
|
||||
|
||||
// Create History Entry
|
||||
iframe.contentWindow.document.open();
|
||||
iframe.contentWindow.document.close();
|
||||
|
||||
// Update the iframe's hash
|
||||
iframe.contentWindow.document.location.hash = History.escapeHash(documentHash);
|
||||
}
|
||||
|
||||
// Trigger Hashchange Event
|
||||
History.Adapter.trigger(window,'hashchange');
|
||||
}
|
||||
|
||||
// The iFrame Hash has changed (back button caused)
|
||||
else if ( iframeHash !== lastIframeHash ) {
|
||||
//History.debug('hashchange.checker: iframe hash out of sync', 'iframeHash (new):', iframeHash, 'documentHash (old):', documentHash);
|
||||
|
||||
// Equalise
|
||||
lastIframeHash = iframeHash;
|
||||
|
||||
// If there is no iframe hash that means we're at the original
|
||||
// iframe state.
|
||||
// And if there was a hash on the original request, the original
|
||||
// iframe state was replaced instantly, so skip this state and take
|
||||
// the user back to where they came from.
|
||||
if (startedWithHash && iframeHash === '') {
|
||||
History.back();
|
||||
}
|
||||
else {
|
||||
// Update the Hash
|
||||
History.setHash(iframeHash,false);
|
||||
}
|
||||
}
|
||||
|
||||
// Reset Running
|
||||
checkerRunning = false;
|
||||
|
||||
// Return true
|
||||
return true;
|
||||
};
|
||||
}
|
||||
else {
|
||||
// We are not IE
|
||||
// Firefox 1 or 2, Opera
|
||||
|
||||
// Define the checker function
|
||||
History.checkerFunction = function(){
|
||||
// Prepare
|
||||
var documentHash = History.getHash()||'';
|
||||
|
||||
// The Document Hash has changed (application caused)
|
||||
if ( documentHash !== lastDocumentHash ) {
|
||||
// Equalise
|
||||
lastDocumentHash = documentHash;
|
||||
|
||||
// Trigger Hashchange Event
|
||||
History.Adapter.trigger(window,'hashchange');
|
||||
}
|
||||
|
||||
// Return true
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
// Apply the checker function
|
||||
History.intervalList.push(setInterval(History.checkerFunction, History.options.hashChangeInterval));
|
||||
|
||||
// Done
|
||||
return true;
|
||||
}; // History.hashChangeInit
|
||||
|
||||
// Bind hashChangeInit
|
||||
History.Adapter.onDomLoad(History.hashChangeInit);
|
||||
|
||||
} // History.emulated.hashChange
|
||||
|
||||
|
||||
// ====================================================================
|
||||
// HTML5 State Support
|
||||
|
||||
// Non-Native pushState Implementation
|
||||
if ( History.emulated.pushState ) {
|
||||
/*
|
||||
* We must emulate the HTML5 State Management by using HTML4 HashChange
|
||||
*/
|
||||
|
||||
/**
|
||||
* History.onHashChange(event)
|
||||
* Trigger HTML5's window.onpopstate via HTML4 HashChange Support
|
||||
*/
|
||||
History.onHashChange = function(event){
|
||||
//History.debug('History.onHashChange', arguments);
|
||||
|
||||
// Prepare
|
||||
var currentUrl = ((event && event.newURL) || History.getLocationHref()),
|
||||
currentHash = History.getHashByUrl(currentUrl),
|
||||
currentState = null,
|
||||
currentStateHash = null,
|
||||
currentStateHashExits = null,
|
||||
discardObject;
|
||||
|
||||
// Check if we are the same state
|
||||
if ( History.isLastHash(currentHash) ) {
|
||||
// There has been no change (just the page's hash has finally propagated)
|
||||
//History.debug('History.onHashChange: no change');
|
||||
History.busy(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reset the double check
|
||||
History.doubleCheckComplete();
|
||||
|
||||
// Store our location for use in detecting back/forward direction
|
||||
History.saveHash(currentHash);
|
||||
|
||||
// Expand Hash
|
||||
if ( currentHash && History.isTraditionalAnchor(currentHash) ) {
|
||||
//History.debug('History.onHashChange: traditional anchor', currentHash);
|
||||
// Traditional Anchor Hash
|
||||
History.Adapter.trigger(window,'anchorchange');
|
||||
History.busy(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create State
|
||||
currentState = History.extractState(History.getFullUrl(currentHash||History.getLocationHref()),true);
|
||||
|
||||
// Check if we are the same state
|
||||
if ( History.isLastSavedState(currentState) ) {
|
||||
//History.debug('History.onHashChange: no change');
|
||||
// There has been no change (just the page's hash has finally propagated)
|
||||
History.busy(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create the state Hash
|
||||
currentStateHash = History.getHashByState(currentState);
|
||||
|
||||
// Check if we are DiscardedState
|
||||
discardObject = History.discardedState(currentState);
|
||||
if ( discardObject ) {
|
||||
// Ignore this state as it has been discarded and go back to the state before it
|
||||
if ( History.getHashByIndex(-2) === History.getHashByState(discardObject.forwardState) ) {
|
||||
// We are going backwards
|
||||
//History.debug('History.onHashChange: go backwards');
|
||||
History.back(false);
|
||||
} else {
|
||||
// We are going forwards
|
||||
//History.debug('History.onHashChange: go forwards');
|
||||
History.forward(false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Push the new HTML5 State
|
||||
//History.debug('History.onHashChange: success hashchange');
|
||||
History.pushState(currentState.data,currentState.title,encodeURI(currentState.url),false);
|
||||
|
||||
// End onHashChange closure
|
||||
return true;
|
||||
};
|
||||
History.Adapter.bind(window,'hashchange',History.onHashChange);
|
||||
|
||||
/**
|
||||
* History.pushState(data,title,url)
|
||||
* Add a new State to the history object, become it, and trigger onpopstate
|
||||
* We have to trigger for HTML4 compatibility
|
||||
* @param {object} data
|
||||
* @param {string} title
|
||||
* @param {string} url
|
||||
* @return {true}
|
||||
*/
|
||||
History.pushState = function(data,title,url,queue){
|
||||
//History.debug('History.pushState: called', arguments);
|
||||
|
||||
// We assume that the URL passed in is URI-encoded, but this makes
|
||||
// sure that it's fully URI encoded; any '%'s that are encoded are
|
||||
// converted back into '%'s
|
||||
url = encodeURI(url).replace(/%25/g, "%");
|
||||
|
||||
// Check the State
|
||||
if ( History.getHashByUrl(url) ) {
|
||||
throw new Error('History.js does not support states with fragment-identifiers (hashes/anchors).');
|
||||
}
|
||||
|
||||
// Handle Queueing
|
||||
if ( queue !== false && History.busy() ) {
|
||||
// Wait + Push to Queue
|
||||
//History.debug('History.pushState: we must wait', arguments);
|
||||
History.pushQueue({
|
||||
scope: History,
|
||||
callback: History.pushState,
|
||||
args: arguments,
|
||||
queue: queue
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make Busy
|
||||
History.busy(true);
|
||||
|
||||
// Fetch the State Object
|
||||
var newState = History.createStateObject(data,title,url),
|
||||
newStateHash = History.getHashByState(newState),
|
||||
oldState = History.getState(false),
|
||||
oldStateHash = History.getHashByState(oldState),
|
||||
html4Hash = History.getHash(),
|
||||
wasExpected = History.expectedStateId == newState.id;
|
||||
|
||||
// Store the newState
|
||||
History.storeState(newState);
|
||||
History.expectedStateId = newState.id;
|
||||
|
||||
// Recycle the State
|
||||
History.recycleState(newState);
|
||||
|
||||
// Force update of the title
|
||||
History.setTitle(newState);
|
||||
|
||||
// Check if we are the same State
|
||||
if ( newStateHash === oldStateHash ) {
|
||||
//History.debug('History.pushState: no change', newStateHash);
|
||||
History.busy(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Update HTML5 State
|
||||
History.saveState(newState);
|
||||
|
||||
// Fire HTML5 Event
|
||||
if(!wasExpected)
|
||||
History.Adapter.trigger(window,'statechange');
|
||||
|
||||
// Update HTML4 Hash
|
||||
if ( !History.isHashEqual(newStateHash, html4Hash) && !History.isHashEqual(newStateHash, History.getShortUrl(History.getLocationHref())) ) {
|
||||
History.setHash(newStateHash,false);
|
||||
}
|
||||
|
||||
History.busy(false);
|
||||
|
||||
// End pushState closure
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* History.replaceState(data,title,url)
|
||||
* Replace the State and trigger onpopstate
|
||||
* We have to trigger for HTML4 compatibility
|
||||
* @param {object} data
|
||||
* @param {string} title
|
||||
* @param {string} url
|
||||
* @return {true}
|
||||
*/
|
||||
History.replaceState = function(data,title,url,queue){
|
||||
//History.debug('History.replaceState: called', arguments);
|
||||
|
||||
// We assume that the URL passed in is URI-encoded, but this makes
|
||||
// sure that it's fully URI encoded; any '%'s that are encoded are
|
||||
// converted back into '%'s
|
||||
url = encodeURI(url).replace(/%25/g, "%");
|
||||
|
||||
// Check the State
|
||||
if ( History.getHashByUrl(url) ) {
|
||||
throw new Error('History.js does not support states with fragment-identifiers (hashes/anchors).');
|
||||
}
|
||||
|
||||
// Handle Queueing
|
||||
if ( queue !== false && History.busy() ) {
|
||||
// Wait + Push to Queue
|
||||
//History.debug('History.replaceState: we must wait', arguments);
|
||||
History.pushQueue({
|
||||
scope: History,
|
||||
callback: History.replaceState,
|
||||
args: arguments,
|
||||
queue: queue
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make Busy
|
||||
History.busy(true);
|
||||
|
||||
// Fetch the State Objects
|
||||
var newState = History.createStateObject(data,title,url),
|
||||
newStateHash = History.getHashByState(newState),
|
||||
oldState = History.getState(false),
|
||||
oldStateHash = History.getHashByState(oldState),
|
||||
previousState = History.getStateByIndex(-2);
|
||||
|
||||
// Discard Old State
|
||||
History.discardState(oldState,newState,previousState);
|
||||
|
||||
// If the url hasn't changed, just store and save the state
|
||||
// and fire a statechange event to be consistent with the
|
||||
// html 5 api
|
||||
if ( newStateHash === oldStateHash ) {
|
||||
// Store the newState
|
||||
History.storeState(newState);
|
||||
History.expectedStateId = newState.id;
|
||||
|
||||
// Recycle the State
|
||||
History.recycleState(newState);
|
||||
|
||||
// Force update of the title
|
||||
History.setTitle(newState);
|
||||
|
||||
// Update HTML5 State
|
||||
History.saveState(newState);
|
||||
|
||||
// Fire HTML5 Event
|
||||
//History.debug('History.pushState: trigger popstate');
|
||||
History.Adapter.trigger(window,'statechange');
|
||||
History.busy(false);
|
||||
}
|
||||
else {
|
||||
// Alias to PushState
|
||||
History.pushState(newState.data,newState.title,newState.url,false);
|
||||
}
|
||||
|
||||
// End replaceState closure
|
||||
return true;
|
||||
};
|
||||
|
||||
} // History.emulated.pushState
|
||||
|
||||
|
||||
|
||||
// ====================================================================
|
||||
// Initialise
|
||||
|
||||
// Non-Native pushState Implementation
|
||||
if ( History.emulated.pushState ) {
|
||||
/**
|
||||
* Ensure initial state is handled correctly
|
||||
*/
|
||||
if ( History.getHash() && !History.emulated.hashChange ) {
|
||||
History.Adapter.onDomLoad(function(){
|
||||
History.Adapter.trigger(window,'hashchange');
|
||||
});
|
||||
}
|
||||
|
||||
} // History.emulated.pushState
|
||||
|
||||
}; // History.initHtml4
|
||||
|
||||
// Try to Initialise History
|
||||
if ( typeof History.init !== 'undefined' ) {
|
||||
History.init();
|
||||
}
|
||||
|
||||
})(window);
|
2044
sites/all/themes/gui/materiobasetheme/bower_components/history.js/scripts/uncompressed/history.js
vendored
Normal file
2044
sites/all/themes/gui/materiobasetheme/bower_components/history.js/scripts/uncompressed/history.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
486
sites/all/themes/gui/materiobasetheme/bower_components/history.js/scripts/uncompressed/json2.js
vendored
Normal file
486
sites/all/themes/gui/materiobasetheme/bower_components/history.js/scripts/uncompressed/json2.js
vendored
Normal file
@ -0,0 +1,486 @@
|
||||
/*
|
||||
json2.js
|
||||
2012-10-08
|
||||
|
||||
Public Domain.
|
||||
|
||||
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
||||
|
||||
See http://www.JSON.org/js.html
|
||||
|
||||
|
||||
This code should be minified before deployment.
|
||||
See http://javascript.crockford.com/jsmin.html
|
||||
|
||||
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
|
||||
NOT CONTROL.
|
||||
|
||||
|
||||
This file creates a global JSON object containing two methods: stringify
|
||||
and parse.
|
||||
|
||||
JSON.stringify(value, replacer, space)
|
||||
value any JavaScript value, usually an object or array.
|
||||
|
||||
replacer an optional parameter that determines how object
|
||||
values are stringified for objects. It can be a
|
||||
function or an array of strings.
|
||||
|
||||
space an optional parameter that specifies the indentation
|
||||
of nested structures. If it is omitted, the text will
|
||||
be packed without extra whitespace. If it is a number,
|
||||
it will specify the number of spaces to indent at each
|
||||
level. If it is a string (such as '\t' or ' '),
|
||||
it contains the characters used to indent at each level.
|
||||
|
||||
This method produces a JSON text from a JavaScript value.
|
||||
|
||||
When an object value is found, if the object contains a toJSON
|
||||
method, its toJSON method will be called and the result will be
|
||||
stringified. A toJSON method does not serialize: it returns the
|
||||
value represented by the name/value pair that should be serialized,
|
||||
or undefined if nothing should be serialized. The toJSON method
|
||||
will be passed the key associated with the value, and this will be
|
||||
bound to the value
|
||||
|
||||
For example, this would serialize Dates as ISO strings.
|
||||
|
||||
Date.prototype.toJSON = function (key) {
|
||||
function f(n) {
|
||||
// Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
|
||||
return this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z';
|
||||
};
|
||||
|
||||
You can provide an optional replacer method. It will be passed the
|
||||
key and value of each member, with this bound to the containing
|
||||
object. The value that is returned from your method will be
|
||||
serialized. If your method returns undefined, then the member will
|
||||
be excluded from the serialization.
|
||||
|
||||
If the replacer parameter is an array of strings, then it will be
|
||||
used to select the members to be serialized. It filters the results
|
||||
such that only members with keys listed in the replacer array are
|
||||
stringified.
|
||||
|
||||
Values that do not have JSON representations, such as undefined or
|
||||
functions, will not be serialized. Such values in objects will be
|
||||
dropped; in arrays they will be replaced with null. You can use
|
||||
a replacer function to replace those with JSON values.
|
||||
JSON.stringify(undefined) returns undefined.
|
||||
|
||||
The optional space parameter produces a stringification of the
|
||||
value that is filled with line breaks and indentation to make it
|
||||
easier to read.
|
||||
|
||||
If the space parameter is a non-empty string, then that string will
|
||||
be used for indentation. If the space parameter is a number, then
|
||||
the indentation will be that many spaces.
|
||||
|
||||
Example:
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}]);
|
||||
// text is '["e",{"pluribus":"unum"}]'
|
||||
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
|
||||
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
|
||||
|
||||
text = JSON.stringify([new Date()], function (key, value) {
|
||||
return this[key] instanceof Date ?
|
||||
'Date(' + this[key] + ')' : value;
|
||||
});
|
||||
// text is '["Date(---current time---)"]'
|
||||
|
||||
|
||||
JSON.parse(text, reviver)
|
||||
This method parses a JSON text to produce an object or array.
|
||||
It can throw a SyntaxError exception.
|
||||
|
||||
The optional reviver parameter is a function that can filter and
|
||||
transform the results. It receives each of the keys and values,
|
||||
and its return value is used instead of the original value.
|
||||
If it returns what it received, then the structure is not modified.
|
||||
If it returns undefined then the member is deleted.
|
||||
|
||||
Example:
|
||||
|
||||
// Parse the text. Values that look like ISO date strings will
|
||||
// be converted to Date objects.
|
||||
|
||||
myData = JSON.parse(text, function (key, value) {
|
||||
var a;
|
||||
if (typeof value === 'string') {
|
||||
a =
|
||||
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
|
||||
if (a) {
|
||||
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
|
||||
+a[5], +a[6]));
|
||||
}
|
||||
}
|
||||
return value;
|
||||
});
|
||||
|
||||
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
|
||||
var d;
|
||||
if (typeof value === 'string' &&
|
||||
value.slice(0, 5) === 'Date(' &&
|
||||
value.slice(-1) === ')') {
|
||||
d = new Date(value.slice(5, -1));
|
||||
if (d) {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
});
|
||||
|
||||
|
||||
This is a reference implementation. You are free to copy, modify, or
|
||||
redistribute.
|
||||
*/
|
||||
|
||||
/*jslint evil: true, regexp: true */
|
||||
|
||||
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
|
||||
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
|
||||
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
|
||||
lastIndex, length, parse, prototype, push, replace, slice, stringify,
|
||||
test, toJSON, toString, valueOf
|
||||
*/
|
||||
|
||||
|
||||
// Create a JSON object only if one does not already exist. We create the
|
||||
// methods in a closure to avoid creating global variables.
|
||||
|
||||
if (typeof JSON !== 'object') {
|
||||
JSON = {};
|
||||
}
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function f(n) {
|
||||
// Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
|
||||
if (typeof Date.prototype.toJSON !== 'function') {
|
||||
|
||||
Date.prototype.toJSON = function (key) {
|
||||
|
||||
return isFinite(this.valueOf())
|
||||
? this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z'
|
||||
: null;
|
||||
};
|
||||
|
||||
String.prototype.toJSON =
|
||||
Number.prototype.toJSON =
|
||||
Boolean.prototype.toJSON = function (key) {
|
||||
return this.valueOf();
|
||||
};
|
||||
}
|
||||
|
||||
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
gap,
|
||||
indent,
|
||||
meta = { // table of character substitutions
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\f': '\\f',
|
||||
'\r': '\\r',
|
||||
'"' : '\\"',
|
||||
'\\': '\\\\'
|
||||
},
|
||||
rep;
|
||||
|
||||
|
||||
function quote(string) {
|
||||
|
||||
// If the string contains no control characters, no quote characters, and no
|
||||
// backslash characters, then we can safely slap some quotes around it.
|
||||
// Otherwise we must also replace the offending characters with safe escape
|
||||
// sequences.
|
||||
|
||||
escapable.lastIndex = 0;
|
||||
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
|
||||
var c = meta[a];
|
||||
return typeof c === 'string'
|
||||
? c
|
||||
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
}) + '"' : '"' + string + '"';
|
||||
}
|
||||
|
||||
|
||||
function str(key, holder) {
|
||||
|
||||
// Produce a string from holder[key].
|
||||
|
||||
var i, // The loop counter.
|
||||
k, // The member key.
|
||||
v, // The member value.
|
||||
length,
|
||||
mind = gap,
|
||||
partial,
|
||||
value = holder[key];
|
||||
|
||||
// If the value has a toJSON method, call it to obtain a replacement value.
|
||||
|
||||
if (value && typeof value === 'object' &&
|
||||
typeof value.toJSON === 'function') {
|
||||
value = value.toJSON(key);
|
||||
}
|
||||
|
||||
// If we were called with a replacer function, then call the replacer to
|
||||
// obtain a replacement value.
|
||||
|
||||
if (typeof rep === 'function') {
|
||||
value = rep.call(holder, key, value);
|
||||
}
|
||||
|
||||
// What happens next depends on the value's type.
|
||||
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
return quote(value);
|
||||
|
||||
case 'number':
|
||||
|
||||
// JSON numbers must be finite. Encode non-finite numbers as null.
|
||||
|
||||
return isFinite(value) ? String(value) : 'null';
|
||||
|
||||
case 'boolean':
|
||||
case 'null':
|
||||
|
||||
// If the value is a boolean or null, convert it to a string. Note:
|
||||
// typeof null does not produce 'null'. The case is included here in
|
||||
// the remote chance that this gets fixed someday.
|
||||
|
||||
return String(value);
|
||||
|
||||
// If the type is 'object', we might be dealing with an object or an array or
|
||||
// null.
|
||||
|
||||
case 'object':
|
||||
|
||||
// Due to a specification blunder in ECMAScript, typeof null is 'object',
|
||||
// so watch out for that case.
|
||||
|
||||
if (!value) {
|
||||
return 'null';
|
||||
}
|
||||
|
||||
// Make an array to hold the partial results of stringifying this object value.
|
||||
|
||||
gap += indent;
|
||||
partial = [];
|
||||
|
||||
// Is the value an array?
|
||||
|
||||
if (Object.prototype.toString.apply(value) === '[object Array]') {
|
||||
|
||||
// The value is an array. Stringify every element. Use null as a placeholder
|
||||
// for non-JSON values.
|
||||
|
||||
length = value.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
partial[i] = str(i, value) || 'null';
|
||||
}
|
||||
|
||||
// Join all of the elements together, separated with commas, and wrap them in
|
||||
// brackets.
|
||||
|
||||
v = partial.length === 0
|
||||
? '[]'
|
||||
: gap
|
||||
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
|
||||
: '[' + partial.join(',') + ']';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
|
||||
// If the replacer is an array, use it to select the members to be stringified.
|
||||
|
||||
if (rep && typeof rep === 'object') {
|
||||
length = rep.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
if (typeof rep[i] === 'string') {
|
||||
k = rep[i];
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// Otherwise, iterate through all of the keys in the object.
|
||||
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Join all of the member texts together, separated with commas,
|
||||
// and wrap them in braces.
|
||||
|
||||
v = partial.length === 0
|
||||
? '{}'
|
||||
: gap
|
||||
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
|
||||
: '{' + partial.join(',') + '}';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
// If the JSON object does not yet have a stringify method, give it one.
|
||||
|
||||
if (typeof JSON.stringify !== 'function') {
|
||||
JSON.stringify = function (value, replacer, space) {
|
||||
|
||||
// The stringify method takes a value and an optional replacer, and an optional
|
||||
// space parameter, and returns a JSON text. The replacer can be a function
|
||||
// that can replace values, or an array of strings that will select the keys.
|
||||
// A default replacer method can be provided. Use of the space parameter can
|
||||
// produce text that is more easily readable.
|
||||
|
||||
var i;
|
||||
gap = '';
|
||||
indent = '';
|
||||
|
||||
// If the space parameter is a number, make an indent string containing that
|
||||
// many spaces.
|
||||
|
||||
if (typeof space === 'number') {
|
||||
for (i = 0; i < space; i += 1) {
|
||||
indent += ' ';
|
||||
}
|
||||
|
||||
// If the space parameter is a string, it will be used as the indent string.
|
||||
|
||||
} else if (typeof space === 'string') {
|
||||
indent = space;
|
||||
}
|
||||
|
||||
// If there is a replacer, it must be a function or an array.
|
||||
// Otherwise, throw an error.
|
||||
|
||||
rep = replacer;
|
||||
if (replacer && typeof replacer !== 'function' &&
|
||||
(typeof replacer !== 'object' ||
|
||||
typeof replacer.length !== 'number')) {
|
||||
throw new Error('JSON.stringify');
|
||||
}
|
||||
|
||||
// Make a fake root object containing our value under the key of ''.
|
||||
// Return the result of stringifying the value.
|
||||
|
||||
return str('', {'': value});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// If the JSON object does not yet have a parse method, give it one.
|
||||
|
||||
if (typeof JSON.parse !== 'function') {
|
||||
JSON.parse = function (text, reviver) {
|
||||
|
||||
// The parse method takes a text and an optional reviver function, and returns
|
||||
// a JavaScript value if the text is a valid JSON text.
|
||||
|
||||
var j;
|
||||
|
||||
function walk(holder, key) {
|
||||
|
||||
// The walk method is used to recursively walk the resulting structure so
|
||||
// that modifications can be made.
|
||||
|
||||
var k, v, value = holder[key];
|
||||
if (value && typeof value === 'object') {
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = walk(value, k);
|
||||
if (v !== undefined) {
|
||||
value[k] = v;
|
||||
} else {
|
||||
delete value[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return reviver.call(holder, key, value);
|
||||
}
|
||||
|
||||
|
||||
// Parsing happens in four stages. In the first stage, we replace certain
|
||||
// Unicode characters with escape sequences. JavaScript handles many characters
|
||||
// incorrectly, either silently deleting them, or treating them as line endings.
|
||||
|
||||
text = String(text);
|
||||
cx.lastIndex = 0;
|
||||
if (cx.test(text)) {
|
||||
text = text.replace(cx, function (a) {
|
||||
return '\\u' +
|
||||
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
});
|
||||
}
|
||||
|
||||
// In the second stage, we run the text against regular expressions that look
|
||||
// for non-JSON patterns. We are especially concerned with '()' and 'new'
|
||||
// because they can cause invocation, and '=' because it can cause mutation.
|
||||
// But just to be safe, we want to reject all unexpected forms.
|
||||
|
||||
// We split the second stage into 4 regexp operations in order to work around
|
||||
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
||||
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
|
||||
// replace all simple value tokens with ']' characters. Third, we delete all
|
||||
// open brackets that follow a colon or comma or that begin the text. Finally,
|
||||
// we look to see that the remaining characters are only whitespace or ']' or
|
||||
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
||||
|
||||
if (/^[\],:{}\s]*$/
|
||||
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
|
||||
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
|
||||
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
|
||||
// In the third stage we use the eval function to compile the text into a
|
||||
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
||||
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
||||
// in parens to eliminate the ambiguity.
|
||||
|
||||
j = eval('(' + text + ')');
|
||||
|
||||
// In the optional fourth stage, we recursively walk the new structure, passing
|
||||
// each name/value pair to a reviver function for possible transformation.
|
||||
|
||||
return typeof reviver === 'function'
|
||||
? walk({'': j}, '')
|
||||
: j;
|
||||
}
|
||||
|
||||
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
||||
|
||||
throw new SyntaxError('JSON.parse');
|
||||
};
|
||||
}
|
||||
}());
|
22
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests.src/_header.php
vendored
Normal file
22
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests.src/_header.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
# Locations
|
||||
$dir = dirname(__FILE__);
|
||||
$out = "$dir/../tests";
|
||||
|
||||
# Base URL
|
||||
$base_url = '/';
|
||||
$tests_url = $base_url.'tests';
|
||||
|
||||
# Data
|
||||
$browsers = array(
|
||||
'html4+html5',
|
||||
'html5'
|
||||
);
|
||||
$adapters = array(
|
||||
'jquery',
|
||||
'mootools',
|
||||
'native',
|
||||
'right',
|
||||
'zepto'
|
||||
);
|
||||
|
45
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests.src/all.php
vendored
Normal file
45
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests.src/all.php
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>History.js Test Suite</title>
|
||||
<style type="text/css">
|
||||
body,html,iframe {
|
||||
padding:0;
|
||||
margin:0;
|
||||
outline:none;
|
||||
border:none;
|
||||
}
|
||||
.browser {
|
||||
padding-top:1em;
|
||||
}
|
||||
.adapter {
|
||||
padding-top:1em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>History.js Test Suite</h1>
|
||||
<p>HTML5 Browsers must pass the HTML4+HTML5 tests</p>
|
||||
<p>HTML4 Browsers must pass the HTML4 tests and should fail the HTML5 tests</p>
|
||||
<?php
|
||||
foreach ( $browsers as $browser ) :
|
||||
echo '<div class="browser">';
|
||||
foreach ( $adapters as $adapter ) :
|
||||
echo '<div class="adapter">';
|
||||
# Url
|
||||
$url = "${browser}.${adapter}.html";
|
||||
|
||||
# Title
|
||||
$Browser = ucwords($browser);
|
||||
$Adapter = ucwords($adapter);
|
||||
$title = "History.js ${Browser} ${Adapter} Test Suite";
|
||||
|
||||
# Render
|
||||
?><a href="<?=$url?>"><?=$title?></a><?php
|
||||
echo '</div>';
|
||||
endforeach;
|
||||
echo '</div>';
|
||||
endforeach;
|
||||
?>
|
||||
</body>
|
||||
</html>
|
51
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests.src/each.php
vendored
Normal file
51
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests.src/each.php
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
# Url
|
||||
$url = "${browser}.${adapter}.html";
|
||||
|
||||
# Titles
|
||||
$Browser = strtoupper($browser);
|
||||
$Adapter = ucwords($adapter);
|
||||
$title = "History.js ${Browser} ${Adapter} Test Suite";
|
||||
?><!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title><?=$title?></title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/<?=$adapter?>.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header"><?=$title?></h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
<script src="../scripts/bundled/<?=$browser?>/<?=$adapter?>.history.js"></script>
|
||||
|
||||
<!-- Tests -->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
23
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests.src/index.php
vendored
Normal file
23
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests.src/index.php
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
# Header
|
||||
require_once(dirname(__FILE__).'/_header.php');
|
||||
|
||||
# Index
|
||||
ob_start();
|
||||
require($dir.'/all.php');
|
||||
$contents = ob_get_contents();
|
||||
ob_end_clean();
|
||||
file_put_contents($out.'/index.html', $contents);
|
||||
|
||||
# Each
|
||||
foreach ( $browsers as $browser )
|
||||
foreach ( $adapters as $adapter ) {
|
||||
ob_start();
|
||||
require($dir.'/each.php');
|
||||
$contents = ob_get_contents();
|
||||
ob_end_clean();
|
||||
file_put_contents($out."/${url}", $contents);
|
||||
}
|
||||
|
||||
# Done
|
||||
?><html><body><a href="../tests">Tests</a></body></html>
|
13
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/.htaccess
vendored
Normal file
13
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/.htaccess
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
Options +FollowSymlinks
|
||||
RewriteEngine On
|
||||
|
||||
# Clean Adapter
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ([^\.]+)$ $1.html [NC,L,QSA]
|
||||
|
||||
# Can someone smarter than me make it so:
|
||||
# http://localhost/history.js/tests/uncompressed-html5-persistant-jquery
|
||||
# Does not redirect to:
|
||||
# http://localhost/history.js/tests/uncompressed-html5-persistant-jquery.html
|
||||
# But still accesses that url
|
55
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html4+html5.dojo.html
vendored
Normal file
55
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html4+html5.dojo.html
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML4+HTML5 Dojo Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/dojo.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<!--
|
||||
-->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML4+HTML5 Dojo Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
|
||||
<script src="../scripts/uncompressed/json2.js"></script>
|
||||
<script src="../scripts/uncompressed/history.adapter.dojo.js"></script>
|
||||
<script src="../scripts/uncompressed/history.html4.js"></script>
|
||||
<script src="../scripts/uncompressed/history.js"></script>
|
||||
|
||||
<!--
|
||||
<script src="../scripts/bundled/html4+html5/dojo.history.js"></script>
|
||||
-->
|
||||
<!-- Tests -->
|
||||
<!--
|
||||
-->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
55
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html4+html5.extjs.html
vendored
Normal file
55
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html4+html5.extjs.html
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML4+HTML5 ExtJS Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/extjs.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<!--
|
||||
-->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML4+HTML5 ExtJS Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
|
||||
<script src="../scripts/uncompressed/json2.js"></script>
|
||||
<script src="../scripts/uncompressed/history.adapter.extjs.js"></script>
|
||||
<script src="../scripts/uncompressed/history.html4.js"></script>
|
||||
<script src="../scripts/uncompressed/history.js"></script>
|
||||
|
||||
<!--
|
||||
<script src="../scripts/bundled/html4+html5/extjs.history.js"></script>
|
||||
-->
|
||||
<!-- Tests -->
|
||||
<!--
|
||||
-->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html4+html5.jquery.html
vendored
Normal file
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html4+html5.jquery.html
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML4+HTML5 Jquery Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/jquery.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML4+HTML5 Jquery Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
<script src="../scripts/bundled/html4+html5/jquery.history.js"></script>
|
||||
|
||||
<!-- Tests -->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML4+HTML5 Mootools Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/mootools.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML4+HTML5 Mootools Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
<script src="../scripts/bundled/html4+html5/mootools.history.js"></script>
|
||||
|
||||
<!-- Tests -->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html4+html5.native.html
vendored
Normal file
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html4+html5.native.html
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML4+HTML5 Native Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/native.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML4+HTML5 Native Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
<script src="../scripts/bundled/html4+html5/native.history.js"></script>
|
||||
|
||||
<!-- Tests -->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html4+html5.right.html
vendored
Normal file
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html4+html5.right.html
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML4+HTML5 Right Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/right.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML4+HTML5 Right Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
<script src="../scripts/bundled/html4+html5/right.history.js"></script>
|
||||
|
||||
<!-- Tests -->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html4+html5.zepto.html
vendored
Normal file
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html4+html5.zepto.html
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML4+HTML5 Zepto Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/zepto.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML4+HTML5 Zepto Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
<script src="../scripts/bundled/html4+html5/zepto.history.js"></script>
|
||||
|
||||
<!-- Tests -->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.dojo.html
vendored
Normal file
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.dojo.html
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML5 Dojo Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/dojo.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML5 Dojo Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
<script src="../scripts/bundled/html5/dojo.history.js"></script>
|
||||
|
||||
<!-- Tests -->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.extjs.html
vendored
Normal file
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.extjs.html
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML5 ExtJS Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/extjs.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML5 ExtJS Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
<script src="../scripts/bundled/html5/extjs.history.js"></script>
|
||||
|
||||
<!-- Tests -->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.jquery.html
vendored
Normal file
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.jquery.html
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML5 Jquery Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/jquery.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML5 Jquery Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
<script src="../scripts/bundled/html5/jquery.history.js"></script>
|
||||
|
||||
<!-- Tests -->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.mootools.html
vendored
Normal file
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.mootools.html
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML5 Mootools Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/mootools.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML5 Mootools Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
<script src="../scripts/bundled/html5/mootools.history.js"></script>
|
||||
|
||||
<!-- Tests -->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.native.html
vendored
Normal file
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.native.html
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML5 Native Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/native.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML5 Native Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
<script src="../scripts/bundled/html5/native.history.js"></script>
|
||||
|
||||
<!-- Tests -->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.right.html
vendored
Normal file
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.right.html
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML5 Right Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/right.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML5 Right Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
<script src="../scripts/bundled/html5/right.history.js"></script>
|
||||
|
||||
<!-- Tests -->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.zepto.html
vendored
Normal file
43
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/html5.zepto.html
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
|
||||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>History.js HTML5 Zepto Test Suite</title>
|
||||
|
||||
<!-- Check -->
|
||||
<script>
|
||||
var href = window.document.location.href,
|
||||
test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
|
||||
if ( test_url !== href ) {
|
||||
window.document.location.href = test_url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Framework -->
|
||||
<script src="../vendor/zepto.js"></script>
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen">
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Elements -->
|
||||
<h1 id="qunit-header">History.js HTML5 Zepto Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">test markup</div>
|
||||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button>
|
||||
<textarea id="log" style="width:100%;height:400px"></textarea>
|
||||
|
||||
<!-- History.js -->
|
||||
<script src="../scripts/bundled/html5/zepto.history.js"></script>
|
||||
|
||||
<!-- Tests -->
|
||||
<script src="tests.js"></script>
|
||||
</body>
|
||||
</html>
|
3
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/image.php
vendored
Normal file
3
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/image.php
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
header('Content-type: image/jpeg');
|
||||
sleep(10);
|
47
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/index.html
vendored
Normal file
47
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/index.html
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>History.js Test Suite</title>
|
||||
<style type="text/css">
|
||||
body,html,iframe {
|
||||
padding:0;
|
||||
margin:0;
|
||||
outline:none;
|
||||
border:none;
|
||||
}
|
||||
.browser {
|
||||
padding-bottom:1em;
|
||||
float: left;
|
||||
margin-right: 5em;
|
||||
}
|
||||
.adapter {
|
||||
padding-bottom:1em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>History.js Test Suite</h1>
|
||||
<p>HTML5 Browsers must pass the HTML4+HTML5 tests, HTML4 Browsers must pass the HTML4 tests and should fail the HTML5 tests.</p>
|
||||
|
||||
<div class="browser">
|
||||
<h2>HTML 4+5</h2>
|
||||
<div class="adapter"><a href="html4+HTML5.dojo.html">Dojo Test Suite</a></div>
|
||||
<div class="adapter"><a href="html4+HTML5.extjs.html">ExtJS Test Suite</a></div>
|
||||
<div class="adapter"><a href="HTML4+HTML5.jquery.html">jQuery Test Suite</a></div>
|
||||
<div class="adapter"><a href="HTML4+HTML5.mootools.html">Mootools Test Suite</a></div>
|
||||
<div class="adapter"><a href="HTML4+HTML5.native.html">Native Test Suite</a></div>
|
||||
<div class="adapter"><a href="HTML4+HTML5.right.html">Right Test Suite</a></div>
|
||||
<div class="adapter"><a href="HTML4+HTML5.zepto.html">Zepto Test Suite</a> (Zepto doesn't support IE)</div>
|
||||
</div>
|
||||
<div class="browser">
|
||||
<h2>HTML 5</h2>
|
||||
<div class="adapter"><a href="HTML5.dojo.html">Dojo Test Suite</a></div>
|
||||
<div class="adapter"><a href="HTML5.extjs.html">ExtJS Test Suite</a></div>
|
||||
<div class="adapter"><a href="HTML5.jquery.html">jQuery Test Suite</a></div>
|
||||
<div class="adapter"><a href="HTML5.mootools.html">Mootools Test Suite</a></div>
|
||||
<div class="adapter"><a href="HTML5.native.html">Native Test Suite</a></div>
|
||||
<div class="adapter"><a href="HTML5.right.html">Right Test Suite</a></div>
|
||||
<div class="adapter"><a href="HTML5.zepto.html">Zepto Test Suite</a> (Zepto doesn't support IE)</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
254
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/tests.js
vendored
Normal file
254
sites/all/themes/gui/materiobasetheme/bower_components/history.js/tests/tests.js
vendored
Normal file
@ -0,0 +1,254 @@
|
||||
(function(){
|
||||
|
||||
var
|
||||
History = window.History,
|
||||
document = window.document,
|
||||
test = window.test,
|
||||
deepEqual = window.deepEqual;
|
||||
|
||||
// Check
|
||||
if ( !History.enabled ) {
|
||||
throw new Error('History.js is disabled');
|
||||
}
|
||||
|
||||
// Prepare
|
||||
History.options.debug = false;
|
||||
|
||||
// Variables
|
||||
var
|
||||
States = {
|
||||
// Home
|
||||
0: {
|
||||
'url': document.location.href.replace(/#.*$/,''),
|
||||
'title': ''
|
||||
},
|
||||
// One
|
||||
1: {
|
||||
'data': {
|
||||
'state': 1,
|
||||
'rand': Math.random()
|
||||
},
|
||||
'title': 'State 1',
|
||||
'url': '?state=1'
|
||||
},
|
||||
// Two
|
||||
2: {
|
||||
'data': {
|
||||
'state': 2,
|
||||
'rand': Math.random()
|
||||
},
|
||||
'title': 'State 2',
|
||||
'url': '?state=2&asd=%20asd%2520asd'
|
||||
},
|
||||
// Three
|
||||
3: {
|
||||
'url': '?state=3'
|
||||
},
|
||||
// Four
|
||||
4: {
|
||||
'data': {
|
||||
'state': 4,
|
||||
'trick': true,
|
||||
'rand': Math.random()
|
||||
},
|
||||
'title': 'State 4',
|
||||
'url': '?state=3'
|
||||
},
|
||||
// Log
|
||||
5: {
|
||||
'url': '?state=1#log'
|
||||
},
|
||||
// Six
|
||||
6: {
|
||||
'data': {
|
||||
'state': 6,
|
||||
'rand': Math.random()
|
||||
},
|
||||
'url': 'six.html'
|
||||
},
|
||||
// Seven
|
||||
7: {
|
||||
'url': 'seven'
|
||||
},
|
||||
// Eight
|
||||
8: {
|
||||
'url': '/eight'
|
||||
}
|
||||
},
|
||||
stateOrder = [0,1,2,3,4,3,1,0,1,3,4,3,1,0,6,7,8,1,8,7,6,0],
|
||||
currentTest = 0;
|
||||
|
||||
// Original Title
|
||||
var title = document.title;
|
||||
|
||||
var banner;
|
||||
|
||||
var checkStatus = function(){
|
||||
banner = banner || document.getElementById('qunit-banner');
|
||||
var status = banner.className !== 'qunit-fail';
|
||||
return status;
|
||||
};
|
||||
|
||||
// Check State
|
||||
var checkState = function(){
|
||||
if ( !checkStatus() ) {
|
||||
throw new Error('A test has failed');
|
||||
}
|
||||
|
||||
var
|
||||
stateIndex = stateOrder[currentTest],
|
||||
expectedState = History.normalizeState(States[stateIndex]),
|
||||
actualState = History.getState(false);
|
||||
|
||||
++currentTest;
|
||||
|
||||
document.title = title+': '+actualState.url;
|
||||
|
||||
var
|
||||
testName = 'Test '+currentTest,
|
||||
stateName = 'State '+stateIndex;
|
||||
|
||||
test(testName,function(){
|
||||
History.log('Completed: '+testName +' / '+ stateName);
|
||||
deepEqual(actualState,expectedState,stateName);
|
||||
});
|
||||
|
||||
// Image Load to Stress Test Safari and Opera
|
||||
(new Image()).src = "image.php";
|
||||
};
|
||||
|
||||
// Check the Initial State
|
||||
checkState();
|
||||
|
||||
// State Change
|
||||
History.Adapter.bind(window,'statechange',checkState);
|
||||
|
||||
// Log
|
||||
var addLog = function(){
|
||||
var args = arguments;
|
||||
History.queue(function(){
|
||||
History.log.apply(History,args);
|
||||
});
|
||||
};
|
||||
|
||||
// Dom Load
|
||||
History.Adapter.onDomLoad(function(){
|
||||
setTimeout(function(){
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Test State Functionality: Adding
|
||||
|
||||
// Test 2 / State 1 (0 -> 1)
|
||||
// Tests HTML4 -> HTML5 Graceful Upgrade
|
||||
addLog('Test 2',History.queues.length,History.busy.flag);
|
||||
History.setHash(History.getHashByState(States[1]));
|
||||
|
||||
// Test 3 / State 2 (1 -> 2)
|
||||
addLog('Test 3',History.queues.length,History.busy.flag);
|
||||
History.pushState(States[2].data, States[2].title, States[2].url);
|
||||
|
||||
// Test 3-2 / State 2 (2 -> 2) / No Change
|
||||
addLog('Test 3-2',History.queues.length,History.busy.flag);
|
||||
History.pushState(States[2].data, States[2].title, States[2].url);
|
||||
|
||||
// Test 3-3 / State 2 (2 -> 2) / No Change
|
||||
addLog('Test 3-3',History.queues.length,History.busy.flag);
|
||||
History.replaceState(States[2].data, States[2].title, States[2].url);
|
||||
|
||||
// Test 4 / State 3 (2 -> 3)
|
||||
addLog('Test 4',History.queues.length,History.busy.flag);
|
||||
History.replaceState(States[3].data, States[3].title, States[3].url);
|
||||
|
||||
// Test 5 / State 4 (3 -> 4)
|
||||
addLog('Test 5',History.queues.length,History.busy.flag);
|
||||
History.pushState(States[4].data, States[4].title, States[4].url);
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Test State Functionality: Traversing
|
||||
|
||||
// Test 6 / State 3 (4 -> 3)
|
||||
// Test 7 / State 1 (3 -> 2 -> 1)
|
||||
addLog('Test 6,7',History.queues.length,History.busy.flag);
|
||||
History.go(-2);
|
||||
|
||||
// Test 8 / State 0 (1 -> 0)
|
||||
// Tests Default State
|
||||
addLog('Test 8',History.queues.length,History.busy.flag);
|
||||
History.back();
|
||||
|
||||
// Test 9 / State 1 (0 -> 1)
|
||||
// Test 10 / State 3 (1 -> 2 -> 3)
|
||||
addLog('Test 9,10',History.queues.length,History.busy.flag);
|
||||
History.go(2);
|
||||
|
||||
// Test 11 / State 4 (3 -> 4)
|
||||
addLog('Test 11',History.queues.length,History.busy.flag);
|
||||
History.forward();
|
||||
|
||||
// Test 12 / State 3 (4 -> 3)
|
||||
addLog('Test 12',History.queues.length,History.busy.flag);
|
||||
History.back();
|
||||
|
||||
// Test 13 / State 1 (3 -> 2 -> 1)
|
||||
addLog('Test 13',History.queues.length,History.busy.flag);
|
||||
History.back();
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Test State Functionality: Traditional Anchors
|
||||
|
||||
// Test 13-2 / State 1 (1 -> #log) / No Change
|
||||
addLog('Test 13-2',History.queues.length,History.busy.flag);
|
||||
History.setHash('log');
|
||||
|
||||
// Test 13-3 / State 1 (#log -> 1) / No Change
|
||||
addLog('Test 13-3',History.queues.length,History.busy.flag);
|
||||
History.back();
|
||||
|
||||
// Test 14 / State 0 (1 -> 0)
|
||||
addLog('Test 14',History.queues.length,History.busy.flag);
|
||||
History.back();
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Test URL Handling: Adding
|
||||
|
||||
// Test 15 / State 6 (1 -> 6)
|
||||
// Also tests data with no title
|
||||
addLog('Test 15',History.queues.length,History.busy.flag);
|
||||
History.pushState(States[6].data, States[6].title, States[6].url);
|
||||
|
||||
// Test 16 / State 7 (6 -> 7)
|
||||
addLog('Test 16',History.queues.length,History.busy.flag);
|
||||
History.pushState(States[7].data, States[7].title, States[7].url);
|
||||
|
||||
// Test 17 / State 7 (7 -> 8)
|
||||
addLog('Test 17',History.queues.length,History.busy.flag);
|
||||
History.pushState(States[8].data, States[8].title, States[8].url);
|
||||
|
||||
// Test 18 / State 1 (8 -> 1)
|
||||
// Should be /eight?state=1
|
||||
addLog('Test 18',History.queues.length,History.busy.flag);
|
||||
History.pushState(States[1].data, States[1].title, States[1].url);
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Test URL Handling: Traversing
|
||||
|
||||
// Test 19 / State 8 (1 -> 8)
|
||||
addLog('Test 19',History.queues.length,History.busy.flag);
|
||||
History.back();
|
||||
|
||||
// Test 20 / State 7 (8 -> 7)
|
||||
addLog('Test 20',History.queues.length,History.busy.flag);
|
||||
History.back();
|
||||
|
||||
// Test 21 / State 6 (7 -> 6)
|
||||
addLog('Test 21',History.queues.length,History.busy.flag);
|
||||
History.back();
|
||||
|
||||
// Test 22 / State 0 (6 -> 0)
|
||||
addLog('Test 22',History.queues.length,History.busy.flag);
|
||||
History.back();
|
||||
|
||||
},1000); // wait for test one to complete
|
||||
});
|
||||
|
||||
})();
|
17737
sites/all/themes/gui/materiobasetheme/bower_components/history.js/vendor/dojo.js
vendored
Normal file
17737
sites/all/themes/gui/materiobasetheme/bower_components/history.js/vendor/dojo.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
161578
sites/all/themes/gui/materiobasetheme/bower_components/history.js/vendor/extjs.js
vendored
Normal file
161578
sites/all/themes/gui/materiobasetheme/bower_components/history.js/vendor/extjs.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5
sites/all/themes/gui/materiobasetheme/bower_components/history.js/vendor/jquery.js
vendored
Normal file
5
sites/all/themes/gui/materiobasetheme/bower_components/history.js/vendor/jquery.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5976
sites/all/themes/gui/materiobasetheme/bower_components/history.js/vendor/mootools.js
vendored
Normal file
5976
sites/all/themes/gui/materiobasetheme/bower_components/history.js/vendor/mootools.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
8
sites/all/themes/gui/materiobasetheme/bower_components/history.js/vendor/qunit/.gitignore
vendored
Normal file
8
sites/all/themes/gui/materiobasetheme/bower_components/history.js/vendor/qunit/.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
.project
|
||||
*~
|
||||
*.diff
|
||||
*.patch
|
||||
.DS_Store
|
||||
.settings
|
||||
node_modules
|
||||
dist/
|
55
sites/all/themes/gui/materiobasetheme/bower_components/history.js/vendor/qunit/AUTHORS.txt
vendored
Normal file
55
sites/all/themes/gui/materiobasetheme/bower_components/history.js/vendor/qunit/AUTHORS.txt
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
Jörn Zaefferer <joern.zaefferer@gmail.com>
|
||||
Ariel Flesler <aflesler@gmail.com>
|
||||
Scott González <scott.gonzalez@gmail.com>
|
||||
Richard Worth <rdworth@gmail.com>
|
||||
Philippe Rathé <prathe@gmail.com>
|
||||
John Resig <jeresig@gmail.com>
|
||||
Will Moffat <will_git@hamstersoup.com>
|
||||
Jan Kassens <jan@kassens.net>
|
||||
Ziling Zhao <zizhao@cisco.com>
|
||||
Ryan Szulczewski <musicmanryan@gmail.com>
|
||||
Chris Lloyd <christopher.lloyd@gmail.com>
|
||||
Louis-Rémi Babé <public@lrbabe.com>
|
||||
Jake Archibald <jake.archibald@bbc.co.uk>
|
||||
Frances Berriman <frances.berriman@bbc.co.uk>
|
||||
Rune Halvorsen <runefh@gmail.com>
|
||||
Chris Thatcher <thatcher.christopher@gmail.com>
|
||||
Fábio Rehm <fgrehm@gmail.com>
|
||||
Leon Sorokin <leeoniya@gmail.com>
|
||||
Douglas Neiner <doug@pixelgraphics.us>
|
||||
Paul Elliott <paul@hashrocket.com>
|
||||
Nikita Vasilyev <me@elv1s.ru>
|
||||
Benjamin Lee <leebenjp@gmail.com>
|
||||
Paul Irish <paul.irish@gmail.com>
|
||||
Oleg Slobodskoi <oleg008@gmail.com>
|
||||
Anton Matzneller <obhvsbypqghgc@gmail.com>
|
||||
Aurélien Bombo
|
||||
Mathias Bynens <mathias@qiwi.be>
|
||||
Erik Vold <erikvvold@gmail.com>
|
||||
Wesley Walser <waw325@gmail.com>
|
||||
Rob Kinninmont <robk@twitter.com>
|
||||
Marc Portier <marc.portier@gmail.com>
|
||||
Michael Righi <michael@righi.me>
|
||||
Timo Tijhof <krinklemail@gmail.com>
|
||||
Jan Alonzo <jmalonzo@taguchimail.com>
|
||||
Daniel Trebbien <dtrebbien@gmail.com>
|
||||
Bob Fanger <bfanger@gmail.com>
|
||||
Markus Messner-Chaney <markus.messner-chaney@xing.com>
|
||||
Trevor Parscal <trevorparscal@gmail.com>
|
||||
Ashar Voultoiz <hashar@free.fr>
|
||||
Jimmy Mabey <jimmy@velsoft.com>
|
||||
Domenic Denicola <domenic@domenicdenicola.com>
|
||||
Mike Sherov <mike.sherov@gmail.com>
|
||||
Seong-A Kong <simonz@daumcorp.com>
|
||||
Graham Conzett <conzett@gmail.com>
|
||||
Niall Smart <niall@pobox.com>
|
||||
Johan Sörlin <spocke@moxiecode.com>
|
||||
Gijs Kruitbosch <gijskruitbosch@gmail.com>
|
||||
Erkan Yilmaz <erkan77@gmail.com>
|
||||
Jonathan Sanchez <jsanchezpando@cirb.irisnet.be>
|
||||
Keith Cirkel <github@keithcirkel.co.uk>
|
||||
Rick Waldron <waldron.rick@gmail.com>
|
||||
Herbert Vojčík <herby@mailbox.sk>
|
||||
Richard Gibson <richard.gibson@gmail.com>
|
||||
Alex J Burke <alex@alexjeffburke.com>
|
||||
Sergii Kliuchnyk <sergiikliuchnyk@gmail.com>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user