Comments
Patch
@@ -365,7 +365,7 @@
}
}
-function ajaxScrollInit(urlFormat, lastHash, container) {
+function ajaxScrollInit(urlFormat, lastHash, container, messageFormat) {
updateInitiated = false;
window.onscroll = function () {
@@ -386,6 +386,12 @@
'GET',
function onstart() {
container.lastElementChild.classList.add('scroll-separator');
+
+ var message = {
+ class: 'scroll-loading',
+ text: 'Loading...'
+ };
+ appendHTML(container, format(messageFormat, message));
},
function onsuccess(xml) {
var html = xml.getElementsByTagName('html')[0];
@@ -399,6 +405,7 @@
function onerror(errorText) {
},
function oncomplete() {
+ removeByClassName('scroll-loading');
updateInitiated = false;
}
);
@@ -383,6 +383,26 @@
color: blue;
}
+.scroll-loading {
+ -webkit-animation: change_color 1s linear 0s infinite alternate;
+ -moz-animation: change_color 1s linear 0s infinite alternate;
+ -o-animation: change_color 1s linear 0s infinite alternate;
+ animation: change_color 1s linear 0s infinite alternate;
+}
+
+@-webkit-keyframes change_color {
+ from { background-color: #A0CEFF; } to { }
+}
+@-moz-keyframes change_color {
+ from { background-color: #A0CEFF; } to { }
+}
+@-o-keyframes change_color {
+ from { background-color: #A0CEFF; } to { }
+}
+@keyframes change_color {
+ from { background-color: #A0CEFF; } to { }
+}
+
.scroll-separator {
border-bottom: 1px solid #444 !important;
}