Ssmith has uploaded a new change for review.
https://gerrit.wikimedia.org/r/179200
Change subject: Add loader gif
......................................................................
Add loader gif
Change-Id: Ib1e890814a55b580c78478bd1ab8f50db3e94ebf
---
M src/components/boards/bigEnglish/bigEnglishBoard.html
M src/components/boards/bigEnglish/bigEnglishBoard.js
M src/css/style.css
A src/images/catloader.gif
4 files changed, 55 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash
refs/changes/00/179200/1
diff --git a/src/components/boards/bigEnglish/bigEnglishBoard.html
b/src/components/boards/bigEnglish/bigEnglishBoard.html
index 323f6d2..f7a3cff 100644
--- a/src/components/boards/bigEnglish/bigEnglishBoard.html
+++ b/src/components/boards/bigEnglish/bigEnglishBoard.html
@@ -12,6 +12,11 @@
</div>
</div>
+<div class="loading">
+ <img src="/images/catloader.gif" />
+ <div>Loading Dash<span class="ellipsis"></span></div>
+</div>
+
<div class="row">
<div class="panel panel-transparent">
<div class="panel-body">
diff --git a/src/components/boards/bigEnglish/bigEnglishBoard.js
b/src/components/boards/bigEnglish/bigEnglishBoard.js
index 5209139..40b057e 100644
--- a/src/components/boards/bigEnglish/bigEnglishBoard.js
+++ b/src/components/boards/bigEnglish/bigEnglishBoard.js
@@ -46,6 +46,32 @@
return self.totalRemainingToDate();
});
+ //todo: this could go elsewhere
+ ellipsis = {
+ 'value' : ['', '.', '..', '...', '....'],
+ 'count' : 0,
+ 'run' : false,
+ 'timer' : null,
+ 'element' : '.ellipsis',
+ 'start' : function () {
+ var t = this;
+ this.run = true;
+ this.timer = setInterval(function () {
+ if (t.run) {
+ $(t.element).html(t.value[t.count %
t.value.length]).text();
+ t.count++;
+ }
+ }, 400);
+ },
+ 'stop' : function () {
+ this.run = false;
+ clearInterval(this.timer);
+ this.count = 0;
+ }
+ }
+
+ ellipsis.start();
+
// Only recalculate child boards once per half second
self.dataChanged.extend( { rateLimit: 500 } );
@@ -91,12 +117,14 @@
// Reload the data. For the automatic reload, we're fine
getting
// something from the cache.
self.reloadBigEnglish = function( automatic ){
+ $(".loading").show();
var url = '/data/big-english';
if ( automatic !== true ) {
url += '/?cache=false';
}
$.get( url , function ( dataget ) {
self.loadData( dataget.results,
dataget.timestamp );
+ $(".loading").hide();
});
// Do it every 5 minutes as well
setTimeout( function () {
diff --git a/src/css/style.css b/src/css/style.css
index e60c807..f09127d 100644
--- a/src/css/style.css
+++ b/src/css/style.css
@@ -438,4 +438,26 @@
#distanceToGoalChart {
padding: 0 9px 0 0;
+}
+
+.loading {
+ display: none;
+ position: fixed;
+ top: 360px;
+ left: 50%;
+ margin-top: -96px;
+ margin-left: -96px;
+ background-color: #5bc0de;
+ opacity: .85;
+ border-radius: 25px;
+ width: 192px;
+ height: 192px;
+ padding: 37px;
+ color: #ffffff;
+ z-index: 99999;
+ font-size: 110%;
+}
+
+.loading div {
+ margin-left: 10px;
}
\ No newline at end of file
diff --git a/src/images/catloader.gif b/src/images/catloader.gif
new file mode 100644
index 0000000..6ef0dbf
--- /dev/null
+++ b/src/images/catloader.gif
Binary files differ
--
To view, visit https://gerrit.wikimedia.org/r/179200
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib1e890814a55b580c78478bd1ab8f50db3e94ebf
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: master
Gerrit-Owner: Ssmith <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits