Skip to content

Commit

Permalink
Bump version with fixed NPM package (since NPM doesn't allow us to ov…
Browse files Browse the repository at this point in the history
…erwrite

a previously published version)
  • Loading branch information
jhdavids8 committed May 24, 2015
1 parent 588b187 commit 1f7273e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 20 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "please-wait",
"version": "0.0.3",
"version": "0.0.4",
"homepage": "https://github.com/Pathgather/please-wait",
"authors": [
"Pathgather <[email protected]>"
Expand Down
45 changes: 31 additions & 14 deletions build/please-wait.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* PleaseWait
* please-wait
* Display a nice loading screen while your app loads
* @author Pathgather <[email protected]>
* @copyright Pathgather 2015
* @license MIT <http://opensource.org/licenses/mit-license.php>
* @link https://github.com/Pathgather/please-wait
* @module pleaseWait
* @version 0.0.3
* @module please-wait
* @version 0.0.4
*/
(function(root, factory) {
if (typeof exports === "object") {
Expand All @@ -18,7 +18,7 @@
factory(root);
}
})(this, function(exports) {
var PleaseWait, animationEvent, animationSupport, domPrefixes, elm, key, pfx, pleaseWait, transEndEventNames, transitionEvent, transitionSupport, val, _i, _len;
var PleaseWait, addClass, animationEvent, animationSupport, domPrefixes, elm, key, pfx, pleaseWait, removeClass, transEndEventNames, transitionEvent, transitionSupport, val, _i, _len;
elm = document.createElement('fakeelement');
animationSupport = false;
transitionSupport = false;
Expand Down Expand Up @@ -65,6 +65,20 @@
}
}
}
addClass = function(classname, elem) {
if (elem.classList) {
return elem.classList.add(classname);
} else {
return elem.className += " " + classname;
}
};
removeClass = function(classname, elem) {
if (elem.classList) {
return elem.classList.remove(classname);
} else {
return elem.className = elem.className.replace(classname, "").trim();
}
};
PleaseWait = (function() {
PleaseWait._defaultOptions = {
backgroundColor: null,
Expand Down Expand Up @@ -100,15 +114,16 @@
if (this._logoElem != null) {
this._logoElem.src = this.options.logo;
}
document.body.className += " pg-loading";
removeClass("pg-loaded", document.body);
addClass("pg-loading", document.body);
document.body.appendChild(this._loadingElem);
this._loadingElem.className += " pg-loading";
addClass("pg-loading", this._loadingElem);
this._onLoadedCallback = this.options.onLoadedCallback;
listener = (function(_this) {
return function(evt) {
_this.loaded = true;
_this._readyToShowLoadingHtml = true;
_this._loadingHtmlElem.className += " pg-loaded";
addClass("pg-loaded", _this._loadingHtmlElem);
if (animationSupport) {
_this._loadingHtmlElem.removeEventListener(animationEvent, listener);
}
Expand All @@ -132,7 +147,7 @@
this._loadingHtmlListener = (function(_this) {
return function() {
_this._readyToShowLoadingHtml = true;
_this._loadingHtmlElem.className = _this._loadingHtmlElem.className.replace(" pg-loading ", "");
removeClass("pg-loading", _this._loadingHtmlElem);
if (transitionSupport) {
_this._loadingHtmlElem.removeEventListener(transitionEvent, _this._loadingHtmlListener);
}
Expand All @@ -144,7 +159,8 @@
this._removingHtmlListener = (function(_this) {
return function() {
_this._loadingHtmlElem.innerHTML = _this._loadingHtmlToDisplay.shift();
_this._loadingHtmlElem.className = _this._loadingHtmlElem.className.replace(" pg-removing ", " pg-loading ");
removeClass("pg-removing", _this._loadingHtmlElem);
addClass("pg-loading", _this._loadingHtmlElem);
if (transitionSupport) {
_this._loadingHtmlElem.removeEventListener(transitionEvent, _this._removingHtmlListener);
return _this._loadingHtmlElem.addEventListener(transitionEvent, _this._loadingHtmlListener);
Expand Down Expand Up @@ -222,9 +238,10 @@
this._readyToShowLoadingHtml = false;
this._loadingHtmlElem.removeEventListener(transitionEvent, this._loadingHtmlListener);
this._loadingHtmlElem.removeEventListener(transitionEvent, this._removingHtmlListener);
this._loadingHtmlElem.className = this._loadingHtmlElem.className.replace(" pg-loading ", "").replace(" pg-removing ", "");
removeClass("pg-loading", this._loadingHtmlElem);
removeClass("pg-removing", this._loadingHtmlElem);
if (transitionSupport) {
this._loadingHtmlElem.className += " pg-removing ";
addClass("pg-removing", this._loadingHtmlElem);
return this._loadingHtmlElem.addEventListener(transitionEvent, this._removingHtmlListener);
} else {
return this._removingHtmlListener();
Expand All @@ -239,22 +256,22 @@
if (this._loadingElem == null) {
return;
}
document.body.className += " pg-loaded";
addClass("pg-loaded", document.body);
if (typeof this._onLoadedCallback === "function") {
this._onLoadedCallback.apply(this);
}
listener = (function(_this) {
return function() {
document.body.removeChild(_this._loadingElem);
document.body.className = document.body.className.replace("pg-loading", "");
removeClass("pg-loading", document.body);
if (animationSupport) {
_this._loadingElem.removeEventListener(animationEvent, listener);
}
return _this._loadingElem = null;
};
})(this);
if (!immediately && animationSupport) {
this._loadingElem.className += " pg-loaded";
addClass("pg-loaded", document.body);
return this._loadingElem.addEventListener(animationEvent, listener);
} else {
return listener();
Expand Down
8 changes: 4 additions & 4 deletions build/please-wait.min.js

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"type": "git",
"url": "git://github.com/Pathgather/please-wait.git"
},
"version": "0.0.3",
"main": "build/please-wait.js",
"version": "0.0.4",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-jshint": "~0.10.0",
Expand Down

0 comments on commit 1f7273e

Please sign in to comment.