├── .editorconfig ├── .gitignore ├── .jshintrc ├── README.md ├── bower.json ├── bower_components └── history.js │ ├── .bower.json │ ├── .gitignore │ ├── History.md │ ├── README.md │ ├── bower.json │ ├── buildr-uncompressed.coffee │ ├── buildr.coffee │ ├── component.json │ ├── demo │ ├── bcherry-orig.html │ ├── bcherry.html │ ├── chrome.html │ ├── index.html │ ├── native-auto.html │ ├── native.html │ ├── navigator.html │ ├── safari.html │ └── unicode.html │ ├── license.txt │ ├── package.json │ ├── scripts │ ├── bundled-uncompressed │ │ ├── html4+html5 │ │ │ ├── dojo.history.js │ │ │ ├── extjs.history.js │ │ │ ├── jquery.history.js │ │ │ ├── mootools.history.js │ │ │ ├── native.history.js │ │ │ ├── right.history.js │ │ │ └── zepto.history.js │ │ └── html5 │ │ │ ├── dojo.history.js │ │ │ ├── extjs.history.js │ │ │ ├── jquery.history.js │ │ │ ├── mootools.history.js │ │ │ ├── native.history.js │ │ │ ├── right.history.js │ │ │ └── zepto.history.js │ ├── bundled │ │ ├── html4+html5 │ │ │ ├── dojo.history.js │ │ │ ├── extjs.history.js │ │ │ ├── jquery.history.js │ │ │ ├── mootools.history.js │ │ │ ├── native.history.js │ │ │ ├── right.history.js │ │ │ └── zepto.history.js │ │ └── html5 │ │ │ ├── dojo.history.js │ │ │ ├── extjs.history.js │ │ │ ├── jquery.history.js │ │ │ ├── mootools.history.js │ │ │ ├── native.history.js │ │ │ ├── right.history.js │ │ │ └── zepto.history.js │ ├── compressed │ │ ├── history.adapter.dojo.js │ │ ├── history.adapter.extjs.js │ │ ├── history.adapter.jquery.js │ │ ├── history.adapter.mootools.js │ │ ├── history.adapter.native.js │ │ ├── history.adapter.right.js │ │ ├── history.adapter.zepto.js │ │ ├── history.html4.js │ │ ├── history.js │ │ └── json2.js │ └── uncompressed │ │ ├── history.adapter.dojo.js │ │ ├── history.adapter.extjs.js │ │ ├── history.adapter.jquery.js │ │ ├── history.adapter.mootools.js │ │ ├── history.adapter.native.js │ │ ├── history.adapter.right.js │ │ ├── history.adapter.zepto.js │ │ ├── history.html4.js │ │ ├── history.js │ │ └── json2.js │ ├── tests.src │ ├── _header.php │ ├── all.php │ ├── each.php │ └── index.php │ ├── tests │ ├── .htaccess │ ├── html4+html5.dojo.html │ ├── html4+html5.extjs.html │ ├── html4+html5.jquery.html │ ├── html4+html5.mootools.html │ ├── html4+html5.native.html │ ├── html4+html5.right.html │ ├── html4+html5.zepto.html │ ├── html5.dojo.html │ ├── html5.extjs.html │ ├── html5.jquery.html │ ├── html5.mootools.html │ ├── html5.native.html │ ├── html5.right.html │ ├── html5.zepto.html │ ├── image.php │ ├── index.html │ └── tests.js │ └── vendor │ ├── dojo.js │ ├── extjs.js │ ├── jquery.js │ ├── mootools.js │ ├── qunit │ ├── .gitignore │ ├── AUTHORS.txt │ ├── History.md │ ├── README.md │ ├── grunt.js │ ├── package.json │ ├── qunit │ │ ├── .jshintrc │ │ ├── qunit.css │ │ └── qunit.js │ └── test │ │ ├── .jshintrc │ │ ├── async.html │ │ ├── async.js │ │ ├── deepEqual.js │ │ ├── headless.html │ │ ├── index.html │ │ ├── logs.html │ │ ├── logs.js │ │ ├── narwhal-test.js │ │ ├── node-test.js │ │ ├── same.js │ │ ├── swarminject.js │ │ └── test.js │ ├── right.js │ └── zepto.js ├── dist ├── App.js ├── Flux.js ├── c.css ├── c.js ├── client.js ├── common.js ├── components │ └── Root.js ├── render.js ├── router.js ├── server.js ├── styles.js ├── template.js └── uplink.js ├── gulpfile.js ├── package.json ├── public ├── p.css └── p.js └── src ├── App.js ├── Flux.js ├── client.js ├── common.js ├── components └── Root.jsx ├── render.js ├── router.js ├── server.js ├── styles.js ├── template.js └── uplink.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root=true 2 | [*] 3 | end_of_line = lf 4 | insert_final_newline = true 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | tmp 3 | public/p.js 4 | public/p.min.js 5 | public/p.css 6 | public/p.min.css 7 | dist 8 | *.pid 9 | *.lock 10 | npm-debug.log 11 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "maxerr" : 50, // {int} Maximum error before stopping 3 | 4 | // Enforcing 5 | "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) 6 | "camelcase" : true, // true: Identifiers must be in camelCase 7 | "curly" : true, // true: Require {} for every new block or scope 8 | "eqeqeq" : true, // true: Require triple equals (===) for comparison 9 | "freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. 10 | "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() 11 | "immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` 12 | "indent" : 2, // {int} Number of spaces to use for indentation 13 | "latedef" : true, // true: Require variables/functions to be defined before being used 14 | "newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()` 15 | "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee` 16 | "noempty" : true, // true: Prohibit use of empty blocks 17 | "nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters. 18 | "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment) 19 | "plusplus" : true, // true: Prohibit use of `++` & `--` 20 | "quotmark" : "single", // Quotation mark consistency: 21 | // false : do nothing (default) 22 | // true : ensure whatever is used is consistent 23 | // "single" : require single quotes 24 | // "double" : require double quotes 25 | "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) 26 | "unused" : true, // true: Require all defined variables be used 27 | "strict" : false, // true: Requires all functions run in ES5 Strict Mode 28 | "maxparams" : false, // {int} Max number of formal params allowed per function 29 | "maxdepth" : false, // {int} Max depth of nested blocks (within functions) 30 | "maxstatements" : false, // {int} Max number statements per function 31 | "maxcomplexity" : false, // {int} Max cyclomatic complexity per function 32 | "maxlen" : false, // {int} Max number of characters per line 33 | 34 | // Relaxing 35 | "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) 36 | "boss" : false, // true: Tolerate assignments where comparisons would be expected 37 | "debug" : false, // true: Allow debugger statements e.g. browser breakpoints. 38 | "eqnull" : false, // true: Tolerate use of `== null` 39 | "esnext" : true, // true: Allow ES.next (ES6) syntax (ex: `const`) 40 | "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) 41 | // (ex: `for each`, multiple try/catch, function expression…) 42 | "evil" : false, // true: Tolerate use of `eval` and `new Function()` 43 | "expr" : false, // true: Tolerate `ExpressionStatement` as Programs 44 | "funcscope" : false, // true: Tolerate defining variables inside control statements 45 | "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict') 46 | "iterator" : false, // true: Tolerate using the `__iterator__` property 47 | "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block 48 | "laxbreak" : false, // true: Tolerate possibly unsafe line breakings 49 | "laxcomma" : false, // true: Tolerate comma-first style coding 50 | "loopfunc" : false, // true: Tolerate functions being defined in loops 51 | "multistr" : false, // true: Tolerate multi-line strings 52 | "noyield" : true, // true: Tolerate generator functions with no yield statement in them. 53 | "notypeof" : false, // true: Tolerate invalid typeof operator values 54 | "proto" : false, // true: Tolerate using the `__proto__` property 55 | "scripturl" : false, // true: Tolerate script-targeted URLs 56 | "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` 57 | "sub" : true, // true: Tolerate using `[]` notation when it can still be expressed in dot notation 58 | "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` 59 | "validthis" : false, // true: Tolerate using this in a non-constructor function 60 | 61 | // Environments 62 | "browser" : true, // Web Browser (window, document, etc) 63 | "browserify" : true, // Browserify (node.js code in the browser) 64 | "couch" : false, // CouchDB 65 | "devel" : true, // Development/debugging (alert, confirm, etc) 66 | "dojo" : false, // Dojo Toolkit 67 | "jasmine" : false, // Jasmine 68 | "jquery" : false, // jQuery 69 | "mocha" : false, // Mocha 70 | "mootools" : false, // MooTools 71 | "node" : true, // Node.js 72 | "nonstandard" : false, // Widely adopted globals (escape, unescape, etc) 73 | "prototypejs" : false, // Prototype and Scriptaculous 74 | "qunit" : false, // QUnit 75 | "rhino" : false, // Rhino 76 | "shelljs" : false, // ShellJS 77 | "worker" : false, // Web Workers 78 | "wsh" : false, // Windows Scripting Host 79 | "yui" : false, // Yahoo User Interface 80 | 81 | // Custom Globals 82 | "globals" : { // additional predefined global variables 83 | "Promise" : true, 84 | "__DEV__" : true 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | React Nexus Starterkit 2 | ====================== 3 | 4 | Fork it, clone it, deploy it. 5 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-nexus-starterkit", 3 | "version": "0.2.1", 4 | "homepage": "https://github.com/elierotenberg/react-nexus-starterkit", 5 | "authors": [ 6 | "Elie Rotenberg " 7 | ], 8 | "license": "MIT", 9 | "ignore": [ 10 | "**/.*", 11 | "node_modules", 12 | "bower_components", 13 | "test", 14 | "tests" 15 | ], 16 | "dependencies": { 17 | "history.js": "~1.8.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /bower_components/history.js/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "history.js", 3 | "version": "1.8.0", 4 | "homepage": "https://github.com/browserstate/history.js", 5 | "_release": "1.8.0", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "1.8.0", 9 | "commit": "6c6c8b951b03fa725adb11b1087d73b0b6f0ac82" 10 | }, 11 | "_source": "git://github.com/browserstate/history.js.git", 12 | "_target": "~1.8.0", 13 | "_originalSource": "history.js", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /bower_components/history.js/.gitignore: -------------------------------------------------------------------------------- 1 | .build 2 | /node_modules 3 | /.idea 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /bower_components/history.js/History.md: -------------------------------------------------------------------------------- 1 | ## History 2 | 3 | - v1.8b2 - June 22 2013 4 | - Introduced uncompressed bundled files #287 5 | - Copied component.json to bower.json #291 and used right tag #286 6 | - Fixed wrong argument passed to History.getHash() #305, #297, #292 (@Izkata) 7 | 8 | - v1.8b1 - May 31 2013 9 | - Fixed "encoded string automatically unencoded on html5 browsers" #282, #236, #272 10 | 11 | - v1.8a4 - February 13 2013 12 | - Fixed coffee script warnings (ExtJS & Dojo adapter, IE 6 iFrame) 13 | - Updated qUnit to release 1.11.0, jQuery to release 1.9.1 14 | 15 | - v1.8a3 - February 5 2013 16 | - Added tests for Dojo and ExtJS 17 | - Changed setting of title and url 18 | - Testing status 19 | - All HTML5 Native Adapter fail in all browsers on Test 10 20 | - All other HTML5 tests work fine 21 | - All other HTML4 tests fail in Test 4 (in IE) 22 | 23 | - v1.8a2 - January 21 2013 24 | - 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 25 | - UTF8 / url encoding / decoding tested and so resolved: #64, #107, #108, #162, #177, #187, #205, #207, #210, #228, #251 26 | - Fixed #244 27 | 28 | - v1.8a1 - January 19 2013 29 | - Pass options to `init()` as json is now supported 30 | - Added unicode demo 31 | - Introduced `getCurrentIndex()`, so you can get previous state by `History.getStateByIndex(getCurrentIndex()-1)` 32 | - Fixed HTML4 endless loop when url starts with a slash (e.g. /welcome/hello) #239, #232, #185 33 | - Bundled and compressed all scripts 34 | - Responsed (and therefore solved) or old issues from balupton repository: #250, #242, #238, #234, #224, #213, #206, #195, #183, #181, #180, #179, #175, #168 35 | - 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 36 | - Feedback for UTF8 / url encode issues necessary, related problems (thanks to riyad) 37 | - #64, #107, #108, #162, #177, #187, #205, #207, #210, #228 38 | 39 | - v1.7.2 - January 18 2013 40 | - Updated project README 41 | - Integrated ExtJS Adapter (thanks to @seanadkinson!) 42 | - Merged from forks 43 | - added option to force no suid (@hrunting, @sbearcsiro) 44 | - provide a consistent URI-encoded document.location.href (@hrunting, @sbearcsiro) 45 | - Change History.getHash to return consistent hash, ala History.getLocationHref (@sbearcsiro) 46 | - Fix an issue where HTML4 replaceState wasn't firing when SUIDs were disabled and the url didn't change (@sbearcsiro) 47 | - Make extractId ignore the fragment if one is present (normally the hash is passed without an fragment) (@sbearcsiro) 48 | - 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) 49 | - Change escapeHash/unescapeHash methods to use encodeURI/decodeURI instead of window.escape/unescape (@sbearcsiro) 50 | - Fixed issue #158 (@sbearcsiro) 51 | - isEmptyObject should use hasOwnProperty: prevents from always returning true if the Object.prototype is extended (@Alexander Johansson) 52 | - Add potential fix for IE8 not returning full hashed url from getLocationHref when hash contains encoded characters (@sbearcsiro) 53 | - Match current W3C popState event semantics for HTML4 (@STRML) 54 | - Added History.options.html4Mode for easier debugging (@gigafied) 55 | - Added History.options.delayInit (Boolean). (@gigafied) 56 | - Added error testing and quota relief for sessionStorage.setItem (@jamie-pate) 57 | - Fix IE 6 HTTPS warning (@Daniel15) 58 | - Fixed bug in html4 pushState function which left History in a busy state (@joelarson4) 59 | - Disable session storage if it's present but not working, thanks to @paulschreiber (@sbearcsiro) 60 | - Add Lakin Wecker's dojo adapter (@sbearcsiro) 61 | - Add dojo 1.8 tests (@sbearcsiro) 62 | - Change dojo adapter to not use dojo events, it seems to break other parts of dojo (@sbearcsiro) 63 | - Removes stray spaces so that the build script can run. (@billmag) 64 | - fixed an issue in Safari's Private Browsing mode where setItem throws an exception (@billmag) 65 | - Adds better error handling for the quota exceeded problem seen with the iPad. (@billmag) 66 | - Consolidated var in sessionStorage to the top of the function. Re-build compressed and bundled. (@billmag) 67 | 68 | - v1.7.1 - October 4 2011 69 | - Added a new native adapter which is framework agnostic (can be used with, or without any framework) 70 | - Provided bundled files 71 | - Added RightJS adapter 72 | - Updated supported browser listing 73 | - Added sessionStorage support in core instead of optional Amplify.js Store support 74 | - Fixed issue with state id generation growing slower over time 75 | - Closes #104, #95, #102, #92, #81, #90, #94, #93, #91, #67, #83, #54, #45 76 | 77 | - v1.7.0 - April 1 2011 78 | - 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`. 79 | - 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) 80 | - 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/) 81 | - 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) 82 | - Fixed URL Encoding Issue - [Reported](https://github.com/balupton/history.js/issues/#issue/33) by [Rob Madole](http://robmadole.com/) 83 | - 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/) 84 | - URLs in the State Hashes for HTML4 Browsers are now even shorter - [Discussion](https://github.com/balupton/history.js/issues#issue/28) 85 | - Fixed a issue with the MooTools Adapter and JSON with IE7 and IE8 86 | 87 | - v1.6.0 - March 22 2011 88 | - Added Zepto adapter thanks to [Matt Garrett](http://twitter.com/#!/matthewgarrett) 89 | - The readme now references the supported versions of the libraries we use 90 | - Updated vendors to the most recent versions. jQuery 1.5.1 and Mootools 1.3.1 91 | - Reverted versions of Safari iOS prior to version 4.3 to be HTML4 browsers, Safari iOS 4.3 is a HTML5 browser 92 | - Refined code in History.js and its adapters 93 | - 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/) 94 | - 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) 95 | - 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) 96 | - 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/) 97 | - 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/) 98 | - **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. 99 | 100 | - v1.5.0 - February 12 2011 101 | - Moved to UglifyJS instead of Google Closure 102 | - Split HTML4 functionality from HTML5 functionality 103 | - Installation details have changed (the filenames are different) 104 | 105 | - v1.4.1 - February 10 2011 106 | - Added HTML History API Support for Safari 5 and Safari iOS 4.2.1 107 | - Cleaned code a bit (mostly with unit tests) 108 | 109 | - v1.4.0 - February 10 2011 110 | - Unit Testing now uses [QUnit](http://docs.jquery.com/Qunit) 111 | - Corrected Safari 5 Support 112 | - Now uses queues instead of timeouts 113 | - This means the API works exactly as expected, no more need to wrap calls in timeouts 114 | - Included a Subscribe Form in the Demo for Version Updates via Email 115 | - Small updates to Documentation 116 | 117 | - v1.3.1 - February 4 2011 118 | - Improved Documentation 119 | 120 | - v1.3.0 - January 31 2011 121 | - Support for cleaner HTML4 States 122 | 123 | - v1.2.1 - January 30 2011 124 | - Fixed History.log always being called - [reported by dlee](https://github.com/balupton/history.js/issues/#issue/2) 125 | - Re-Added `History.go(index)` support 126 | 127 | - v1.2.0 - January 25 2011 128 | - Support for HTML4 States in HTML5 Browsers (added test) 129 | - Updates of Documentation 130 | 131 | - v1.1.0 - January 24 2011 132 | - Developed a series of automated test cases 133 | - Fixed issue with traditional anchors 134 | - Fixed issue with differing replaceState functionality in HTML4 Browsers 135 | - Fixed issue with Google Chrome artefacts being carried over to the initial state 136 | - Provided `onstatechange` and `onanchorchange` events 137 | 138 | - v1.0.0 - January 22 2011 139 | - Supported `History.pushState` and `History.replaceState` degradation 140 | - Supported jQuery, MooTools and Prototype Frameworks 141 | 142 | -------------------------------------------------------------------------------- /bower_components/history.js/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "history.js", 3 | "version": "1.8.0" 4 | } 5 | -------------------------------------------------------------------------------- /bower_components/history.js/buildr-uncompressed.coffee: -------------------------------------------------------------------------------- 1 | # Requires 2 | buildr = require 'buildr' 3 | util = require 'util' 4 | 5 | # Options 6 | options = 7 | watch: false 8 | compress: false 9 | 10 | # Configs 11 | configs = 12 | standard: 13 | # Options 14 | name: 'standard' 15 | watch: options.watch 16 | 17 | # Paths 18 | srcPath: __dirname+'/scripts/uncompressed' 19 | 20 | # Checking 21 | checkScripts: true 22 | jshintOptions: 23 | browser: true 24 | laxbreak: true 25 | boss: true 26 | undef: true 27 | onevar: true 28 | strict: true 29 | noarg: true 30 | 31 | # Compression (without outPath only the generated bundle files are compressed) 32 | compressScripts: options.compress # Array or true or false 33 | 34 | other: [ 35 | 36 | # ----------------------------- 37 | # Dojo Toolkit 38 | 39 | { 40 | # Options 41 | name: 'html4+html5+dojo' 42 | watch: options.watch 43 | 44 | # Paths 45 | srcPath: __dirname+'/scripts/uncompressed' 46 | 47 | # Compression (without outPath only the generated bundle files are compressed) 48 | compressScripts: options.compress # Array or true or false 49 | 50 | # Order 51 | scriptsOrder: [ 52 | 'json2.js' 53 | 'history.adapter.dojo.js' 54 | 'history.html4.js' 55 | 'history.js' 56 | ] 57 | 58 | # Bundling 59 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/dojo.history.js' 60 | } 61 | { 62 | # Options 63 | name: 'html5+dojo' 64 | watch: options.watch 65 | 66 | # Paths 67 | srcPath: __dirname+'/scripts/uncompressed' 68 | 69 | # Compression (without outPath only the generated bundle files are compressed) 70 | compressScripts: options.compress # Array or true or false 71 | 72 | # Order 73 | scriptsOrder: [ 74 | 'history.adapter.dojo.js' 75 | 'history.js' 76 | ] 77 | 78 | # Bundling 79 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/dojo.history.js' 80 | } 81 | 82 | # ----------------------------- 83 | # ExtJS 84 | 85 | { 86 | # Options 87 | name: 'html4+html5+extjs' 88 | watch: options.watch 89 | 90 | # Paths 91 | srcPath: __dirname+'/scripts/uncompressed' 92 | 93 | # Compression (without outPath only the generated bundle files are compressed) 94 | compressScripts: options.compress # Array or true or false 95 | 96 | # Order 97 | scriptsOrder: [ 98 | 'json2.js' 99 | 'history.adapter.extjs.js' 100 | 'history.html4.js' 101 | 'history.js' 102 | ] 103 | 104 | # Bundling 105 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/extjs.history.js' 106 | } 107 | { 108 | # Options 109 | name: 'html5+extjs' 110 | watch: options.watch 111 | 112 | # Paths 113 | srcPath: __dirname+'/scripts/uncompressed' 114 | 115 | # Compression (without outPath only the generated bundle files are compressed) 116 | compressScripts: options.compress # Array or true or false 117 | 118 | # Order 119 | scriptsOrder: [ 120 | 'history.adapter.extjs.js' 121 | 'history.js' 122 | ] 123 | 124 | # Bundling 125 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/extjs.history.js' 126 | } 127 | 128 | # ----------------------------- 129 | # JQUERY 130 | 131 | { 132 | # Options 133 | name: 'html4+html5+jquery' 134 | watch: options.watch 135 | 136 | # Paths 137 | srcPath: __dirname+'/scripts/uncompressed' 138 | 139 | # Compression (without outPath only the generated bundle files are compressed) 140 | compressScripts: options.compress # Array or true or false 141 | 142 | # Order 143 | scriptsOrder: [ 144 | 'json2.js' 145 | 'history.adapter.jquery.js' 146 | 'history.html4.js' 147 | 'history.js' 148 | ] 149 | 150 | # Bundling 151 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/jquery.history.js' 152 | } 153 | { 154 | # Options 155 | name: 'html5+jquery' 156 | watch: options.watch 157 | 158 | # Paths 159 | srcPath: __dirname+'/scripts/uncompressed' 160 | 161 | # Compression (without outPath only the generated bundle files are compressed) 162 | compressScripts: options.compress # Array or true or false 163 | 164 | # Order 165 | scriptsOrder: [ 166 | 'history.adapter.jquery.js' 167 | 'history.js' 168 | ] 169 | 170 | # Bundling 171 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/jquery.history.js' 172 | } 173 | 174 | 175 | # ----------------------------- 176 | # MOOTOOLS 177 | 178 | { 179 | # Options 180 | name: 'html4+html5+mootools' 181 | watch: options.watch 182 | 183 | # Paths 184 | srcPath: __dirname+'/scripts/uncompressed' 185 | 186 | # Compression (without outPath only the generated bundle files are compressed) 187 | compressScripts: options.compress # Array or true or false 188 | 189 | # Order 190 | scriptsOrder: [ 191 | 'json2.js' 192 | 'history.adapter.mootools.js' 193 | 'history.html4.js' 194 | 'history.js' 195 | ] 196 | 197 | # Bundling 198 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/mootools.history.js' 199 | } 200 | { 201 | # Options 202 | name: 'html5+mootools' 203 | watch: options.watch 204 | 205 | # Paths 206 | srcPath: __dirname+'/scripts/uncompressed' 207 | 208 | # Compression (without outPath only the generated bundle files are compressed) 209 | compressScripts: options.compress # Array or true or false 210 | 211 | # Order 212 | scriptsOrder: [ 213 | 'history.adapter.mootools.js' 214 | 'history.js' 215 | ] 216 | 217 | # Bundling 218 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/mootools.history.js' 219 | } 220 | 221 | 222 | # ----------------------------- 223 | # NATIVE 224 | 225 | { 226 | # Options 227 | name: 'html4+html5+native' 228 | watch: options.watch 229 | 230 | # Paths 231 | srcPath: __dirname+'/scripts/uncompressed' 232 | 233 | # Compression (without outPath only the generated bundle files are compressed) 234 | compressScripts: options.compress # Array or true or false 235 | 236 | # Order 237 | scriptsOrder: [ 238 | 'json2.js' 239 | 'history.adapter.native.js' 240 | 'history.html4.js' 241 | 'history.js' 242 | ] 243 | 244 | # Bundling 245 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/native.history.js' 246 | } 247 | { 248 | # Options 249 | name: 'html5+native' 250 | watch: options.watch 251 | 252 | # Paths 253 | srcPath: __dirname+'/scripts/uncompressed' 254 | 255 | # Compression (without outPath only the generated bundle files are compressed) 256 | compressScripts: options.compress # Array or true or false 257 | 258 | # Order 259 | scriptsOrder: [ 260 | 'history.adapter.native.js' 261 | 'history.js' 262 | ] 263 | 264 | # Bundling 265 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/native.history.js' 266 | } 267 | 268 | 269 | # ----------------------------- 270 | # RIGHT.JS 271 | 272 | { 273 | # Options 274 | name: 'html4+html5+right' 275 | watch: options.watch 276 | 277 | # Paths 278 | srcPath: __dirname+'/scripts/uncompressed' 279 | 280 | # Compression (without outPath only the generated bundle files are compressed) 281 | compressScripts: options.compress # Array or true or false 282 | 283 | # Order 284 | scriptsOrder: [ 285 | 'json2.js' 286 | 'history.adapter.right.js' 287 | 'history.html4.js' 288 | 'history.js' 289 | ] 290 | 291 | # Bundling 292 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/right.history.js' 293 | } 294 | { 295 | # Options 296 | name: 'html5+right' 297 | watch: options.watch 298 | 299 | # Paths 300 | srcPath: __dirname+'/scripts/uncompressed' 301 | 302 | # Compression (without outPath only the generated bundle files are compressed) 303 | compressScripts: options.compress # Array or true or false 304 | 305 | # Order 306 | scriptsOrder: [ 307 | 'history.adapter.right.js' 308 | 'history.js' 309 | ] 310 | 311 | # Bundling 312 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/right.history.js' 313 | } 314 | 315 | 316 | # ----------------------------- 317 | # ZEPTO 318 | 319 | { 320 | # Options 321 | name: 'html4+html5+zepto' 322 | watch: options.watch 323 | 324 | # Paths 325 | srcPath: __dirname+'/scripts/uncompressed' 326 | 327 | # Compression (without outPath only the generated bundle files are compressed) 328 | compressScripts: options.compress # Array or true or false 329 | 330 | # Order 331 | scriptsOrder: [ 332 | 'json2.js' 333 | 'history.adapter.zepto.js' 334 | 'history.html4.js' 335 | 'history.js' 336 | ] 337 | 338 | # Bundling 339 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html4+html5/zepto.history.js' 340 | } 341 | { 342 | # Options 343 | name: 'html5+zepto' 344 | watch: options.watch 345 | 346 | # Paths 347 | srcPath: __dirname+'/scripts/uncompressed' 348 | 349 | # Compression (without outPath only the generated bundle files are compressed) 350 | compressScripts: options.compress # Array or true or false 351 | 352 | # Order 353 | scriptsOrder: [ 354 | 'history.adapter.zepto.js' 355 | 'history.js' 356 | ] 357 | 358 | # Bundling 359 | bundleScriptPath: __dirname+'/scripts/bundled-uncompressed/html5/zepto.history.js' 360 | } 361 | ] 362 | 363 | # Standard 364 | standardConfig = configs.standard 365 | standardConfig.successHandler = -> 366 | for config in configs.other 367 | buildrInstance = buildr.createInstance config 368 | buildrInstance.process() 369 | 370 | # Process 371 | standardBuildr = buildr.createInstance configs.standard 372 | standardBuildr.process() 373 | -------------------------------------------------------------------------------- /bower_components/history.js/buildr.coffee: -------------------------------------------------------------------------------- 1 | # Requires 2 | buildr = require 'buildr' 3 | util = require 'util' 4 | 5 | # Options 6 | options = 7 | watch: false 8 | compress: true 9 | 10 | # Configs 11 | configs = 12 | standard: 13 | # Options 14 | name: 'standard' 15 | watch: options.watch 16 | 17 | # Paths 18 | srcPath: __dirname+'/scripts/uncompressed' 19 | outPath: __dirname+'/scripts/compressed' 20 | 21 | # Checking 22 | checkScripts: true 23 | jshintOptions: 24 | browser: true 25 | laxbreak: true 26 | boss: true 27 | undef: true 28 | onevar: true 29 | strict: true 30 | noarg: true 31 | 32 | # Compression (without outPath only the generated bundle files are compressed) 33 | compressScripts: options.compress # Array or true or false 34 | 35 | other: [ 36 | 37 | # ----------------------------- 38 | # Dojo Toolkit 39 | 40 | { 41 | # Options 42 | name: 'html4+html5+dojo' 43 | watch: options.watch 44 | 45 | # Paths 46 | srcPath: __dirname+'/scripts/uncompressed' 47 | 48 | # Compression (without outPath only the generated bundle files are compressed) 49 | compressScripts: options.compress # Array or true or false 50 | 51 | # Order 52 | scriptsOrder: [ 53 | 'json2.js' 54 | 'history.adapter.dojo.js' 55 | 'history.html4.js' 56 | 'history.js' 57 | ] 58 | 59 | # Bundling 60 | bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/dojo.history.js' 61 | } 62 | { 63 | # Options 64 | name: 'html5+dojo' 65 | watch: options.watch 66 | 67 | # Paths 68 | srcPath: __dirname+'/scripts/uncompressed' 69 | 70 | # Compression (without outPath only the generated bundle files are compressed) 71 | compressScripts: options.compress # Array or true or false 72 | 73 | # Order 74 | scriptsOrder: [ 75 | 'history.adapter.dojo.js' 76 | 'history.js' 77 | ] 78 | 79 | # Bundling 80 | bundleScriptPath: __dirname+'/scripts/bundled/html5/dojo.history.js' 81 | } 82 | 83 | # ----------------------------- 84 | # ExtJS 85 | 86 | { 87 | # Options 88 | name: 'html4+html5+extjs' 89 | watch: options.watch 90 | 91 | # Paths 92 | srcPath: __dirname+'/scripts/uncompressed' 93 | 94 | # Compression (without outPath only the generated bundle files are compressed) 95 | compressScripts: options.compress # Array or true or false 96 | 97 | # Order 98 | scriptsOrder: [ 99 | 'json2.js' 100 | 'history.adapter.extjs.js' 101 | 'history.html4.js' 102 | 'history.js' 103 | ] 104 | 105 | # Bundling 106 | bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/extjs.history.js' 107 | } 108 | { 109 | # Options 110 | name: 'html5+extjs' 111 | watch: options.watch 112 | 113 | # Paths 114 | srcPath: __dirname+'/scripts/uncompressed' 115 | 116 | # Compression (without outPath only the generated bundle files are compressed) 117 | compressScripts: options.compress # Array or true or false 118 | 119 | # Order 120 | scriptsOrder: [ 121 | 'history.adapter.extjs.js' 122 | 'history.js' 123 | ] 124 | 125 | # Bundling 126 | bundleScriptPath: __dirname+'/scripts/bundled/html5/extjs.history.js' 127 | } 128 | 129 | # ----------------------------- 130 | # JQUERY 131 | 132 | { 133 | # Options 134 | name: 'html4+html5+jquery' 135 | watch: options.watch 136 | 137 | # Paths 138 | srcPath: __dirname+'/scripts/uncompressed' 139 | 140 | # Compression (without outPath only the generated bundle files are compressed) 141 | compressScripts: options.compress # Array or true or false 142 | 143 | # Order 144 | scriptsOrder: [ 145 | 'json2.js' 146 | 'history.adapter.jquery.js' 147 | 'history.html4.js' 148 | 'history.js' 149 | ] 150 | 151 | # Bundling 152 | bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/jquery.history.js' 153 | } 154 | { 155 | # Options 156 | name: 'html5+jquery' 157 | watch: options.watch 158 | 159 | # Paths 160 | srcPath: __dirname+'/scripts/uncompressed' 161 | 162 | # Compression (without outPath only the generated bundle files are compressed) 163 | compressScripts: options.compress # Array or true or false 164 | 165 | # Order 166 | scriptsOrder: [ 167 | 'history.adapter.jquery.js' 168 | 'history.js' 169 | ] 170 | 171 | # Bundling 172 | bundleScriptPath: __dirname+'/scripts/bundled/html5/jquery.history.js' 173 | } 174 | 175 | 176 | # ----------------------------- 177 | # MOOTOOLS 178 | 179 | { 180 | # Options 181 | name: 'html4+html5+mootools' 182 | watch: options.watch 183 | 184 | # Paths 185 | srcPath: __dirname+'/scripts/uncompressed' 186 | 187 | # Compression (without outPath only the generated bundle files are compressed) 188 | compressScripts: options.compress # Array or true or false 189 | 190 | # Order 191 | scriptsOrder: [ 192 | 'json2.js' 193 | 'history.adapter.mootools.js' 194 | 'history.html4.js' 195 | 'history.js' 196 | ] 197 | 198 | # Bundling 199 | bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/mootools.history.js' 200 | } 201 | { 202 | # Options 203 | name: 'html5+mootools' 204 | watch: options.watch 205 | 206 | # Paths 207 | srcPath: __dirname+'/scripts/uncompressed' 208 | 209 | # Compression (without outPath only the generated bundle files are compressed) 210 | compressScripts: options.compress # Array or true or false 211 | 212 | # Order 213 | scriptsOrder: [ 214 | 'history.adapter.mootools.js' 215 | 'history.js' 216 | ] 217 | 218 | # Bundling 219 | bundleScriptPath: __dirname+'/scripts/bundled/html5/mootools.history.js' 220 | } 221 | 222 | 223 | # ----------------------------- 224 | # NATIVE 225 | 226 | { 227 | # Options 228 | name: 'html4+html5+native' 229 | watch: options.watch 230 | 231 | # Paths 232 | srcPath: __dirname+'/scripts/uncompressed' 233 | 234 | # Compression (without outPath only the generated bundle files are compressed) 235 | compressScripts: options.compress # Array or true or false 236 | 237 | # Order 238 | scriptsOrder: [ 239 | 'json2.js' 240 | 'history.adapter.native.js' 241 | 'history.html4.js' 242 | 'history.js' 243 | ] 244 | 245 | # Bundling 246 | bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/native.history.js' 247 | } 248 | { 249 | # Options 250 | name: 'html5+native' 251 | watch: options.watch 252 | 253 | # Paths 254 | srcPath: __dirname+'/scripts/uncompressed' 255 | 256 | # Compression (without outPath only the generated bundle files are compressed) 257 | compressScripts: options.compress # Array or true or false 258 | 259 | # Order 260 | scriptsOrder: [ 261 | 'history.adapter.native.js' 262 | 'history.js' 263 | ] 264 | 265 | # Bundling 266 | bundleScriptPath: __dirname+'/scripts/bundled/html5/native.history.js' 267 | } 268 | 269 | 270 | # ----------------------------- 271 | # RIGHT.JS 272 | 273 | { 274 | # Options 275 | name: 'html4+html5+right' 276 | watch: options.watch 277 | 278 | # Paths 279 | srcPath: __dirname+'/scripts/uncompressed' 280 | 281 | # Compression (without outPath only the generated bundle files are compressed) 282 | compressScripts: options.compress # Array or true or false 283 | 284 | # Order 285 | scriptsOrder: [ 286 | 'json2.js' 287 | 'history.adapter.right.js' 288 | 'history.html4.js' 289 | 'history.js' 290 | ] 291 | 292 | # Bundling 293 | bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/right.history.js' 294 | } 295 | { 296 | # Options 297 | name: 'html5+right' 298 | watch: options.watch 299 | 300 | # Paths 301 | srcPath: __dirname+'/scripts/uncompressed' 302 | 303 | # Compression (without outPath only the generated bundle files are compressed) 304 | compressScripts: options.compress # Array or true or false 305 | 306 | # Order 307 | scriptsOrder: [ 308 | 'history.adapter.right.js' 309 | 'history.js' 310 | ] 311 | 312 | # Bundling 313 | bundleScriptPath: __dirname+'/scripts/bundled/html5/right.history.js' 314 | } 315 | 316 | 317 | # ----------------------------- 318 | # ZEPTO 319 | 320 | { 321 | # Options 322 | name: 'html4+html5+zepto' 323 | watch: options.watch 324 | 325 | # Paths 326 | srcPath: __dirname+'/scripts/uncompressed' 327 | 328 | # Compression (without outPath only the generated bundle files are compressed) 329 | compressScripts: options.compress # Array or true or false 330 | 331 | # Order 332 | scriptsOrder: [ 333 | 'json2.js' 334 | 'history.adapter.zepto.js' 335 | 'history.html4.js' 336 | 'history.js' 337 | ] 338 | 339 | # Bundling 340 | bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/zepto.history.js' 341 | } 342 | { 343 | # Options 344 | name: 'html5+zepto' 345 | watch: options.watch 346 | 347 | # Paths 348 | srcPath: __dirname+'/scripts/uncompressed' 349 | 350 | # Compression (without outPath only the generated bundle files are compressed) 351 | compressScripts: options.compress # Array or true or false 352 | 353 | # Order 354 | scriptsOrder: [ 355 | 'history.adapter.zepto.js' 356 | 'history.js' 357 | ] 358 | 359 | # Bundling 360 | bundleScriptPath: __dirname+'/scripts/bundled/html5/zepto.history.js' 361 | } 362 | ] 363 | 364 | # Standard 365 | standardConfig = configs.standard 366 | standardConfig.successHandler = -> 367 | for config in configs.other 368 | buildrInstance = buildr.createInstance config 369 | buildrInstance.process() 370 | 371 | # Process 372 | standardBuildr = buildr.createInstance configs.standard 373 | standardBuildr.process() 374 | -------------------------------------------------------------------------------- /bower_components/history.js/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "history.js", 3 | "version": "1.8.0" 4 | } 5 | -------------------------------------------------------------------------------- /bower_components/history.js/demo/bcherry-orig.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | WebKit is Dropping HTML5 "popstate" Events 8 | 9 | 10 | 11 | 14 | 15 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |

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.

32 |

This was filed as Bug 42940 with WebKit on July 24, 2010. The Firefox 4 beta does not have this bug, which is good news.

33 |

This is put together by Ben Cherry. Ben is a front-end engineer at Twitter, and you can follow him at @bcherry.

34 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /bower_components/history.js/demo/bcherry.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | WebKit is Dropping HTML5 "popstate" Events 8 | 9 | 10 | 11 | 14 | 15 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |

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.

32 |

This was filed as Bug 42940 with WebKit on July 24, 2010. The Firefox 4 beta does not have this bug, which is good news.

33 |

This is put together by Ben Cherry. Ben is a front-end engineer at Twitter, and you can follow him at @bcherry.

34 |

This bug was fixed in History.js by Benjamin Lupton. Benjamin is a freelance web 2.0 consultant, and you can follow him at @balupton.

35 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /bower_components/history.js/demo/chrome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Chrome History API Data Artifact 4 | 5 | 6 |

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.

7 |

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.

8 |

Reported by Benjamin Lupton author of History.js

9 | 10 | 11 | 12 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /bower_components/history.js/demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | History.js 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |

History.js

20 |

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.

21 | 22 | 23 | 24 | 25 | 26 |

Click through the buttons in order and you'll get the results demonstrated in the README.md file.

27 | 28 | 29 | 31 | 32 | 33 | 82 |
83 | 84 | 85 | -------------------------------------------------------------------------------- /bower_components/history.js/demo/native-auto.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /bower_components/history.js/demo/native.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | HTML5 History API Demo 4 | 5 | 6 | 7 |
8 |
9 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /bower_components/history.js/demo/navigator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Navigator Output 7 | 8 | 12 | 13 | 14 | 15 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /bower_components/history.js/demo/safari.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Safari Hash ReplaceState History Traversal Bug 4 | 5 | 6 |

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.

7 |

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.

8 |

Reported by Benjamin Lupton author of History.js

9 | 10 | 11 | 12 | 13 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /bower_components/history.js/demo/unicode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | History.js 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |

History.js

20 |

History.js gracefully supports unicode.

21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 77 |
78 | 79 | 80 | -------------------------------------------------------------------------------- /bower_components/history.js/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011, Benjamin Arthur Lupton 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | • 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. 8 | • 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. 9 | 10 | 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. -------------------------------------------------------------------------------- /bower_components/history.js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "history.js", 3 | "version": "1.8.0", 4 | "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.", 5 | "homepage": "https://github.com/browserstate/history.js", 6 | "keywords": [ 7 | "javascript", 8 | "html5 history api", 9 | "hashchange", 10 | "popstate", 11 | "pushstate", 12 | "replacestate", 13 | "hashes", 14 | "hashbang" 15 | ], 16 | "author": { 17 | "name": "Benjamin Lupton", 18 | "email": "b@lupton.cc", 19 | "web": "http://balupton.com" 20 | }, 21 | "maintainers": [ 22 | { 23 | "name": "Benjamin Lupton", 24 | "email": "b@lupton.cc", 25 | "web": "http://balupton.com" 26 | }, 27 | { 28 | "name": "Andreas Bernhard", 29 | "email": "andreas@bernhard.im", 30 | "web": "http://www.bs-infosys.com" 31 | } 32 | ], 33 | "contributors": [ 34 | { 35 | "name": "Benjamin Lupton", 36 | "email": "b@lupton.cc", 37 | "web": "http://balupton.com" 38 | }, 39 | { 40 | "name": "Andreas Bernhard", 41 | "email": "andreas@bernhard.im", 42 | "web": "http://www.bs-infosys.com" 43 | } 44 | ], 45 | "bugs": { 46 | "web": "https://github.com/browserstate/history.js/issues" 47 | }, 48 | "licenses": [ 49 | { 50 | "type": "New-BSD", 51 | "url": "http://creativecommons.org/licenses/BSD/" 52 | } 53 | ], 54 | "repository": { 55 | "type": "git", 56 | "url": "http://github.com/browserstate/history.js.git" 57 | }, 58 | "dependencies": { 59 | "buildr": "0.8.x" 60 | }, 61 | "engines": { 62 | }, 63 | "directories": { 64 | "out": "./scripts/compressed", 65 | "src": "./scripts/uncompressed" 66 | } 67 | } -------------------------------------------------------------------------------- /bower_components/history.js/scripts/compressed/history.adapter.dojo.js: -------------------------------------------------------------------------------- 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")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||h.getLocationHref(),n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.getLocationHref=function(e){return e=e||r,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:e.URL.indexOf("#")==-1&&e.location.href.indexOf("#")!=-1?e.location.href:e.URL||e.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};return t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(e.url?e.url:h.getLocationHref()),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data),(t.title||n)&&h.options.disableSuid!==!0&&(t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r,i;return e.indexOf("#")!=-1?i=e.split("#")[0]:i=e,n=/(.*)\&_suid=([0-9]+)$/.exec(i),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getCurrentIndex=function(){var e=null;return h.savedStates.length<1?e=0:e=h.savedStates.length-1,e},h.getHash=function(e){var t=h.getLocationHref(e),n;return n=h.getHashByUrl(t),n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=decodeURIComponent(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(h.busy(!0),n=h.extractState(e,!0),n&&!h.emulated.pushState?h.pushState(n.data,n.title,n.url,!1):h.getHash()!==e&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+e,!1)):r.location.hash=e),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.encodeURIComponent(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","<").replace(">",">").replace(" & "," & ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(h.getLocationHref()),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var v=function(){};h.pushState=h.pushState||v,h.replaceState=h.replaceState||v}else h.onPopState=function(t,n){var r=!1,i=!1,s,o;return h.doubleCheckComplete(),s=h.getHash(),s?(o=h.extractState(s||h.getLocationHref(),!0),o?h.replaceState(o.data,o.title,o.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",t,n)||!1,r?i=h.getStateById(r):h.expectedStateId?i=h.getStateById(h.expectedStateId):i=h.extractState(h.getLocationHref()),i||(i=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(i)?(h.busy(!1),!1):(h.storeState(i),h.saveState(i),h.setTitle(i),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(m){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),s&&(h.onUnload=function(){var e,t,n;try{e=l.parse(s.getItem("History.store"))||{}}catch(r){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),n=l.stringify(e);try{s.setItem("History.store",n)}catch(i){if(i.code!==DOMException.QUOTA_EXCEEDED_ERR)throw i;s.length&&(s.removeItem("History.store"),s.setItem("History.store",n))}},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},(!h.options||!h.options.delayInit)&&h.init()})(window) -------------------------------------------------------------------------------- /bower_components/history.js/scripts/compressed/json2.js: -------------------------------------------------------------------------------- 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 7 | * @copyright 2010-2011 Benjamin Arthur Lupton 8 | * @license New BSD License 9 | */ 10 | 11 | // Closure 12 | (function(window,undefined){ 13 | "use strict"; 14 | 15 | // Localise Globals 16 | var History = window.History = window.History||{}, 17 | require = window.require; 18 | 19 | // Check Existence 20 | if ( typeof History.Adapter !== 'undefined' ) { 21 | throw new Error('History.js Adapter has already been loaded...'); 22 | } 23 | 24 | // Add the Adapter 25 | History.Adapter = { 26 | /** 27 | * History.Adapter.handlers[uid][eventName] = Array 28 | */ 29 | handlers: {}, 30 | 31 | /** 32 | * History.Adapter._uid 33 | * The current element unique identifier 34 | */ 35 | _uid: 1, 36 | 37 | /** 38 | * History.Adapter.uid(element) 39 | * @param {Element} element 40 | * @return {String} uid 41 | */ 42 | uid: function(element){ 43 | return element._uid || (element._uid = History.Adapter._uid++); 44 | }, 45 | 46 | /** 47 | * History.Adapter.bind(el,event,callback) 48 | * @param {Element} element 49 | * @param {String} eventName - custom and standard events 50 | * @param {Function} callback 51 | * @return 52 | */ 53 | bind: function(element,eventName,callback){ 54 | // Prepare 55 | var uid = History.Adapter.uid(element); 56 | 57 | // Apply Listener 58 | History.Adapter.handlers[uid] = History.Adapter.handlers[uid] || {}; 59 | History.Adapter.handlers[uid][eventName] = History.Adapter.handlers[uid][eventName] || []; 60 | History.Adapter.handlers[uid][eventName].push(callback); 61 | 62 | // Bind Global Listener 63 | element['on'+eventName] = (function(element,eventName){ 64 | return function(event){ 65 | History.Adapter.trigger(element,eventName,event); 66 | }; 67 | })(element,eventName); 68 | }, 69 | 70 | /** 71 | * History.Adapter.trigger(el,event) 72 | * @param {Element} element 73 | * @param {String} eventName - custom and standard events 74 | * @param {Object} event - a object of event data 75 | * @return 76 | */ 77 | trigger: function(element,eventName,event){ 78 | // Prepare 79 | event = event || {}; 80 | var uid = History.Adapter.uid(element), 81 | i,n; 82 | 83 | // Apply Listener 84 | History.Adapter.handlers[uid] = History.Adapter.handlers[uid] || {}; 85 | History.Adapter.handlers[uid][eventName] = History.Adapter.handlers[uid][eventName] || []; 86 | 87 | // Fire Listeners 88 | for ( i=0,n=History.Adapter.handlers[uid][eventName].length; i 4 | * @copyright 2012 Sean Adkinson 5 | * @license New BSD License 6 | */ 7 | 8 | // Closure 9 | (function(window,undefined){ 10 | "use strict"; 11 | 12 | // Localise Globals 13 | var 14 | History = window.History = window.History||{}, 15 | Ext = window.Ext; 16 | 17 | window.JSON = { 18 | stringify: Ext.JSON.encode, 19 | parse: Ext.JSON.decode 20 | }; 21 | 22 | // Check Existence 23 | if ( typeof History.Adapter !== 'undefined' ) { 24 | throw new Error('History.js Adapter has already been loaded...'); 25 | } 26 | 27 | // Add the Adapter 28 | History.Adapter = { 29 | observables: {}, 30 | 31 | /** 32 | * History.Adapter.bind(el,event,callback) 33 | * @param {Element|string} el 34 | * @param {string} event - custom and standard events 35 | * @param {function} callback 36 | * @param {Object} scope 37 | * @return {void} 38 | */ 39 | bind: function(element,eventName,callback,scope){ 40 | Ext.EventManager.addListener(element, eventName, callback, scope); 41 | 42 | //bind an observable to the element that will let us "trigger" events on it 43 | var id = Ext.id(element, 'history-'), observable = this.observables[id]; 44 | if (!observable) { 45 | observable = Ext.create('Ext.util.Observable'); 46 | this.observables[id] = observable; 47 | } 48 | observable.on(eventName, callback, scope); 49 | }, 50 | 51 | /** 52 | * History.Adapter.trigger(el,event) 53 | * @param {Element|string} el 54 | * @param {string} event - custom and standard events 55 | * @param {Object=} extra - a object of extra event data (optional) 56 | * @return {void} 57 | */ 58 | trigger: function(element,eventName,extra){ 59 | var id = Ext.id(element, 'history-'), observable = this.observables[id]; 60 | if (observable) { 61 | observable.fireEvent(eventName, extra); 62 | } 63 | }, 64 | 65 | /** 66 | * History.Adapter.extractEventData(key,event,extra) 67 | * @param {string} key - key for the event data to extract 68 | * @param {string} event - custom and standard events 69 | * @param {Object=} extra - a object of extra event data (optional) 70 | * @return {mixed} 71 | */ 72 | extractEventData: function(key,event,extra){ 73 | var result = (event && event.browserEvent && event.browserEvent[key]) || (extra && extra[key]) || undefined; 74 | return result; 75 | }, 76 | 77 | /** 78 | * History.Adapter.onDomLoad(callback) 79 | * @param {function} callback 80 | * @return {void} 81 | */ 82 | onDomLoad: function(callback) { 83 | Ext.onReady(callback); 84 | } 85 | }; 86 | 87 | // Try and Initialise History 88 | if ( typeof History.init !== 'undefined' ) { 89 | History.init(); 90 | } 91 | 92 | })(window); -------------------------------------------------------------------------------- /bower_components/history.js/scripts/uncompressed/history.adapter.jquery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * History.js jQuery Adapter 3 | * @author Benjamin Arthur Lupton 4 | * @copyright 2010-2011 Benjamin Arthur Lupton 5 | * @license New BSD License 6 | */ 7 | 8 | // Closure 9 | (function(window,undefined){ 10 | "use strict"; 11 | 12 | // Localise Globals 13 | var 14 | History = window.History = window.History||{}, 15 | jQuery = window.jQuery; 16 | 17 | // Check Existence 18 | if ( typeof History.Adapter !== 'undefined' ) { 19 | throw new Error('History.js Adapter has already been loaded...'); 20 | } 21 | 22 | // Add the Adapter 23 | History.Adapter = { 24 | /** 25 | * History.Adapter.bind(el,event,callback) 26 | * @param {Element|string} el 27 | * @param {string} event - custom and standard events 28 | * @param {function} callback 29 | * @return {void} 30 | */ 31 | bind: function(el,event,callback){ 32 | jQuery(el).bind(event,callback); 33 | }, 34 | 35 | /** 36 | * History.Adapter.trigger(el,event) 37 | * @param {Element|string} el 38 | * @param {string} event - custom and standard events 39 | * @param {Object=} extra - a object of extra event data (optional) 40 | * @return {void} 41 | */ 42 | trigger: function(el,event,extra){ 43 | jQuery(el).trigger(event,extra); 44 | }, 45 | 46 | /** 47 | * History.Adapter.extractEventData(key,event,extra) 48 | * @param {string} key - key for the event data to extract 49 | * @param {string} event - custom and standard events 50 | * @param {Object=} extra - a object of extra event data (optional) 51 | * @return {mixed} 52 | */ 53 | extractEventData: function(key,event,extra){ 54 | // jQuery Native then jQuery Custom 55 | var result = (event && event.originalEvent && event.originalEvent[key]) || (extra && extra[key]) || undefined; 56 | 57 | // Return 58 | return result; 59 | }, 60 | 61 | /** 62 | * History.Adapter.onDomLoad(callback) 63 | * @param {function} callback 64 | * @return {void} 65 | */ 66 | onDomLoad: function(callback) { 67 | jQuery(callback); 68 | } 69 | }; 70 | 71 | // Try and Initialise History 72 | if ( typeof History.init !== 'undefined' ) { 73 | History.init(); 74 | } 75 | 76 | })(window); 77 | 78 | -------------------------------------------------------------------------------- /bower_components/history.js/scripts/uncompressed/history.adapter.mootools.js: -------------------------------------------------------------------------------- 1 | /** 2 | * History.js MooTools Adapter 3 | * @author Benjamin Arthur Lupton 4 | * @copyright 2010-2011 Benjamin Arthur Lupton 5 | * @license New BSD License 6 | */ 7 | 8 | // Closure 9 | (function(window,undefined){ 10 | "use strict"; 11 | 12 | // Localise Globals 13 | var 14 | History = window.History = window.History||{}, 15 | MooTools = window.MooTools, 16 | Element = window.Element; 17 | 18 | // Check Existence 19 | if ( typeof History.Adapter !== 'undefined' ) { 20 | throw new Error('History.js Adapter has already been loaded...'); 21 | } 22 | 23 | // Make MooTools aware of History.js Events 24 | Object.append(Element.NativeEvents,{ 25 | 'popstate':2, 26 | 'hashchange':2 27 | }); 28 | 29 | // Add the Adapter 30 | History.Adapter = { 31 | /** 32 | * History.Adapter.bind(el,event,callback) 33 | * @param {Element|string} el 34 | * @param {string} event - custom and standard events 35 | * @param {function} callback 36 | * @return {void} 37 | */ 38 | bind: function(el,event,callback){ 39 | var El = typeof el === 'string' ? document.id(el) : el; 40 | El.addEvent(event,callback); 41 | }, 42 | 43 | /** 44 | * History.Adapter.trigger(el,event) 45 | * @param {Element|string} el 46 | * @param {string} event - custom and standard events 47 | * @param {Object=} extra - a object of extra event data (optional) 48 | * @return void 49 | */ 50 | trigger: function(el,event,extra){ 51 | var El = typeof el === 'string' ? document.id(el) : el; 52 | El.fireEvent(event,extra); 53 | }, 54 | 55 | /** 56 | * History.Adapter.extractEventData(key,event,extra) 57 | * @param {string} key - key for the event data to extract 58 | * @param {string} event - custom and standard events 59 | * @return {mixed} 60 | */ 61 | extractEventData: function(key,event){ 62 | // MooTools Native then MooTools Custom 63 | var result = (event && event.event && event.event[key]) || (event && event[key]) || undefined; 64 | 65 | // Return 66 | return result; 67 | }, 68 | 69 | /** 70 | * History.Adapter.onDomLoad(callback) 71 | * @param {function} callback 72 | * @return {void} 73 | */ 74 | onDomLoad: function(callback) { 75 | window.addEvent('domready',callback); 76 | } 77 | }; 78 | 79 | // Try and Initialise History 80 | if ( typeof History.init !== 'undefined' ) { 81 | History.init(); 82 | } 83 | 84 | })(window); 85 | -------------------------------------------------------------------------------- /bower_components/history.js/scripts/uncompressed/history.adapter.native.js: -------------------------------------------------------------------------------- 1 | /** 2 | * History.js Native Adapter 3 | * @author Benjamin Arthur Lupton 4 | * @copyright 2010-2011 Benjamin Arthur Lupton 5 | * @license New BSD License 6 | */ 7 | 8 | // Closure 9 | (function(window,undefined){ 10 | "use strict"; 11 | 12 | // Localise Globals 13 | var History = window.History = window.History||{}; 14 | 15 | // Check Existence 16 | if ( typeof History.Adapter !== 'undefined' ) { 17 | throw new Error('History.js Adapter has already been loaded...'); 18 | } 19 | 20 | // Add the Adapter 21 | History.Adapter = { 22 | /** 23 | * History.Adapter.handlers[uid][eventName] = Array 24 | */ 25 | handlers: {}, 26 | 27 | /** 28 | * History.Adapter._uid 29 | * The current element unique identifier 30 | */ 31 | _uid: 1, 32 | 33 | /** 34 | * History.Adapter.uid(element) 35 | * @param {Element} element 36 | * @return {String} uid 37 | */ 38 | uid: function(element){ 39 | return element._uid || (element._uid = History.Adapter._uid++); 40 | }, 41 | 42 | /** 43 | * History.Adapter.bind(el,event,callback) 44 | * @param {Element} element 45 | * @param {String} eventName - custom and standard events 46 | * @param {Function} callback 47 | * @return 48 | */ 49 | bind: function(element,eventName,callback){ 50 | // Prepare 51 | var uid = History.Adapter.uid(element); 52 | 53 | // Apply Listener 54 | History.Adapter.handlers[uid] = History.Adapter.handlers[uid] || {}; 55 | History.Adapter.handlers[uid][eventName] = History.Adapter.handlers[uid][eventName] || []; 56 | History.Adapter.handlers[uid][eventName].push(callback); 57 | 58 | // Bind Global Listener 59 | element['on'+eventName] = (function(element,eventName){ 60 | return function(event){ 61 | History.Adapter.trigger(element,eventName,event); 62 | }; 63 | })(element,eventName); 64 | }, 65 | 66 | /** 67 | * History.Adapter.trigger(el,event) 68 | * @param {Element} element 69 | * @param {String} eventName - custom and standard events 70 | * @param {Object} event - a object of event data 71 | * @return 72 | */ 73 | trigger: function(element,eventName,event){ 74 | // Prepare 75 | event = event || {}; 76 | var uid = History.Adapter.uid(element), 77 | i,n; 78 | 79 | // Apply Listener 80 | History.Adapter.handlers[uid] = History.Adapter.handlers[uid] || {}; 81 | History.Adapter.handlers[uid][eventName] = History.Adapter.handlers[uid][eventName] || []; 82 | 83 | // Fire Listeners 84 | for ( i=0,n=History.Adapter.handlers[uid][eventName].length; i 4 | * @copyright 2010-2011 Benjamin Arthur Lupton 5 | * @license New BSD License 6 | */ 7 | 8 | // Closure 9 | (function(window,undefined){ 10 | "use strict"; 11 | 12 | // Localise Globals 13 | var 14 | History = window.History = window.History||{}, 15 | document = window.document, 16 | RightJS = window.RightJS, 17 | $ = RightJS.$; 18 | 19 | // Check Existence 20 | if ( typeof History.Adapter !== 'undefined' ) { 21 | throw new Error('History.js Adapter has already been loaded...'); 22 | } 23 | 24 | // Add the Adapter 25 | History.Adapter = { 26 | /** 27 | * History.Adapter.bind(el,event,callback) 28 | * @param {Element|Selector} el 29 | * @param {String} event - custom and standard events 30 | * @param {Function} callback 31 | * @return 32 | */ 33 | bind: function(el,event,callback){ 34 | $(el).on(event,callback); 35 | }, 36 | 37 | /** 38 | * History.Adapter.trigger(el,event) 39 | * @param {Element|Selector} el 40 | * @param {String} event - custom and standard events 41 | * @param {Object} extraEventData - a object of extra event data 42 | * @return 43 | */ 44 | trigger: function(el,event,extraEventData){ 45 | $(el).fire(event,extraEventData); 46 | }, 47 | 48 | /** 49 | * History.Adapter.extractEventData(key,event,extra) 50 | * @param {String} key - key for the event data to extract 51 | * @param {String} event - custom and standard events 52 | * @return {mixed} 53 | */ 54 | extractEventData: function(key,event){ 55 | // Right.js Native 56 | // Right.js Custom 57 | var result = (event && event._ && event._[key]) || undefined; 58 | 59 | // Return 60 | return result; 61 | }, 62 | 63 | /** 64 | * History.Adapter.onDomLoad(callback) 65 | * @param {Function} callback 66 | * @return 67 | */ 68 | onDomLoad: function(callback) { 69 | $(document).onReady(callback); 70 | } 71 | }; 72 | 73 | // Try and Initialise History 74 | if ( typeof History.init !== 'undefined' ) { 75 | History.init(); 76 | } 77 | 78 | })(window); 79 | -------------------------------------------------------------------------------- /bower_components/history.js/scripts/uncompressed/history.adapter.zepto.js: -------------------------------------------------------------------------------- 1 | /** 2 | * History.js Zepto Adapter 3 | * @author Benjamin Arthur Lupton 4 | * @copyright 2010-2011 Benjamin Arthur Lupton 5 | * @license New BSD License 6 | */ 7 | 8 | // Closure 9 | (function(window,undefined){ 10 | "use strict"; 11 | 12 | // Localise Globals 13 | var 14 | History = window.History = window.History||{}, 15 | Zepto = window.Zepto; 16 | 17 | // Check Existence 18 | if ( typeof History.Adapter !== 'undefined' ) { 19 | throw new Error('History.js Adapter has already been loaded...'); 20 | } 21 | 22 | // Add the Adapter 23 | History.Adapter = { 24 | /** 25 | * History.Adapter.bind(el,event,callback) 26 | * @param {Element|string} el 27 | * @param {string} event - custom and standard events 28 | * @param {function} callback 29 | * @return {void} 30 | */ 31 | bind: function(el,event,callback){ 32 | new Zepto(el).bind(event,callback); 33 | }, 34 | 35 | /** 36 | * History.Adapter.trigger(el,event) 37 | * @param {Element|string} el 38 | * @param {string} event - custom and standard events 39 | * @return {void} 40 | */ 41 | trigger: function(el,event){ 42 | new Zepto(el).trigger(event); 43 | }, 44 | 45 | /** 46 | * History.Adapter.extractEventData(key,event,extra) 47 | * @param {string} key - key for the event data to extract 48 | * @param {string} event - custom and standard events 49 | * @return {mixed} 50 | */ 51 | extractEventData: function(key,event){ 52 | // Zepto Native 53 | var result = (event && event[key]) || undefined; 54 | 55 | // Return 56 | return result; 57 | }, 58 | 59 | /** 60 | * History.Adapter.onDomLoad(callback) 61 | * @param {function} callback 62 | * @return {void} 63 | */ 64 | onDomLoad: function(callback) { 65 | new Zepto(callback); 66 | } 67 | }; 68 | 69 | // Try and Initialise History 70 | if ( typeof History.init !== 'undefined' ) { 71 | History.init(); 72 | } 73 | 74 | })(window); 75 | -------------------------------------------------------------------------------- /bower_components/history.js/tests.src/_header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | History.js Test Suite 5 | 19 | 20 | 21 |

History.js Test Suite

22 |

HTML5 Browsers must pass the HTML4+HTML5 tests

23 |

HTML4 Browsers must pass the HTML4 tests and should fail the HTML5 tests

24 | '; 27 | foreach ( $adapters as $adapter ) : 28 | echo '
'; 29 | # Url 30 | $url = "${browser}.${adapter}.html"; 31 | 32 | # Title 33 | $Browser = ucwords($browser); 34 | $Adapter = ucwords($adapter); 35 | $title = "History.js ${Browser} ${Adapter} Test Suite"; 36 | 37 | # Render 38 | ?>'; 40 | endforeach; 41 | echo '
'; 42 | endforeach; 43 | ?> 44 | 45 | 46 | -------------------------------------------------------------------------------- /bower_components/history.js/tests.src/each.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | <?=$title?> 17 | 18 | 19 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |

37 |

38 |
39 |

40 |
    41 |
    test markup
    42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /bower_components/history.js/tests.src/index.php: -------------------------------------------------------------------------------- 1 | Tests 24 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/.htaccess: -------------------------------------------------------------------------------- 1 | Options +FollowSymlinks 2 | RewriteEngine On 3 | 4 | # Clean Adapter 5 | RewriteCond %{REQUEST_FILENAME} !-f 6 | RewriteCond %{REQUEST_FILENAME} !-d 7 | RewriteRule ([^\.]+)$ $1.html [NC,L,QSA] 8 | 9 | # Can someone smarter than me make it so: 10 | # http://localhost/history.js/tests/uncompressed-html5-persistant-jquery 11 | # Does not redirect to: 12 | # http://localhost/history.js/tests/uncompressed-html5-persistant-jquery.html 13 | # But still accesses that url 14 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html4+html5.dojo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML4+HTML5 Dojo Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30 |

    History.js HTML4+HTML5 Dojo Test Suite

    31 |

    32 |
    33 |

    34 |
      35 |
      test markup
      36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 49 | 50 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html4+html5.extjs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML4+HTML5 ExtJS Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30 |

      History.js HTML4+HTML5 ExtJS Test Suite

      31 |

      32 |
      33 |

      34 |
        35 |
        test markup
        36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 49 | 50 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html4+html5.jquery.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML4+HTML5 Jquery Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

        History.js HTML4+HTML5 Jquery Test Suite

        29 |

        30 |
        31 |

        32 |
          33 |
          test markup
          34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html4+html5.mootools.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML4+HTML5 Mootools Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

          History.js HTML4+HTML5 Mootools Test Suite

          29 |

          30 |
          31 |

          32 |
            33 |
            test markup
            34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html4+html5.native.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML4+HTML5 Native Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

            History.js HTML4+HTML5 Native Test Suite

            29 |

            30 |
            31 |

            32 |
              33 |
              test markup
              34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html4+html5.right.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML4+HTML5 Right Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

              History.js HTML4+HTML5 Right Test Suite

              29 |

              30 |
              31 |

              32 |
                33 |
                test markup
                34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html4+html5.zepto.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML4+HTML5 Zepto Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

                History.js HTML4+HTML5 Zepto Test Suite

                29 |

                30 |
                31 |

                32 |
                  33 |
                  test markup
                  34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html5.dojo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML5 Dojo Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

                  History.js HTML5 Dojo Test Suite

                  29 |

                  30 |
                  31 |

                  32 |
                    33 |
                    test markup
                    34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html5.extjs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML5 ExtJS Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

                    History.js HTML5 ExtJS Test Suite

                    29 |

                    30 |
                    31 |

                    32 |
                      33 |
                      test markup
                      34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html5.jquery.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML5 Jquery Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

                      History.js HTML5 Jquery Test Suite

                      29 |

                      30 |
                      31 |

                      32 |
                        33 |
                        test markup
                        34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html5.mootools.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML5 Mootools Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

                        History.js HTML5 Mootools Test Suite

                        29 |

                        30 |
                        31 |

                        32 |
                          33 |
                          test markup
                          34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html5.native.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML5 Native Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

                          History.js HTML5 Native Test Suite

                          29 |

                          30 |
                          31 |

                          32 |
                            33 |
                            test markup
                            34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html5.right.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML5 Right Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

                            History.js HTML5 Right Test Suite

                            29 |

                            30 |
                            31 |

                            32 |
                              33 |
                              test markup
                              34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/html5.zepto.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | History.js HTML5 Zepto Test Suite 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

                              History.js HTML5 Zepto Test Suite

                              29 |

                              30 |
                              31 |

                              32 |
                                33 |
                                test markup
                                34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/image.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | History.js Test Suite 5 | 21 | 22 | 23 |

                                History.js Test Suite

                                24 |

                                HTML5 Browsers must pass the HTML4+HTML5 tests, HTML4 Browsers must pass the HTML4 tests and should fail the HTML5 tests.

                                25 | 26 |
                                27 |

                                HTML 4+5

                                28 | 29 | 30 | 31 | 32 | 33 | 34 |
                                Zepto Test Suite (Zepto doesn't support IE)
                                35 |
                                36 |
                                37 |

                                HTML 5

                                38 | 39 | 40 | 41 | 42 | 43 | 44 |
                                Zepto Test Suite (Zepto doesn't support IE)
                                45 |
                                46 | 47 | 48 | -------------------------------------------------------------------------------- /bower_components/history.js/tests/tests.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 3 | var 4 | History = window.History, 5 | document = window.document, 6 | test = window.test, 7 | deepEqual = window.deepEqual; 8 | 9 | // Check 10 | if ( !History.enabled ) { 11 | throw new Error('History.js is disabled'); 12 | } 13 | 14 | // Prepare 15 | History.options.debug = false; 16 | 17 | // Variables 18 | var 19 | States = { 20 | // Home 21 | 0: { 22 | 'url': document.location.href.replace(/#.*$/,''), 23 | 'title': '' 24 | }, 25 | // One 26 | 1: { 27 | 'data': { 28 | 'state': 1, 29 | 'rand': Math.random() 30 | }, 31 | 'title': 'State 1', 32 | 'url': '?state=1' 33 | }, 34 | // Two 35 | 2: { 36 | 'data': { 37 | 'state': 2, 38 | 'rand': Math.random() 39 | }, 40 | 'title': 'State 2', 41 | 'url': '?state=2&asd=%20asd%2520asd' 42 | }, 43 | // Three 44 | 3: { 45 | 'url': '?state=3' 46 | }, 47 | // Four 48 | 4: { 49 | 'data': { 50 | 'state': 4, 51 | 'trick': true, 52 | 'rand': Math.random() 53 | }, 54 | 'title': 'State 4', 55 | 'url': '?state=3' 56 | }, 57 | // Log 58 | 5: { 59 | 'url': '?state=1#log' 60 | }, 61 | // Six 62 | 6: { 63 | 'data': { 64 | 'state': 6, 65 | 'rand': Math.random() 66 | }, 67 | 'url': 'six.html' 68 | }, 69 | // Seven 70 | 7: { 71 | 'url': 'seven' 72 | }, 73 | // Eight 74 | 8: { 75 | 'url': '/eight' 76 | } 77 | }, 78 | stateOrder = [0,1,2,3,4,3,1,0,1,3,4,3,1,0,6,7,8,1,8,7,6,0], 79 | currentTest = 0; 80 | 81 | // Original Title 82 | var title = document.title; 83 | 84 | var banner; 85 | 86 | var checkStatus = function(){ 87 | banner = banner || document.getElementById('qunit-banner'); 88 | var status = banner.className !== 'qunit-fail'; 89 | return status; 90 | }; 91 | 92 | // Check State 93 | var checkState = function(){ 94 | if ( !checkStatus() ) { 95 | throw new Error('A test has failed'); 96 | } 97 | 98 | var 99 | stateIndex = stateOrder[currentTest], 100 | expectedState = History.normalizeState(States[stateIndex]), 101 | actualState = History.getState(false); 102 | 103 | ++currentTest; 104 | 105 | document.title = title+': '+actualState.url; 106 | 107 | var 108 | testName = 'Test '+currentTest, 109 | stateName = 'State '+stateIndex; 110 | 111 | test(testName,function(){ 112 | History.log('Completed: '+testName +' / '+ stateName); 113 | deepEqual(actualState,expectedState,stateName); 114 | }); 115 | 116 | // Image Load to Stress Test Safari and Opera 117 | (new Image()).src = "image.php"; 118 | }; 119 | 120 | // Check the Initial State 121 | checkState(); 122 | 123 | // State Change 124 | History.Adapter.bind(window,'statechange',checkState); 125 | 126 | // Log 127 | var addLog = function(){ 128 | var args = arguments; 129 | History.queue(function(){ 130 | History.log.apply(History,args); 131 | }); 132 | }; 133 | 134 | // Dom Load 135 | History.Adapter.onDomLoad(function(){ 136 | setTimeout(function(){ 137 | 138 | // ---------------------------------------------------------------------- 139 | // Test State Functionality: Adding 140 | 141 | // Test 2 / State 1 (0 -> 1) 142 | // Tests HTML4 -> HTML5 Graceful Upgrade 143 | addLog('Test 2',History.queues.length,History.busy.flag); 144 | History.setHash(History.getHashByState(States[1])); 145 | 146 | // Test 3 / State 2 (1 -> 2) 147 | addLog('Test 3',History.queues.length,History.busy.flag); 148 | History.pushState(States[2].data, States[2].title, States[2].url); 149 | 150 | // Test 3-2 / State 2 (2 -> 2) / No Change 151 | addLog('Test 3-2',History.queues.length,History.busy.flag); 152 | History.pushState(States[2].data, States[2].title, States[2].url); 153 | 154 | // Test 3-3 / State 2 (2 -> 2) / No Change 155 | addLog('Test 3-3',History.queues.length,History.busy.flag); 156 | History.replaceState(States[2].data, States[2].title, States[2].url); 157 | 158 | // Test 4 / State 3 (2 -> 3) 159 | addLog('Test 4',History.queues.length,History.busy.flag); 160 | History.replaceState(States[3].data, States[3].title, States[3].url); 161 | 162 | // Test 5 / State 4 (3 -> 4) 163 | addLog('Test 5',History.queues.length,History.busy.flag); 164 | History.pushState(States[4].data, States[4].title, States[4].url); 165 | 166 | // ---------------------------------------------------------------------- 167 | // Test State Functionality: Traversing 168 | 169 | // Test 6 / State 3 (4 -> 3) 170 | // Test 7 / State 1 (3 -> 2 -> 1) 171 | addLog('Test 6,7',History.queues.length,History.busy.flag); 172 | History.go(-2); 173 | 174 | // Test 8 / State 0 (1 -> 0) 175 | // Tests Default State 176 | addLog('Test 8',History.queues.length,History.busy.flag); 177 | History.back(); 178 | 179 | // Test 9 / State 1 (0 -> 1) 180 | // Test 10 / State 3 (1 -> 2 -> 3) 181 | addLog('Test 9,10',History.queues.length,History.busy.flag); 182 | History.go(2); 183 | 184 | // Test 11 / State 4 (3 -> 4) 185 | addLog('Test 11',History.queues.length,History.busy.flag); 186 | History.forward(); 187 | 188 | // Test 12 / State 3 (4 -> 3) 189 | addLog('Test 12',History.queues.length,History.busy.flag); 190 | History.back(); 191 | 192 | // Test 13 / State 1 (3 -> 2 -> 1) 193 | addLog('Test 13',History.queues.length,History.busy.flag); 194 | History.back(); 195 | 196 | // ---------------------------------------------------------------------- 197 | // Test State Functionality: Traditional Anchors 198 | 199 | // Test 13-2 / State 1 (1 -> #log) / No Change 200 | addLog('Test 13-2',History.queues.length,History.busy.flag); 201 | History.setHash('log'); 202 | 203 | // Test 13-3 / State 1 (#log -> 1) / No Change 204 | addLog('Test 13-3',History.queues.length,History.busy.flag); 205 | History.back(); 206 | 207 | // Test 14 / State 0 (1 -> 0) 208 | addLog('Test 14',History.queues.length,History.busy.flag); 209 | History.back(); 210 | 211 | // ---------------------------------------------------------------------- 212 | // Test URL Handling: Adding 213 | 214 | // Test 15 / State 6 (1 -> 6) 215 | // Also tests data with no title 216 | addLog('Test 15',History.queues.length,History.busy.flag); 217 | History.pushState(States[6].data, States[6].title, States[6].url); 218 | 219 | // Test 16 / State 7 (6 -> 7) 220 | addLog('Test 16',History.queues.length,History.busy.flag); 221 | History.pushState(States[7].data, States[7].title, States[7].url); 222 | 223 | // Test 17 / State 7 (7 -> 8) 224 | addLog('Test 17',History.queues.length,History.busy.flag); 225 | History.pushState(States[8].data, States[8].title, States[8].url); 226 | 227 | // Test 18 / State 1 (8 -> 1) 228 | // Should be /eight?state=1 229 | addLog('Test 18',History.queues.length,History.busy.flag); 230 | History.pushState(States[1].data, States[1].title, States[1].url); 231 | 232 | // ---------------------------------------------------------------------- 233 | // Test URL Handling: Traversing 234 | 235 | // Test 19 / State 8 (1 -> 8) 236 | addLog('Test 19',History.queues.length,History.busy.flag); 237 | History.back(); 238 | 239 | // Test 20 / State 7 (8 -> 7) 240 | addLog('Test 20',History.queues.length,History.busy.flag); 241 | History.back(); 242 | 243 | // Test 21 / State 6 (7 -> 6) 244 | addLog('Test 21',History.queues.length,History.busy.flag); 245 | History.back(); 246 | 247 | // Test 22 / State 0 (6 -> 0) 248 | addLog('Test 22',History.queues.length,History.busy.flag); 249 | History.back(); 250 | 251 | },1000); // wait for test one to complete 252 | }); 253 | 254 | })(); 255 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | *~ 3 | *.diff 4 | *.patch 5 | .DS_Store 6 | .settings 7 | node_modules 8 | dist/ 9 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/AUTHORS.txt: -------------------------------------------------------------------------------- 1 | Jörn Zaefferer 2 | Ariel Flesler 3 | Scott González 4 | Richard Worth 5 | Philippe Rathé 6 | John Resig 7 | Will Moffat 8 | Jan Kassens 9 | Ziling Zhao 10 | Ryan Szulczewski 11 | Chris Lloyd 12 | Louis-Rémi Babé 13 | Jake Archibald 14 | Frances Berriman 15 | Rune Halvorsen 16 | Chris Thatcher 17 | Fábio Rehm 18 | Leon Sorokin 19 | Douglas Neiner 20 | Paul Elliott 21 | Nikita Vasilyev 22 | Benjamin Lee 23 | Paul Irish 24 | Oleg Slobodskoi 25 | Anton Matzneller 26 | Aurélien Bombo 27 | Mathias Bynens 28 | Erik Vold 29 | Wesley Walser 30 | Rob Kinninmont 31 | Marc Portier 32 | Michael Righi 33 | Timo Tijhof 34 | Jan Alonzo 35 | Daniel Trebbien 36 | Bob Fanger 37 | Markus Messner-Chaney 38 | Trevor Parscal 39 | Ashar Voultoiz 40 | Jimmy Mabey 41 | Domenic Denicola 42 | Mike Sherov 43 | Seong-A Kong 44 | Graham Conzett 45 | Niall Smart 46 | Johan Sörlin 47 | Gijs Kruitbosch 48 | Erkan Yilmaz 49 | Jonathan Sanchez 50 | Keith Cirkel 51 | Rick Waldron 52 | Herbert Vojčík 53 | Richard Gibson 54 | Alex J Burke 55 | Sergii Kliuchnyk 56 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/README.md: -------------------------------------------------------------------------------- 1 | [QUnit](http://qunitjs.com) - A JavaScript Unit Testing Framework. 2 | ================================ 3 | 4 | QUnit is a powerful, easy-to-use, JavaScript unit testing framework. It's used by the jQuery 5 | project to test its code and plugins but is capable of testing any generic 6 | JavaScript code (and even capable of testing JavaScript code on the server-side). 7 | 8 | QUnit is especially useful for regression testing: Whenever a bug is reported, 9 | write a test that asserts the existence of that particular bug. Then fix it and 10 | commit both. Every time you work on the code again, run the tests. If the bug 11 | comes up again - a regression - you'll spot it immediately and know how to fix 12 | it, because you know what code you just changed. 13 | 14 | Having good unit test coverage makes safe refactoring easy and cheap. You can 15 | run the tests after each small refactoring step and always know what change 16 | broke something. 17 | 18 | QUnit is similar to other unit testing frameworks like JUnit, but makes use of 19 | the features JavaScript provides and helps with testing code in the browser, e.g. 20 | with its stop/start facilities for testing asynchronous code. 21 | 22 | If you are interested in helping developing QUnit, you are in the right place. 23 | For related discussions, visit the 24 | [QUnit and Testing forum](http://forum.jquery.com/qunit-and-testing). 25 | 26 | Development 27 | ----------- 28 | 29 | To submit patches, fork the repository, create a branch for the change. Then implement 30 | the change, run `grunt` to lint and test it, then commit, push and create a pull request. 31 | 32 | Include some background for the change in the commit message and `Fixes #nnn`, referring 33 | to the issue number you're addressing. 34 | 35 | To run `grunt`, you need `node` and `npm`, then `npm install grunt -g`. That gives you a global 36 | grunt binary. For additional grunt tasks, also run `npm install`. 37 | 38 | Releases 39 | -------- 40 | 41 | Install git-extras and run `git changelog` to update History.md. Clean up the 42 | changelog, removing merge commits or whitespace cleanups. 43 | 44 | Update qunit/qunit.js|css and package.json to the release version, commit and 45 | tag (Put the 'v' in front of the tag, e.g. `v1.8.0`), update them again to 46 | the next version, commit and push commits and tags: 47 | 48 | git push --tags origin master 49 | 50 | To upload to code.jquery.com (replace $version accordingly), ssh to code.origin.jquery.com: 51 | 52 | cp qunit/qunit.js /var/www/html/code.jquery.com/qunit/qunit-$version.js 53 | cp qunit/qunit.css /var/www/html/code.jquery.com/qunit/qunit-$version.css 54 | 55 | Then update /var/www/html/code.jquery.com/index.html and purge it with: 56 | 57 | curl -s http://code.origin.jquery.com/?reload 58 | 59 | Update web-base-template to link to those files for qunitjs.com. 60 | 61 | Publish to npm via 62 | 63 | npm publish 64 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/grunt.js: -------------------------------------------------------------------------------- 1 | /*global config:true, task:true*/ 2 | module.exports = function( grunt ) { 3 | 4 | grunt.loadNpmTasks( "grunt-git-authors" ); 5 | 6 | grunt.initConfig({ 7 | pkg: '', 8 | qunit: { 9 | qunit: [ 10 | 'test/index.html', 11 | 'test/async.html' 12 | // TODO figure out why this fails on our Jenkins server (Linux) 13 | // 'test/logs.html' 14 | ], 15 | addons: [ 16 | 'addons/canvas/canvas.html', 17 | 'addons/close-enough/close-enough.html', 18 | 'addons/composite/composite-demo-test.html' 19 | // TODO same as above 20 | // 'addons/step/step.html' 21 | ] 22 | }, 23 | lint: { 24 | qunit: 'qunit/qunit.js', 25 | addons: 'addons/**.js', 26 | tests: 'test/**.js', 27 | grunt: 'grunt.js' 28 | }, 29 | // TODO remove this once grunt 0.4 is out, see jquery-ui for other details 30 | jshint: (function() { 31 | function parserc( path ) { 32 | var rc = grunt.file.readJSON( (path || "") + ".jshintrc" ), 33 | settings = { 34 | options: rc, 35 | globals: {} 36 | }; 37 | 38 | (rc.predef || []).forEach(function( prop ) { 39 | settings.globals[ prop ] = true; 40 | }); 41 | delete rc.predef; 42 | 43 | return settings; 44 | } 45 | 46 | return { 47 | qunit: parserc( "qunit/" ), 48 | addons: parserc( "addons/" ), 49 | tests: parserc( "test/" ) 50 | }; 51 | })() 52 | }); 53 | 54 | grunt.registerTask( "build-git", function( sha ) { 55 | function processor( content ) { 56 | var tagline = " - A JavaScript Unit Testing Framework"; 57 | return content.replace( tagline, "-" + sha + " " + grunt.template.today('isoDate') + tagline ); 58 | } 59 | grunt.file.copy( "qunit/qunit.css", "dist/qunit-git.css", { 60 | process: processor 61 | }); 62 | grunt.file.copy( "qunit/qunit.js", "dist/qunit-git.js", { 63 | process: processor 64 | }); 65 | }); 66 | 67 | grunt.registerTask( "testswarm", function( commit, configFile ) { 68 | var testswarm = require( "testswarm" ), 69 | config = grunt.file.readJSON( configFile ).qunit, 70 | runs = {}, 71 | done = this.async(); 72 | ["index", "async"].forEach(function (suite) { 73 | runs[suite] = config.testUrl + commit + "/test/" + suite + ".html"; 74 | }); 75 | testswarm.createClient( { 76 | url: config.swarmUrl, 77 | pollInterval: 10000, 78 | timeout: 1000 * 60 * 30 79 | } ) 80 | .addReporter( testswarm.reporters.cli ) 81 | .auth( { 82 | id: config.authUsername, 83 | token: config.authToken 84 | } ) 85 | .addjob( 86 | { 87 | name: 'QUnit commit #' + commit.substr( 0, 10 ) + '', 88 | runs: runs, 89 | browserSets: config.browserSets 90 | }, function( err, passed ) { 91 | if ( err ) { 92 | grunt.log.error( err ); 93 | } 94 | done( passed ); 95 | } 96 | ); 97 | }); 98 | 99 | grunt.registerTask('default', 'lint qunit'); 100 | 101 | }; 102 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qunitjs", 3 | "title": "QUnit", 4 | "description": "An easy-to-use JavaScript Unit Testing framework.", 5 | "version": "1.12.0pre", 6 | "author": { 7 | "name": "jQuery Foundation and other contributors", 8 | "url": "https://github.com/jquery/qunit/blob/master/AUTHORS.txt" 9 | }, 10 | "contributors": [ 11 | "John Resig (http://ejohn.org/)", 12 | "Jörn Zaefferer (http://bassistance.de/)" 13 | ], 14 | "homepage": "http://qunitjs.com", 15 | "repository": { 16 | "type": "git", 17 | "url": "git://github.com/jquery/qunit.git" 18 | }, 19 | "bugs": { 20 | "url": "https://github.com/jquery/qunit/issues" 21 | }, 22 | "license": { 23 | "name": "MIT", 24 | "url": "http://www.opensource.org/licenses/mit-license.php" 25 | }, 26 | "keywords": [ 27 | "testing", 28 | "unit", 29 | "jquery" 30 | ], 31 | "main": "qunit/qunit.js", 32 | "devDependencies": { 33 | "grunt": "0.3.x", 34 | "grunt-git-authors": "1.0.0", 35 | "testswarm": "1.0.0-alpha" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/qunit/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "jQuery", 4 | "exports" 5 | ], 6 | 7 | "bitwise": true, 8 | "camelcase": false, 9 | "curly": true, 10 | "eqeqeq": true, 11 | "immed": true, 12 | "latedef": false, 13 | "newcap": true, 14 | "noarg": false, 15 | "noempty": true, 16 | "nonew": true, 17 | "undef": true, 18 | "unused": true, 19 | 20 | "proto": true, 21 | "smarttabs": true, 22 | "sub": true, 23 | "trailing": true, 24 | 25 | "browser": true, 26 | 27 | "onevar": true 28 | } 29 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/qunit/qunit.css: -------------------------------------------------------------------------------- 1 | /** 2 | * QUnit v1.12.0pre - A JavaScript Unit Testing Framework 3 | * 4 | * http://qunitjs.com 5 | * 6 | * Copyright 2012 jQuery Foundation and other contributors 7 | * Released under the MIT license. 8 | * http://jquery.org/license 9 | */ 10 | 11 | /** Font Family and Sizes */ 12 | 13 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { 14 | font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; 15 | } 16 | 17 | #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } 18 | #qunit-tests { font-size: smaller; } 19 | 20 | 21 | /** Resets */ 22 | 23 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { 24 | margin: 0; 25 | padding: 0; 26 | } 27 | 28 | 29 | /** Header */ 30 | 31 | #qunit-header { 32 | padding: 0.5em 0 0.5em 1em; 33 | 34 | color: #8699a4; 35 | background-color: #0d3349; 36 | 37 | font-size: 1.5em; 38 | line-height: 1em; 39 | font-weight: normal; 40 | 41 | border-radius: 5px 5px 0 0; 42 | -moz-border-radius: 5px 5px 0 0; 43 | -webkit-border-top-right-radius: 5px; 44 | -webkit-border-top-left-radius: 5px; 45 | } 46 | 47 | #qunit-header a { 48 | text-decoration: none; 49 | color: #c2ccd1; 50 | } 51 | 52 | #qunit-header a:hover, 53 | #qunit-header a:focus { 54 | color: #fff; 55 | } 56 | 57 | #qunit-testrunner-toolbar label { 58 | display: inline-block; 59 | padding: 0 .5em 0 .1em; 60 | } 61 | 62 | #qunit-banner { 63 | height: 5px; 64 | } 65 | 66 | #qunit-testrunner-toolbar { 67 | padding: 0.5em 0 0.5em 2em; 68 | color: #5E740B; 69 | background-color: #eee; 70 | overflow: hidden; 71 | } 72 | 73 | #qunit-userAgent { 74 | padding: 0.5em 0 0.5em 2.5em; 75 | background-color: #2b81af; 76 | color: #fff; 77 | text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; 78 | } 79 | 80 | #qunit-modulefilter-container { 81 | float: right; 82 | } 83 | 84 | /** Tests: Pass/Fail */ 85 | 86 | #qunit-tests { 87 | list-style-position: inside; 88 | } 89 | 90 | #qunit-tests li { 91 | padding: 0.4em 0.5em 0.4em 2.5em; 92 | border-bottom: 1px solid #fff; 93 | list-style-position: inside; 94 | } 95 | 96 | #qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { 97 | display: none; 98 | } 99 | 100 | #qunit-tests li strong { 101 | cursor: pointer; 102 | } 103 | 104 | #qunit-tests li a { 105 | padding: 0.5em; 106 | color: #c2ccd1; 107 | text-decoration: none; 108 | } 109 | #qunit-tests li a:hover, 110 | #qunit-tests li a:focus { 111 | color: #000; 112 | } 113 | 114 | #qunit-tests li .runtime { 115 | float: right; 116 | font-size: smaller; 117 | } 118 | 119 | .qunit-assert-list { 120 | margin-top: 0.5em; 121 | padding: 0.5em; 122 | 123 | background-color: #fff; 124 | 125 | border-radius: 5px; 126 | -moz-border-radius: 5px; 127 | -webkit-border-radius: 5px; 128 | } 129 | 130 | .qunit-collapsed { 131 | display: none; 132 | } 133 | 134 | #qunit-tests table { 135 | border-collapse: collapse; 136 | margin-top: .2em; 137 | } 138 | 139 | #qunit-tests th { 140 | text-align: right; 141 | vertical-align: top; 142 | padding: 0 .5em 0 0; 143 | } 144 | 145 | #qunit-tests td { 146 | vertical-align: top; 147 | } 148 | 149 | #qunit-tests pre { 150 | margin: 0; 151 | white-space: pre-wrap; 152 | word-wrap: break-word; 153 | } 154 | 155 | #qunit-tests del { 156 | background-color: #e0f2be; 157 | color: #374e0c; 158 | text-decoration: none; 159 | } 160 | 161 | #qunit-tests ins { 162 | background-color: #ffcaca; 163 | color: #500; 164 | text-decoration: none; 165 | } 166 | 167 | /*** Test Counts */ 168 | 169 | #qunit-tests b.counts { color: black; } 170 | #qunit-tests b.passed { color: #5E740B; } 171 | #qunit-tests b.failed { color: #710909; } 172 | 173 | #qunit-tests li li { 174 | padding: 5px; 175 | background-color: #fff; 176 | border-bottom: none; 177 | list-style-position: inside; 178 | } 179 | 180 | /*** Passing Styles */ 181 | 182 | #qunit-tests li li.pass { 183 | color: #3c510c; 184 | background-color: #fff; 185 | border-left: 10px solid #C6E746; 186 | } 187 | 188 | #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } 189 | #qunit-tests .pass .test-name { color: #366097; } 190 | 191 | #qunit-tests .pass .test-actual, 192 | #qunit-tests .pass .test-expected { color: #999999; } 193 | 194 | #qunit-banner.qunit-pass { background-color: #C6E746; } 195 | 196 | /*** Failing Styles */ 197 | 198 | #qunit-tests li li.fail { 199 | color: #710909; 200 | background-color: #fff; 201 | border-left: 10px solid #EE5757; 202 | white-space: pre; 203 | } 204 | 205 | #qunit-tests > li:last-child { 206 | border-radius: 0 0 5px 5px; 207 | -moz-border-radius: 0 0 5px 5px; 208 | -webkit-border-bottom-right-radius: 5px; 209 | -webkit-border-bottom-left-radius: 5px; 210 | } 211 | 212 | #qunit-tests .fail { color: #000000; background-color: #EE5757; } 213 | #qunit-tests .fail .test-name, 214 | #qunit-tests .fail .module-name { color: #000000; } 215 | 216 | #qunit-tests .fail .test-actual { color: #EE5757; } 217 | #qunit-tests .fail .test-expected { color: green; } 218 | 219 | #qunit-banner.qunit-fail { background-color: #EE5757; } 220 | 221 | 222 | /** Result */ 223 | 224 | #qunit-testresult { 225 | padding: 0.5em 0.5em 0.5em 2.5em; 226 | 227 | color: #2b81af; 228 | background-color: #D2E0E6; 229 | 230 | border-bottom: 1px solid white; 231 | } 232 | #qunit-testresult .module-name { 233 | font-weight: bold; 234 | } 235 | 236 | /** Fixture */ 237 | 238 | #qunit-fixture { 239 | position: absolute; 240 | top: -10000px; 241 | left: -10000px; 242 | width: 1000px; 243 | height: 1000px; 244 | } 245 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/test/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "QUnit" 4 | ], 5 | 6 | "smarttabs": true, 7 | 8 | "browser": true 9 | } 10 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/test/async.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QUnit Test Suite 6 | 7 | 8 | 9 |
                                10 |
                                test markup
                                11 | 12 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/test/async.js: -------------------------------------------------------------------------------- 1 | QUnit.start(); 2 | 3 | test("just a test", function() { 4 | expect(1); 5 | ok(true); 6 | }); 7 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/test/headless.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QUnit Test Suite 6 | 7 | 8 | 9 | 10 | 24 | 25 | 26 |
                                test markup
                                27 | 28 | 29 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QUnit Test Suite 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
                                14 |
                                test markup
                                15 | 16 | 17 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/test/logs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QUnit Test Suite 6 | 7 | 8 | 9 | 10 | 11 |
                                12 |
                                test markup
                                13 | 14 | 15 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/test/logs.js: -------------------------------------------------------------------------------- 1 | // TODO disable reordering for this suite! 2 | 3 | var begin = 0, 4 | moduleStart = 0, 5 | moduleDone = 0, 6 | testStart = 0, 7 | testDone = 0, 8 | log = 0, 9 | moduleContext, 10 | moduleDoneContext, 11 | testContext, 12 | testDoneContext, 13 | logContext; 14 | 15 | QUnit.begin(function() { 16 | begin++; 17 | }); 18 | QUnit.done(function() { 19 | }); 20 | QUnit.moduleStart(function(context) { 21 | moduleStart++; 22 | moduleContext = context; 23 | }); 24 | QUnit.moduleDone(function(context) { 25 | moduleDone++; 26 | moduleDoneContext = context; 27 | }); 28 | QUnit.testStart(function(context) { 29 | testStart++; 30 | testContext = context; 31 | }); 32 | QUnit.testDone(function(context) { 33 | testDone++; 34 | testDoneContext = context; 35 | }); 36 | QUnit.log(function(context) { 37 | log++; 38 | logContext = context; 39 | }); 40 | 41 | module("logs1"); 42 | 43 | test("test1", 15, function() { 44 | equal( begin, 1, "QUnit.begin calls" ); 45 | equal( moduleStart, 1, "QUnit.moduleStart calls" ); 46 | equal( testStart, 1, "QUnit.testStart calls" ); 47 | equal( testDone, 0, "QUnit.testDone calls" ); 48 | equal( moduleDone, 0, "QUnit.moduleDone calls" ); 49 | deepEqual( logContext, { 50 | name: "test1", 51 | module: "logs1", 52 | result: true, 53 | message: "QUnit.moduleDone calls", 54 | actual: 0, 55 | expected: 0 56 | }, "log context after equal(actual, expected, message)" ); 57 | 58 | equal( "foo", "foo" ); 59 | deepEqual(logContext, { 60 | name: "test1", 61 | module: "logs1", 62 | result: true, 63 | message: undefined, 64 | actual: "foo", 65 | expected: "foo" 66 | }, "log context after equal(actual, expected)" ); 67 | 68 | ok( true, "ok(true, message)" ); 69 | deepEqual( logContext, { 70 | module: "logs1", 71 | name: "test1", 72 | result: true, 73 | message: "ok(true, message)" 74 | }, "log context after ok(true, message)" ); 75 | 76 | strictEqual( testDoneContext, undefined, "testDone context" ); 77 | deepEqual( testContext, { 78 | module: "logs1", 79 | name: "test1" 80 | }, "test context" ); 81 | strictEqual( moduleDoneContext, undefined, "moduleDone context" ); 82 | deepEqual( moduleContext, { 83 | name: "logs1" 84 | }, "module context" ); 85 | 86 | equal( log, 14, "QUnit.log calls" ); 87 | }); 88 | test("test2", 11, function() { 89 | equal( begin, 1, "QUnit.begin calls" ); 90 | equal( moduleStart, 1, "QUnit.moduleStart calls" ); 91 | equal( testStart, 2, "QUnit.testStart calls" ); 92 | equal( testDone, 1, "QUnit.testDone calls" ); 93 | equal( moduleDone, 0, "QUnit.moduleDone calls" ); 94 | 95 | ok( typeof testDoneContext.duration === "number" , "testDone context: duration" ); 96 | delete testDoneContext.duration; 97 | deepEqual( testDoneContext, { 98 | module: "logs1", 99 | name: "test1", 100 | failed: 0, 101 | passed: 15, 102 | total: 15 103 | }, "testDone context" ); 104 | deepEqual( testContext, { 105 | module: "logs1", 106 | name: "test2" 107 | }, "test context" ); 108 | strictEqual( moduleDoneContext, undefined, "moduleDone context" ); 109 | deepEqual( moduleContext, { 110 | name: "logs1" 111 | }, "module context" ); 112 | 113 | equal( log, 25, "QUnit.log calls" ); 114 | }); 115 | 116 | module("logs2"); 117 | 118 | test( "test1", 9, function() { 119 | equal( begin, 1, "QUnit.begin calls" ); 120 | equal( moduleStart, 2, "QUnit.moduleStart calls" ); 121 | equal( testStart, 3, "QUnit.testStart calls" ); 122 | equal( testDone, 2, "QUnit.testDone calls" ); 123 | equal( moduleDone, 1, "QUnit.moduleDone calls" ); 124 | 125 | deepEqual( testContext, { 126 | module: "logs2", 127 | name: "test1" 128 | }, "test context" ); 129 | deepEqual( moduleDoneContext, { 130 | name: "logs1", 131 | failed: 0, 132 | passed: 26, 133 | total: 26 134 | }, "moduleDone context" ); 135 | deepEqual( moduleContext, { 136 | name: "logs2" 137 | }, "module context" ); 138 | 139 | equal( log, 34, "QUnit.log calls" ); 140 | }); 141 | test( "test2", 8, function() { 142 | equal( begin, 1, "QUnit.begin calls" ); 143 | equal( moduleStart, 2, "QUnit.moduleStart calls" ); 144 | equal( testStart, 4, "QUnit.testStart calls" ); 145 | equal( testDone, 3, "QUnit.testDone calls" ); 146 | equal( moduleDone, 1, "QUnit.moduleDone calls" ); 147 | 148 | deepEqual( testContext, { 149 | module: "logs2", 150 | name: "test2" 151 | }, "test context" ); 152 | deepEqual( moduleContext, { 153 | name: "logs2" 154 | }, "module context" ); 155 | 156 | equal( log, 42, "QUnit.log calls" ); 157 | }); 158 | 159 | var testAutorun = true; 160 | 161 | QUnit.done(function() { 162 | 163 | if (!testAutorun) { 164 | return; 165 | } 166 | 167 | testAutorun = false; 168 | 169 | module("autorun"); 170 | 171 | test("reset", 0, function() {}); 172 | 173 | moduleStart = moduleDone = 0; 174 | 175 | test("first", function() { 176 | equal(moduleStart, 1, "test started"); 177 | equal(moduleDone, 0, "test in progress"); 178 | }); 179 | 180 | test("second", function() { 181 | equal(moduleStart, 2, "test started"); 182 | equal(moduleDone, 1, "test in progress"); 183 | }); 184 | }); 185 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/test/narwhal-test.js: -------------------------------------------------------------------------------- 1 | // Run with: $ narwhal test/narwhal-test.js 2 | var QUnit = require("../qunit/qunit"); 3 | 4 | QUnit.log(function(details) { 5 | if (!details.result) { 6 | var output = "FAILED: " + (details.message ? details.message + ", " : ""); 7 | if (details.actual) { 8 | output += "expected: " + details.expected + ", actual: " + details.actual; 9 | } 10 | if (details.source) { 11 | output += ", " + details.source; 12 | } 13 | print(output); 14 | } 15 | }); 16 | 17 | QUnit.test("fail twice with stacktrace", function(assert) { 18 | /*jshint expr:true */ 19 | assert.equal(true, false); 20 | assert.equal(true, false, "gotta fail"); 21 | x.y.z; // Throws ReferenceError 22 | }); 23 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/test/node-test.js: -------------------------------------------------------------------------------- 1 | // Run with: $ node test/node-test.js 2 | var QUnit = require("../qunit/qunit"); 3 | 4 | QUnit.log(function(details) { 5 | if (!details.result) { 6 | var output = "FAILED: " + (details.message ? details.message + ", " : ""); 7 | if (details.actual) { 8 | output += "expected: " + details.expected + ", actual: " + details.actual; 9 | } 10 | if (details.source) { 11 | output += ", " + details.source; 12 | } 13 | console.log(output); 14 | } 15 | }); 16 | 17 | QUnit.test("fail twice with stacktrace", function(assert) { 18 | /*jshint expr:true */ 19 | assert.equal(true, false); 20 | assert.equal(true, false, "gotta fail"); 21 | x.y.z; // Throws ReferenceError 22 | }); 23 | -------------------------------------------------------------------------------- /bower_components/history.js/vendor/qunit/test/swarminject.js: -------------------------------------------------------------------------------- 1 | // load testswarm agent 2 | (function() { 3 | var url = window.location.search; 4 | url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) ); 5 | if ( !url || url.indexOf("http") !== 0 ) { 6 | return; 7 | } 8 | /*jshint evil:true */ 9 | document.write(""); 10 | })(); 11 | -------------------------------------------------------------------------------- /dist/App.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _extends = function (child, parent) { 4 | child.prototype = Object.create(parent.prototype, { 5 | constructor: { 6 | value: child, 7 | enumerable: false, 8 | writable: true, 9 | configurable: true 10 | } 11 | }); 12 | child.__proto__ = parent; 13 | }; 14 | 15 | require("6to5/polyfill");var Promise = (global || window).Promise = require("lodash-next").Promise;var __DEV__ = (process.env.NODE_ENV !== "production");var __PROD__ = !__DEV__;var __BROWSER__ = (typeof window === "object");var __NODE__ = !__BROWSER__;var R = require("react-nexus"); 16 | var _ = R._; 17 | var url = require("url"); 18 | 19 | var _ref = require("./common"); 20 | 21 | var supportedLocales = _ref.supportedLocales; 22 | var Flux = require("./Flux"); 23 | var Root = require("./components/Root"); 24 | var template = require("./template"); 25 | var router = require("./router"); 26 | 27 | var History = R.Plugins.History({ storeName: "memory", dispatcherName: "memory" }); 28 | var Window = R.Plugins.Window({ storeName: "memory", dispatcherName: "memory" }); 29 | var Localize = R.Plugins.Localize({ storeName: "memory", dispatcherName: "memory", supportedLocales: supportedLocales }); 30 | 31 | var App = (function (R) { 32 | var App = function App() { 33 | R.App.apply(this, arguments); 34 | }; 35 | 36 | _extends(App, R.App); 37 | 38 | App.prototype.getFluxClass = function () { 39 | return Flux; 40 | }; 41 | 42 | App.prototype.getRootClass = function () { 43 | return Root; 44 | }; 45 | 46 | App.prototype.getTemplate = function () { 47 | return template; 48 | }; 49 | 50 | App.prototype.getTemplateVars = regeneratorRuntime.mark(function _callee(_ref2) { 51 | var req, _ref3, pathname, _ref4, title, description, canonical, lang; 52 | return regeneratorRuntime.wrap(function _callee$(_context) { 53 | while (true) switch (_context.prev = _context.next) { 54 | case 0: req = _ref2.req; 55 | _ref3 = url.parse(req.url); 56 | pathname = _ref3.pathname; 57 | _context.next = 5; 58 | return _.pick(router.match(pathname), ["title", "description", "canonical"]); 59 | case 5: _ref4 = _context.sent; 60 | title = _ref4.title; 61 | description = _ref4.description; 62 | canonical = _ref4.canonical; 63 | lang = R.Plugins.Localize.bestLocale(req.headers["accept-langage"], supportedLocales).language; 64 | return _context.abrupt("return", { title: title, description: description, canonical: canonical, lang: lang }); 65 | case 11: 66 | case "end": return _context.stop(); 67 | } 68 | }, _callee, this); 69 | }); 70 | App.prototype.getPluginsClasses = function () { 71 | return [History, Window, Localize]; 72 | }; 73 | 74 | return App; 75 | })(R); 76 | 77 | module.exports = App; -------------------------------------------------------------------------------- /dist/Flux.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _extends = function (child, parent) { 4 | child.prototype = Object.create(parent.prototype, { 5 | constructor: { 6 | value: child, 7 | enumerable: false, 8 | writable: true, 9 | configurable: true 10 | } 11 | }); 12 | child.__proto__ = parent; 13 | }; 14 | 15 | require("6to5/polyfill");var Promise = (global || window).Promise = require("lodash-next").Promise;var __DEV__ = (process.env.NODE_ENV !== "production");var __PROD__ = !__DEV__;var __BROWSER__ = (typeof window === "object");var __NODE__ = !__BROWSER__;var R = require("react-nexus"); 16 | var _ = R._; 17 | var Uplink = require("nexus-uplink-client"); 18 | 19 | var common = require("./common"); 20 | 21 | var Flux = (function (R) { 22 | var Flux = function Flux() { 23 | R.Flux.apply(this, arguments); 24 | }; 25 | 26 | _extends(Flux, R.Flux); 27 | 28 | Flux.prototype.bootstrap = regeneratorRuntime.mark(function _callee() { 29 | var _this = this; 30 | var uplink; 31 | return regeneratorRuntime.wrap(function _callee$(_context) { 32 | while (true) switch (_context.prev = _context.next) { 33 | case 0: // jshint ignore:line 34 | _this.registerStore("memory", new R.Store.MemoryStore()).registerEventEmitter("memory", new R.EventEmitter.MemoryEventEmitter()).registerDispatcher("memory", new R.Dispatcher()); 35 | 36 | uplink = _this.uplink = new Uplink({ url: common.uplink.url, guid: _this.guid }); 37 | 38 | 39 | _this.registerStore("uplink", new R.Store.UplinkStore({ uplink: uplink })).registerEventEmitter("uplink", new R.EventEmitter.UplinkEventEmitter({ uplink: uplink })).registerDispatcher("uplink", new R.Dispatcher.UplinkDispatcher({ uplink: uplink })); 40 | case 3: 41 | case "end": return _context.stop(); 42 | } 43 | }, _callee, this); 44 | }); 45 | Flux.prototype.destroy = function () { 46 | this.getStore("memory").destroy(); 47 | this.getEventEmitter("memory").destroy(); 48 | this.getDispatcher("memory").destroy(); 49 | 50 | this.getStore("uplink").destroy(); 51 | this.getEventEmitter("uplink").destroy(); 52 | this.getDispatcher("uplink").destroy(); 53 | 54 | this.uplink.destroy(); 55 | this.uplink = null; 56 | R.Flux.prototype.destroy.call(this); 57 | }; 58 | 59 | return Flux; 60 | })(R); 61 | 62 | _.extend(Flux.prototype, { 63 | uplink: null }); 64 | 65 | module.exports = Flux; -------------------------------------------------------------------------------- /dist/c.css: -------------------------------------------------------------------------------- 1 | /* From Root.styles: */ 2 | html, body { 3 | color: #484848; 4 | font-family: "Roboto", sans-serif; 5 | } 6 | 7 | a, a:hover, a:visited, a:active { 8 | text-decoration: none; 9 | } 10 | 11 | a { 12 | color: #aaa; 13 | } 14 | 15 | a:hover { 16 | color: #fafafa; 17 | } 18 | 19 | a:active { 20 | color: #fff; 21 | } 22 | 23 | /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRpc3QvY29tcG9uZW50cy9Sb290Y3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHdCQUFBO0VBQ0E7TUFDQSxnQkFBQTtFQUNBLG1DQUFBO0lBQ0E7O0FBRUE7TUFDQSx1QkFBQTtJQUNBOztBQUVBO01BQ0EsYUFBQTtJQUNBOztBQUVBO01BQ0EsZ0JBQUE7SUFDQTs7QUFFQTtNQUNBLGFBQUE7SUFDQSIsImZpbGUiOiJjLmNzcyIsInNvdXJjZXNDb250ZW50IjpbIi8qIEZyb20gUm9vdC5zdHlsZXM6ICovXG4gIGh0bWwsIGJvZHkge1xuICAgICAgY29sb3I6ICM0ODQ4NDg7XG4gIGZvbnQtZmFtaWx5OiBcIlJvYm90b1wiLCBzYW5zLXNlcmlmO1xuICB9XG4gIFxuYSwgYTpob3ZlciwgYTp2aXNpdGVkLCBhOmFjdGl2ZSB7XG4gICAgICB0ZXh0LWRlY29yYXRpb246IG5vbmU7XG4gIH1cbiAgXG5hIHtcbiAgICAgIGNvbG9yOiAjYWFhO1xuICB9XG4gIFxuYTpob3ZlciB7XG4gICAgICBjb2xvcjogI2ZhZmFmYTtcbiAgfVxuICBcbmE6YWN0aXZlIHtcbiAgICAgIGNvbG9yOiAjZmZmO1xuICB9XG4gICJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ== */ -------------------------------------------------------------------------------- /dist/client.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | require("6to5/polyfill");var Promise = (global || window).Promise = require("lodash-next").Promise;var __DEV__ = (process.env.NODE_ENV !== "production");var __PROD__ = !__DEV__;var __BROWSER__ = (typeof window === "object");var __NODE__ = !__BROWSER__;var R = require("react-nexus"); 4 | var _ = R._; 5 | var App = require("./App"); 6 | 7 | var app = new App(); 8 | var client = new R.Client({ app: app }); 9 | _.co(regeneratorRuntime.mark(function _callee() { 10 | return regeneratorRuntime.wrap(function _callee$(_context) { 11 | while (true) switch (_context.prev = _context.next) { 12 | case 0: _context.next = 2; 13 | return client.mount({ window: window }); 14 | case 2: 15 | _.dev(function () { 16 | return console.log("Client mounted.", client); 17 | }); 18 | case 3: 19 | case "end": return _context.stop(); 20 | } 21 | }, _callee, this); 22 | })); -------------------------------------------------------------------------------- /dist/common.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | require("6to5/polyfill");var Promise = (global || window).Promise = require("lodash-next").Promise;var __DEV__ = (process.env.NODE_ENV !== "production");var __PROD__ = !__DEV__;var __BROWSER__ = (typeof window === "object");var __NODE__ = !__BROWSER__;module.exports = { 4 | supportedLocales: ["en", "fr"], 5 | uplink: { 6 | port: 8080, 7 | url: "http://localhost:8080" }, 8 | render: { 9 | port: 8000, 10 | url: "http://localhost:8000" } }; -------------------------------------------------------------------------------- /dist/components/Root.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | require("6to5/polyfill");var Promise = (global || window).Promise = require("lodash-next").Promise;var __DEV__ = (process.env.NODE_ENV !== "production");var __PROD__ = !__DEV__;var __BROWSER__ = (typeof window === "object");var __NODE__ = !__BROWSER__;var R = require("react-nexus"); 4 | var React = R.React; 5 | var styles = require("../styles"); 6 | 7 | var Root = React.createClass({ displayName: "Root", 8 | mixins: [R.Root.Mixin], 9 | 10 | getFluxStoreSubscriptions: function () { 11 | return { 12 | clock: "uplink://clock", 13 | users: "uplink://users" }; 14 | }, 15 | 16 | render: function () { 17 | return React.createElement("div", { className: "Root" }, "Hello React Nexus. Now is ", this.state.clock ? this.state.clock.now : "(unknown)", " and there are ", this.state.users ? this.state.users.count : "(unknown)", " active users."); 18 | }, 19 | 20 | statics: { 21 | styles: { 22 | "html, body": { 23 | color: styles.colors.Text, 24 | fontFamily: styles.fonts.Roboto }, 25 | 26 | "a, a:hover, a:visited, a:active": { 27 | textDecoration: "none" }, 28 | 29 | a: { 30 | color: styles.colors.Link }, 31 | 32 | "a:hover": { 33 | color: styles.colors.LinkHover }, 34 | 35 | "a:active": { 36 | color: styles.colors.LinkActive } } } }); 37 | 38 | module.exports = Root; -------------------------------------------------------------------------------- /dist/render.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | require("6to5/polyfill");var Promise = (global || window).Promise = require("lodash-next").Promise;var __DEV__ = (process.env.NODE_ENV !== "production");var __PROD__ = !__DEV__;var __BROWSER__ = (typeof window === "object");var __NODE__ = !__BROWSER__;var cors = require("cors"); 4 | var express = require("express"); 5 | var path = require("path"); 6 | 7 | var App = require("./App"); 8 | 9 | module.exports = function () { 10 | var render = express().use(cors()).use(express["static"](path.join(__dirname, "..", "public"))).get("/favicon.ico", function (req, res) { 11 | return res.status(404).send(null); 12 | }).use((new App()).prerender); 13 | 14 | return render; 15 | }; -------------------------------------------------------------------------------- /dist/router.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | require("6to5/polyfill");var Promise = (global || window).Promise = require("lodash-next").Promise;var __DEV__ = (process.env.NODE_ENV !== "production");var __PROD__ = !__DEV__;var __BROWSER__ = (typeof window === "object");var __NODE__ = !__BROWSER__;var R = require("react-nexus"); 4 | 5 | var router = new R.Router({ 6 | "/about": function () { 7 | return ({ 8 | title: "About", 9 | description: "About React Nexus Starterkit", 10 | canonical: "/about" }); 11 | } })["default"](function () { 12 | return ({ 13 | title: "Home", 14 | description: "Homepage of React Nexus Starterkit", 15 | canonical: "/" }); 16 | }); 17 | 18 | module.exports = router; -------------------------------------------------------------------------------- /dist/server.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | require("6to5/polyfill");var Promise = (global || window).Promise = require("lodash-next").Promise;var __DEV__ = (process.env.NODE_ENV !== "production");var __PROD__ = !__DEV__;var __BROWSER__ = (typeof window === "object");var __NODE__ = !__BROWSER__;var R = require("react-nexus"); 4 | var _ = R._; 5 | var cluster = require("cluster"); 6 | 7 | var common = require("./common"); 8 | var render = require("./render"); 9 | var uplink = require("./uplink"); 10 | 11 | var ROLE_UPLINK = "uplink"; 12 | var ROLE_RENDER = "render"; 13 | var workers = (function (_workers) { 14 | _workers[ROLE_UPLINK] = uplink; 15 | _workers[ROLE_RENDER] = render; 16 | return _workers; 17 | })({}); 18 | 19 | function fork(CLUSTER_ROLE) { 20 | cluster.fork({ CLUSTER_ROLE: CLUSTER_ROLE }).on("online", function () { 21 | _.dev(function () { 22 | return console.warn("worker " + CLUSTER_ROLE + " is online."); 23 | }); 24 | }).on("exit", function (code, signal) { 25 | _.dev(function () { 26 | return console.warn("Worker " + CLUSTER_ROLE + " exited with code " + code + " and signal " + signal + "."); 27 | }); 28 | fork(CLUSTER_ROLE); 29 | }); 30 | } 31 | 32 | function run(CLUSTER_ROLE) { 33 | _.dev(function () { 34 | return (CLUSTER_ROLE !== void 0).should.be.ok && (workers[CLUSTER_ROLE] !== void 0).should.be.ok && workers[CLUSTER_ROLE].should.be.a.Function; 35 | }); 36 | workers[CLUSTER_ROLE]().listen(common[CLUSTER_ROLE].port, function () { 37 | return _.dev(function () { 38 | return console.warn("" + CLUSTER_ROLE + " listening on port " + common[CLUSTER_ROLE].port + "."); 39 | }); 40 | }); 41 | } 42 | 43 | if (__DEV__) { 44 | console.warn("Running in DEVELOPMENT mode (single process-mode, debugging messages, runtime checks)."); 45 | console.warn("Switch the NODE_ENV flag to 'production' to enable multi-process mode and run optimized code."); 46 | Object.keys(workers).forEach(run); 47 | } else { 48 | if (cluster.isMaster) { 49 | Object.keys(workers).forEach(fork); 50 | } else { 51 | run(process.env.CLUSTER_ROLE); 52 | } 53 | } -------------------------------------------------------------------------------- /dist/styles.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | require("6to5/polyfill");var Promise = (global || window).Promise = require("lodash-next").Promise;var __DEV__ = (process.env.NODE_ENV !== "production");var __PROD__ = !__DEV__;var __BROWSER__ = (typeof window === "object");var __NODE__ = !__BROWSER__;module.exports = { 4 | colors: { 5 | Text: "#484848", 6 | Link: "#aaa", 7 | LinkHover: "#fafafa", 8 | LinkActive: "#fff" }, 9 | 10 | fonts: { 11 | Roboto: "\"Roboto\", sans-serif", 12 | OpenSansCondensed: "\"Open Sans Condensed\", sans-serif", 13 | OpenSans: "\"Open Sans\", sans-serif" }, 14 | 15 | dimensions: { 16 | pageWidth: 980 } 17 | }; -------------------------------------------------------------------------------- /dist/template.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | require("6to5/polyfill");var Promise = (global || window).Promise = require("lodash-next").Promise;var __DEV__ = (process.env.NODE_ENV !== "production");var __PROD__ = !__DEV__;var __BROWSER__ = (typeof window === "object");var __NODE__ = !__BROWSER__; /* jshint ignore:start */ 4 | // Escape double-quotes 5 | var X = function (x) { 6 | return x.replace(/\"/g, "\\\""); 7 | }; 8 | 9 | module.exports = function (_ref) { 10 | var title = _ref.title; 11 | var description = _ref.description; 12 | var canonical = _ref.canonical; 13 | var lang = _ref.lang; 14 | var rootHtml = _ref.rootHtml; 15 | var serializedFlux = _ref.serializedFlux; 16 | var serializedHeaders = _ref.serializedHeaders; 17 | var guid = _ref.guid; 18 | return "\n \n \n \n \n " + (description ? "" : "") + "\n \n " + (title || "") + "\n \n \n \n \n \n \n
                                \n " + rootHtml + "\n
                                \n \n \n \n \n "; 19 | }; 20 | /* jshint ignore:end */ -------------------------------------------------------------------------------- /dist/uplink.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | require("6to5/polyfill");var Promise = (global || window).Promise = require("lodash-next").Promise;var __DEV__ = (process.env.NODE_ENV !== "production");var __PROD__ = !__DEV__;var __BROWSER__ = (typeof window === "object");var __NODE__ = !__BROWSER__;var R = require("react-nexus"); 4 | var _ = R._; 5 | var cors = require("cors"); 6 | var express = require("express"); 7 | var UplinkSimpleServer = require("nexus-uplink-simple-server"); 8 | 9 | module.exports = function () { 10 | var uplink = new UplinkSimpleServer({ 11 | pid: _.guid("pid"), 12 | stores: ["/clock", "/users"], 13 | rooms: [], 14 | actions: [], 15 | activityTimeout: 2000, 16 | app: express().use(cors()) }); 17 | 18 | var users = {}; 19 | 20 | function updateAll() { 21 | uplink.update({ path: "/clock", value: { now: Date.now() } }); 22 | uplink.update({ path: "/users", value: { count: Object.keys(users).length } }); 23 | } 24 | 25 | uplink.events.on("create", function (_ref) { 26 | var guid = _ref.guid; 27 | users[guid] = true; 28 | }); 29 | uplink.events.on("delete", function (_ref2) { 30 | var guid = _ref2.guid; 31 | delete users[guid]; 32 | }); 33 | 34 | setInterval(updateAll, 100); 35 | return uplink; 36 | }; -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var __NODE__ = !__BROWSER__; var __BROWSER__ = (typeof window === "object"); var __PROD__ = !__DEV__; var __DEV__ = (process.env.NODE_ENV !== "production"); var Promise = require("lodash-next").Promise; require("6to5/polyfill"); 2 | var _ = require('lodash-next'); 3 | 4 | var autoprefixer = require('autoprefixer-core')({ cascade: true }); 5 | var buffer = require('vinyl-buffer'); 6 | var concat = require('gulp-concat'); 7 | var cssbeautify = require('gulp-cssbeautify'); 8 | var cssmqpacker = require('css-mqpacker'); 9 | var csswring = require('csswring'); 10 | var del = require('del'); 11 | var es6to5 = require('gulp-6to5'); 12 | var gplumber = require('gulp-plumber'); 13 | var gulp = require('gulp'); 14 | var gutil = require('gulp-util'); 15 | var gwebpack = require('gulp-webpack'); 16 | var insert = require('gulp-insert'); 17 | var jshint = require('gulp-jshint'); 18 | var path = require('path'); 19 | var postcss = require('gulp-postcss'); 20 | var react = require('gulp-react'); 21 | var rename = require('gulp-rename'); 22 | var source = require('vinyl-source-stream'); 23 | var sourcemaps = require('gulp-sourcemaps'); 24 | var style = require('gulp-react-nexus-style'); 25 | var stylish = require('jshint-stylish'); 26 | var uglify = require('gulp-uglify'); 27 | var webpack = require('webpack'); 28 | var wrap = require('gulp-wrap'); 29 | 30 | // Improve default error handler to get stack trace. 31 | function plumber() { 32 | return gplumber({ 33 | errorHandler: function(err) { 34 | console.error(err.stack); 35 | } 36 | }); 37 | }; 38 | 39 | if(__DEV__) { 40 | console.log('gulp started in DEVELOPMENT mode; start with NODE_ENV="production" before deploying.'); 41 | } 42 | else { 43 | console.log('gulp started in PRODUCTION mode; start with NODE_ENV="development" to get more runtime-checks.'); 44 | } 45 | 46 | gulp.task('clean', function(fn) { 47 | del([ 48 | 'dist', 49 | 'public/p.js', 'public/p.min.js', 50 | 'public/p.css', 'public/p.min.css', 51 | ], fn); 52 | }); 53 | 54 | gulp.task('lintJS', ['clean'], function() { 55 | return gulp.src('src/**/*.js') 56 | .pipe(plumber()) 57 | .pipe(jshint()) 58 | .pipe(jshint.reporter(stylish)); 59 | }); 60 | 61 | gulp.task('lintJSX', ['clean'], function() { 62 | return gulp.src(['src/**/*.jsx']) 63 | .pipe(plumber()) 64 | .pipe(react()) 65 | .pipe(jshint({ quotmark: false })) 66 | .pipe(jshint.reporter(stylish)); 67 | }); 68 | 69 | gulp.task('lint', ['lintJS', 'lintJSX']); 70 | 71 | gulp.task('build', ['clean'], function() { 72 | return gulp.src(['src/**/*.js', 'src/**/*.jsx']) 73 | .pipe(plumber()) 74 | .pipe(react()) 75 | .pipe(insert.prepend( 76 | 'require(\'6to5/polyfill\'); ' + 77 | 'const Promise = (global || window).Promise = require(\'lodash-next\').Promise; ' + 78 | 'const __DEV__ = (process.env.NODE_ENV !== \'production\'); ' + 79 | 'const __PROD__ = !__DEV__; ' + 80 | 'const __BROWSER__ = (typeof window === \'object\'); ' + 81 | 'const __NODE__ = !__BROWSER__; ')) 82 | .pipe(es6to5()) 83 | .pipe(gulp.dest('dist')); 84 | }); 85 | 86 | gulp.task('compile', ['lint', 'build']); 87 | 88 | gulp.task('bundle', ['compile'], function() { 89 | return gulp.src('dist/client.js') 90 | .pipe(plumber()) 91 | .pipe(gwebpack({ 92 | target: 'web', 93 | debug: __DEV__, 94 | devtool: __DEV__ && 'eval', 95 | module: { 96 | loaders: [ 97 | { test: /\.json$/, loader: 'json-loader' }, 98 | ], 99 | }, 100 | plugins: [ 101 | new webpack.IgnorePlugin(/^fs$/), 102 | new webpack.DefinePlugin({ 103 | '__DEV__': JSON.stringify(__DEV__), 104 | '__PROD__': JSON.stringify(__PROD__), 105 | '__BROWSER__': JSON.stringify(true), 106 | '__NODE__': JSON.stringify(false), 107 | 'process.env': { 108 | NODE_ENV: JSON.stringify(__DEV__ ? 'developement' : 'production'), 109 | }, 110 | }), 111 | new webpack.optimize.DedupePlugin(), 112 | ], 113 | })) 114 | .pipe(rename({ basename: 'c' })) 115 | .pipe(gulp.dest('dist')); 116 | }); 117 | 118 | gulp.task('componentsCSS', ['compile'], function() { 119 | return gulp.src('dist/components/**/*.js') 120 | .pipe(plumber()) 121 | .pipe(style()) 122 | .pipe(__DEV__ ? sourcemaps.init() : gutil.noop()) 123 | .pipe(concat('c.css')) 124 | .pipe(postcss([autoprefixer])) 125 | .pipe(cssbeautify({ indent: ' ', autosemicolon: true })) 126 | .pipe(__DEV__ ? sourcemaps.write() : gutil.noop()) 127 | .pipe(gulp.dest('dist')); 128 | }); 129 | 130 | gulp.task('packJS', ['componentsCSS', 'bundle'], function() { 131 | return gulp.src([ 132 | 'bower_components/history.js/scripts/bundled-uncompressed/html4+html5/native.history.js', 133 | 'dist/c.js', 134 | ]) 135 | .pipe(plumber()) 136 | // Wrap each file in an IIFE. 137 | .pipe(wrap('(function() {\n<%= contents %>\n})();\n')) 138 | .pipe(concat('p.js')) 139 | .pipe(__DEV__ ? gutil.noop() : uglify({ 140 | mangle: { 141 | except: ['GeneratorFunction'], 142 | }, 143 | })) 144 | .pipe(__DEV__ ? gutil.noop() : rename({ extname: '.min.js' })) 145 | .pipe(gulp.dest('public')); 146 | }); 147 | 148 | gulp.task('packCSS', ['componentsCSS', 'bundle'], function() { 149 | return gulp.src([ 150 | 'dist/c.css', 151 | ]) 152 | .pipe(plumber()) 153 | .pipe(concat('p.css')) 154 | .pipe(__DEV__ ? gutil.noop() : postcss([cssmqpacker, csswring])) 155 | .pipe(__DEV__ ? gutil.noop() : rename({ extname: '.min.css' })) 156 | .pipe(gulp.dest('public')); 157 | }); 158 | 159 | gulp.task('pack', ['packJS', 'packCSS']); 160 | 161 | gulp.task('finalize', ['pack'], function(fn) { 162 | fn(); 163 | }); 164 | 165 | gulp.task('default', ['finalize']); 166 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-nexus-starterkit", 3 | "version": "0.2.1", 4 | "description": "", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "start": "node dist/server.js" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/elierotenberg/react-nexus-starterkit.git" 12 | }, 13 | "author": "Elie Rotenberg ", 14 | "license": "MIT", 15 | "bugs": { 16 | "url": "https://github.com/elierotenberg/react-nexus-starterkit/issues" 17 | }, 18 | "homepage": "https://github.com/elierotenberg/react-nexus-starterkit", 19 | "devDependencies": { 20 | "autoprefixer-core": "^4.0.2", 21 | "css-mqpacker": "^2.0.0", 22 | "csswring": "^2.0.0", 23 | "del": "^1.1.0", 24 | "gulp": "^3.8.10", 25 | "gulp-6to5": "^1.0.2", 26 | "gulp-add-src": "^0.2.0", 27 | "gulp-concat": "^2.4.2", 28 | "gulp-cssbeautify": "^0.1.3", 29 | "gulp-insert": "^0.4.0", 30 | "gulp-jshint": "^1.9.0", 31 | "gulp-plumber": "^0.6.6", 32 | "gulp-postcss": "^3.0.0", 33 | "gulp-react": "^2.0.0", 34 | "react-nexus": "^1.1.3", 35 | "gulp-rename": "^1.2.0", 36 | "gulp-sourcemaps": "^1.2.8", 37 | "gulp-uglify": "^1.0.2", 38 | "gulp-util": "^3.0.1", 39 | "gulp-webpack": "^1.1.2", 40 | "gulp-wrap": "^0.5.0", 41 | "jshint-stylish": "^1.0.0", 42 | "json-loader": "^0.5.1", 43 | "morgan": "^1.5.0", 44 | "vinyl-buffer": "^1.0.0", 45 | "vinyl-source-stream": "^1.0.0", 46 | "webpack": "^1.4.13" 47 | }, 48 | "dependencies": { 49 | "6to5": "^1.15.0", 50 | "cors": "^2.5.2", 51 | "express": "^4.10.6", 52 | "gulp-react-nexus-style": "^0.2.0", 53 | "http-exceptions": "^0.4.11", 54 | "lodash-next": "^1.12.0", 55 | "nexus-router": "^0.3.13", 56 | "nexus-uplink-client": "^1.1.3", 57 | "nexus-uplink-simple-server": "^1.2.5", 58 | "react-nexus": "^1.1.3" 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /public/p.css: -------------------------------------------------------------------------------- 1 | /* From Root.styles: */ 2 | html, body { 3 | color: #484848; 4 | font-family: "Roboto", sans-serif; 5 | } 6 | 7 | a, a:hover, a:visited, a:active { 8 | text-decoration: none; 9 | } 10 | 11 | a { 12 | color: #aaa; 13 | } 14 | 15 | a:hover { 16 | color: #fafafa; 17 | } 18 | 19 | a:active { 20 | color: #fff; 21 | } 22 | 23 | /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRpc3QvY29tcG9uZW50cy9Sb290Y3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHdCQUFBO0VBQ0E7TUFDQSxnQkFBQTtFQUNBLG1DQUFBO0lBQ0E7O0FBRUE7TUFDQSx1QkFBQTtJQUNBOztBQUVBO01BQ0EsYUFBQTtJQUNBOztBQUVBO01BQ0EsZ0JBQUE7SUFDQTs7QUFFQTtNQUNBLGFBQUE7SUFDQSIsImZpbGUiOiJjLmNzcyIsInNvdXJjZXNDb250ZW50IjpbIi8qIEZyb20gUm9vdC5zdHlsZXM6ICovXG4gIGh0bWwsIGJvZHkge1xuICAgICAgY29sb3I6ICM0ODQ4NDg7XG4gIGZvbnQtZmFtaWx5OiBcIlJvYm90b1wiLCBzYW5zLXNlcmlmO1xuICB9XG4gIFxuYSwgYTpob3ZlciwgYTp2aXNpdGVkLCBhOmFjdGl2ZSB7XG4gICAgICB0ZXh0LWRlY29yYXRpb246IG5vbmU7XG4gIH1cbiAgXG5hIHtcbiAgICAgIGNvbG9yOiAjYWFhO1xuICB9XG4gIFxuYTpob3ZlciB7XG4gICAgICBjb2xvcjogI2ZhZmFmYTtcbiAgfVxuICBcbmE6YWN0aXZlIHtcbiAgICAgIGNvbG9yOiAjZmZmO1xuICB9XG4gICJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ== */ -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | const R = require('react-nexus'); 2 | const _ = R._; 3 | const url = require('url'); 4 | 5 | const { supportedLocales } = require('./common'); 6 | const Flux = require('./Flux'); 7 | const Root = require('./components/Root'); 8 | const template = require('./template'); 9 | const router = require('./router'); 10 | 11 | const History = R.Plugins.History({ storeName: 'memory', dispatcherName: 'memory' }); 12 | const Window = R.Plugins.Window({ storeName: 'memory', dispatcherName: 'memory' }); 13 | const Localize = R.Plugins.Localize({ storeName: 'memory', dispatcherName: 'memory', supportedLocales }); 14 | 15 | class App extends R.App { 16 | getFluxClass() { return Flux; } 17 | 18 | getRootClass() { return Root; } 19 | 20 | getTemplate() { return template; } 21 | 22 | *getTemplateVars({ req }) { // jshint ignore:line 23 | const { pathname } = url.parse(req.url); 24 | const { title, description, canonical } = yield _.pick(router.match(pathname), ['title', 'description', 'canonical']); // jshint ignore:line 25 | const lang = R.Plugins.Localize.bestLocale(req.headers['accept-langage'], supportedLocales).language; 26 | return { title, description, canonical, lang }; 27 | } 28 | 29 | getPluginsClasses() { 30 | return [History, Window, Localize]; 31 | } 32 | } 33 | 34 | module.exports = App; 35 | -------------------------------------------------------------------------------- /src/Flux.js: -------------------------------------------------------------------------------- 1 | const R = require('react-nexus'); 2 | const _ = R._; 3 | const Uplink = require('nexus-uplink-client'); 4 | 5 | const common = require('./common'); 6 | 7 | class Flux extends R.Flux { 8 | *bootstrap() { // jshint ignore:line 9 | this 10 | .registerStore('memory', new R.Store.MemoryStore()) 11 | .registerEventEmitter('memory', new R.EventEmitter.MemoryEventEmitter()) 12 | .registerDispatcher('memory', new R.Dispatcher()); 13 | 14 | const uplink = this.uplink = new Uplink({ url: common.uplink.url, guid: this.guid }); 15 | 16 | this 17 | .registerStore('uplink', new R.Store.UplinkStore({ uplink })) 18 | .registerEventEmitter('uplink', new R.EventEmitter.UplinkEventEmitter({ uplink })) 19 | .registerDispatcher('uplink', new R.Dispatcher.UplinkDispatcher({ uplink })); 20 | } 21 | 22 | destroy() { 23 | this.getStore('memory').destroy(); 24 | this.getEventEmitter('memory').destroy(); 25 | this.getDispatcher('memory').destroy(); 26 | 27 | this.getStore('uplink').destroy(); 28 | this.getEventEmitter('uplink').destroy(); 29 | this.getDispatcher('uplink').destroy(); 30 | 31 | this.uplink.destroy(); 32 | this.uplink = null; 33 | super.destroy(); 34 | } 35 | } 36 | 37 | _.extend(Flux.prototype, { 38 | uplink: null, 39 | }); 40 | 41 | module.exports = Flux; 42 | -------------------------------------------------------------------------------- /src/client.js: -------------------------------------------------------------------------------- 1 | const R = require('react-nexus'); 2 | const _ = R._; 3 | const App = require('./App'); 4 | 5 | const app = new App(); 6 | const client = new R.Client({ app }); 7 | _.co(function*() { 8 | yield client.mount({ window }); 9 | _.dev(() => console.log('Client mounted.', client)); 10 | }); 11 | -------------------------------------------------------------------------------- /src/common.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | supportedLocales: ['en', 'fr'], 3 | uplink: { 4 | port: 8080, 5 | url: 'http://localhost:8080', 6 | }, 7 | render: { 8 | port: 8000, 9 | url: 'http://localhost:8000', 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /src/components/Root.jsx: -------------------------------------------------------------------------------- 1 | const R = require('react-nexus'); 2 | const React = R.React; 3 | const styles = require('../styles'); 4 | 5 | const Root = React.createClass({ 6 | mixins: [R.Root.Mixin], 7 | 8 | getFluxStoreSubscriptions() { 9 | return { 10 | 'clock': 'uplink://clock', 11 | 'users': 'uplink://users', 12 | }; 13 | }, 14 | 15 | render() { 16 | return
                                17 | Hello React Nexus. Now is {this.state.clock ? this.state.clock.now : '(unknown)'} and there are {this.state.users ? this.state.users.count : '(unknown)'} active users. 18 |
                                ; 19 | }, 20 | 21 | statics: { 22 | styles: { 23 | 'html, body': { 24 | color: styles.colors.Text, 25 | fontFamily: styles.fonts.Roboto, 26 | }, 27 | 28 | 'a, a:hover, a:visited, a:active': { 29 | textDecoration: 'none', 30 | }, 31 | 32 | 'a': { 33 | color: styles.colors.Link, 34 | }, 35 | 36 | 'a:hover': { 37 | color: styles.colors.LinkHover, 38 | }, 39 | 40 | 'a:active': { 41 | color: styles.colors.LinkActive, 42 | }, 43 | }, 44 | }, 45 | }); 46 | 47 | module.exports = Root; 48 | -------------------------------------------------------------------------------- /src/render.js: -------------------------------------------------------------------------------- 1 | const cors = require('cors'); 2 | const express = require('express'); 3 | const path = require('path'); 4 | 5 | const App = require('./App'); 6 | 7 | module.exports = () => { 8 | const render = express() 9 | .use(cors()) 10 | .use(express.static(path.join(__dirname, '..', 'public'))) 11 | .get('/favicon.ico', (req, res) => res.status(404).send(null)) 12 | .use((new App()).prerender); 13 | 14 | return render; 15 | }; 16 | -------------------------------------------------------------------------------- /src/router.js: -------------------------------------------------------------------------------- 1 | const R = require('react-nexus'); 2 | 3 | const router = new R.Router({ 4 | '/about': () => ({ 5 | title: 'About', 6 | description: 'About React Nexus Starterkit', 7 | canonical: '/about', 8 | }), 9 | }).default(() => ({ 10 | title: 'Home', 11 | description: 'Homepage of React Nexus Starterkit', 12 | canonical: '/', 13 | })); 14 | 15 | module.exports = router; 16 | -------------------------------------------------------------------------------- /src/server.js: -------------------------------------------------------------------------------- 1 | const R = require('react-nexus'); 2 | const _ = R._; 3 | const cluster = require('cluster'); 4 | 5 | const common = require('./common'); 6 | const render = require('./render'); 7 | const uplink = require('./uplink'); 8 | 9 | const ROLE_UPLINK = 'uplink'; 10 | const ROLE_RENDER = 'render'; 11 | const workers = { [ROLE_UPLINK]: uplink, [ROLE_RENDER]: render }; 12 | 13 | function fork(CLUSTER_ROLE) { 14 | cluster.fork({ CLUSTER_ROLE }) 15 | .on('online', () => { 16 | _.dev(() => console.warn(`worker ${CLUSTER_ROLE} is online.`)); 17 | }) 18 | .on('exit', (code, signal) => { 19 | _.dev(() => console.warn(`Worker ${CLUSTER_ROLE} exited with code ${code} and signal ${signal}.`)); 20 | fork(CLUSTER_ROLE); 21 | }); 22 | } 23 | 24 | function run(CLUSTER_ROLE) { 25 | _.dev(() => (CLUSTER_ROLE !== void 0).should.be.ok && 26 | (workers[CLUSTER_ROLE] !== void 0).should.be.ok && 27 | workers[CLUSTER_ROLE].should.be.a.Function 28 | ); 29 | workers[CLUSTER_ROLE]() 30 | .listen(common[CLUSTER_ROLE].port, () => _.dev(() => console.warn(`${CLUSTER_ROLE} listening on port ${common[CLUSTER_ROLE].port}.`))); 31 | } 32 | 33 | if(__DEV__) { 34 | console.warn('Running in DEVELOPMENT mode (single process-mode, debugging messages, runtime checks).'); 35 | console.warn('Switch the NODE_ENV flag to \'production\' to enable multi-process mode and run optimized code.'); 36 | Object.keys(workers).forEach(run); 37 | } 38 | else { 39 | if(cluster.isMaster) { 40 | Object.keys(workers).forEach(fork); 41 | } 42 | else { 43 | run(process.env.CLUSTER_ROLE); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/styles.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | colors: { 3 | Text: '#484848', 4 | Link: '#aaa', 5 | LinkHover: '#fafafa', 6 | LinkActive: '#fff', 7 | }, 8 | 9 | fonts: { 10 | Roboto: '"Roboto", sans-serif', 11 | OpenSansCondensed: '"Open Sans Condensed", sans-serif', 12 | OpenSans: '"Open Sans", sans-serif', 13 | }, 14 | 15 | dimensions: { 16 | pageWidth: 980, 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /src/template.js: -------------------------------------------------------------------------------- 1 | /* jshint ignore:start */ 2 | // Escape double-quotes 3 | const X = (x) => x.replace(/\"/g, '\\"'); 4 | 5 | module.exports = ({ title, description, canonical, lang, rootHtml, serializedFlux, serializedHeaders, guid }) => 6 | ` 7 | 8 | 9 | 10 | 11 | ${description ? `` : ''} 12 | 13 | ${title || ""} 14 | 15 | 16 | 17 | 18 | 19 | 20 |
                                21 | ${rootHtml} 22 |
                                23 | 28 | 29 | 30 | 31 | `; 32 | /* jshint ignore:end */ 33 | -------------------------------------------------------------------------------- /src/uplink.js: -------------------------------------------------------------------------------- 1 | const R = require('react-nexus'); 2 | const _ = R._; 3 | const cors = require('cors'); 4 | const express = require('express'); 5 | const UplinkSimpleServer = require('nexus-uplink-simple-server'); 6 | 7 | module.exports = () => { 8 | const uplink = new UplinkSimpleServer({ 9 | pid: _.guid('pid'), 10 | stores: ['/clock', '/users'], 11 | rooms: [], 12 | actions: [], 13 | activityTimeout: 2000, 14 | app: express().use(cors()), 15 | }); 16 | 17 | let users = {}; 18 | 19 | function updateAll() { 20 | uplink.update({ path: '/clock', value: { now: Date.now() } }); 21 | uplink.update({ path: '/users', value: { count: Object.keys(users).length } }); 22 | } 23 | 24 | uplink.events.on('create', function({ guid }) { users[guid] = true; }); 25 | uplink.events.on('delete', function({ guid }) { delete users[guid]; }); 26 | 27 | setInterval(updateAll, 100); 28 | return uplink; 29 | }; 30 | --------------------------------------------------------------------------------