Skip to content

Commit

Permalink
#73 Mismatched anonymous define() module because of #57
Browse files Browse the repository at this point in the history
  • Loading branch information
devote committed May 22, 2015
1 parent dd55b4c commit c211663
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 55 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -13,6 +13,7 @@ npm install html5-history-api
### Browser Support:

`history.js` - IE8+ and other browsers

`history.ielte7.js` - IE6+ and other browsers

### For library developers:
Expand Down Expand Up @@ -218,6 +219,7 @@ npm install html5-history-api
### Поддержка браузеров:

`history.js` - IE8+ и другие браузеры

`history.ielte7.js` - IE6+ и другие браузеры

### Для разработчиков библиотек:
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Expand Up @@ -2,7 +2,7 @@
"name": "history",
"repo": "devote/HTML5-History-API",
"description": "HTML5 History API expansion for browsers not supporting pushState, replaceState",
"version": "4.2.0",
"version": "4.2.1",
"keywords": ["history", "pushState", "replaceState"],
"main": "history.js",
"scripts": ["history.js"],
Expand Down
2 changes: 1 addition & 1 deletion component.json
@@ -1,6 +1,6 @@
{
"name": "html5-history-api",
"version": "4.2.0",
"version": "4.2.1",
"description": "HTML5 History API expansion for browsers not supporting pushState, replaceState",
"main": "history.js",
"scripts": ["history.js"],
Expand Down
24 changes: 17 additions & 7 deletions history.ielte7.js
@@ -1,25 +1,35 @@
/*!
* History API JavaScript Library v4.2.0
* History API JavaScript Library v4.2.1
*
* Support: IE6+, FF3+, Opera 9+, Safari, Chrome and other
*
* Copyright 2011-2014, Dmitrii Pakhtinov ( spb.piksel@gmail.com )
* Copyright 2011-2015, Dmitrii Pakhtinov ( spb.piksel@gmail.com )
*
* http://spb-piksel.ru/
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Update: 2014-11-06 21:35
* Update: 2015-05-22 13:02
*/
(function(factory) {
if (typeof define === 'function' && define['amd']) {
// https://github.com/devote/HTML5-History-API/issues/57#issuecomment-43133600
define(typeof document !== "object" || document.readyState !== "loading" ? [] : "html5-history-api", factory);
} else {
factory();
// https://github.com/devote/HTML5-History-API/issues/73
var rndKey = '[history' + (new Date()).getTime() + ']';
var onError = requirejs['onError'];
factory.toString = function() {
return rndKey;
};
requirejs['onError'] = function(err) {
if (err.message.indexOf(rndKey) === -1) {
onError.call(requirejs, err);
}
};
define([], factory);
}
// execute anyway
factory();
})(function() {
// Define global variable
var global = (typeof window === 'object' ? window : this) || {};
Expand Down
42 changes: 21 additions & 21 deletions history.ielte7.min.js

Large diffs are not rendered by default.

24 changes: 17 additions & 7 deletions history.js
@@ -1,25 +1,35 @@
/*!
* History API JavaScript Library v4.2.0
* History API JavaScript Library v4.2.1
*
* Support: IE8+, FF3+, Opera 9+, Safari, Chrome and other
*
* Copyright 2011-2014, Dmitrii Pakhtinov ( spb.piksel@gmail.com )
* Copyright 2011-2015, Dmitrii Pakhtinov ( spb.piksel@gmail.com )
*
* http://spb-piksel.ru/
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Update: 2014-11-06 21:35
* Update: 2015-05-22 13:02
*/
(function(factory) {
if (typeof define === 'function' && define['amd']) {
// https://github.com/devote/HTML5-History-API/issues/57#issuecomment-43133600
define(typeof document !== "object" || document.readyState !== "loading" ? [] : "html5-history-api", factory);
} else {
factory();
// https://github.com/devote/HTML5-History-API/issues/73
var rndKey = '[history' + (new Date()).getTime() + ']';
var onError = requirejs['onError'];
factory.toString = function() {
return rndKey;
};
requirejs['onError'] = function(err) {
if (err.message.indexOf(rndKey) === -1) {
onError.call(requirejs, err);
}
};
define([], factory);
}
// execute anyway
factory();
})(function() {
// Define global variable
var global = (typeof window === 'object' ? window : this) || {};
Expand Down
34 changes: 17 additions & 17 deletions history.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -7,7 +7,7 @@
"*.js"
]
}],
"version": "4.2.0",
"version": "4.2.1",
"description": "HTML5 History API expansion for browsers not supporting pushState, replaceState",
"main": "history.js",
"repository": {
Expand Down

0 comments on commit c211663

Please sign in to comment.