Merge pull request #2946 from awesomerobot/master

trying out a new css-only loading spinner
This commit is contained in:
Régis Hanol 2014-11-05 17:44:33 +01:00
commit d22b668393
21 changed files with 66 additions and 42 deletions

View File

@ -19,7 +19,7 @@
</div>
{{#if loading}}
<div class='spinner'></div>
{{loading-spinner}}
{{else}}
{{#if showHtml}}
{{{html_content}}}

View File

@ -9,7 +9,7 @@
<div class="admin-container">
{{#if loading}}
<div class='spinner'></div>
{{loading-spinner}}
{{else}}
{{#if length}}
<table class='admin-flags'>
@ -160,7 +160,7 @@
</tbody>
</table>
{{#if view.loading}}
<div class='spinner'></div>
{{loading-spinner}}
{{/if}}
{{else}}

View File

@ -1,7 +1,7 @@
<p>{{i18n admin.logs.screened_emails.description}}</p>
{{#if loading}}
<div class='spinner'></div>
{{loading-spinner}}
{{else}}
{{#if model.length}}

View File

@ -4,7 +4,7 @@
<br/>
{{#if loading}}
<div class='spinner'></div>
{{loading-spinner}}
{{else}}
{{#if model.length}}

View File

@ -1,7 +1,7 @@
<p>{{i18n admin.logs.screened_urls.description}}</p>
{{#if loading}}
<div class='spinner'></div>
{{loading-spinner}}
{{else}}
{{#if model.length}}

View File

@ -45,7 +45,7 @@
{{#if loading}}
<br/>
<div class='spinner'></div>
{{loading-spinner}}
{{else}}
{{#if model.length}}
{{view "staff-action-logs-list" content=controller}}

View File

@ -7,7 +7,7 @@
</div>
{{#if loading}}
<div class='spinner'></div>
{{loading-spinner}}
{{else}}
<div class='admin-container user-badges'>
<h2>{{i18n admin.badges.grant_badge}}</h2>

View File

@ -38,7 +38,7 @@
</div>
{{#if loading}}
<div class='spinner'></div>
{{loading-spinner}}
{{else}}
{{#if model.length}}
<table class='table'>

View File

@ -510,9 +510,11 @@ export default ObjectController.extend(Discourse.SelectedPostsCount, {
}.property('isPrivateMessage'),
loadingHTML: function() {
return "<div class='spinner'></div>";
return "{{loading-spinner}}";
}.property(),
recoverTopic: function() {
this.get('content').recover();
},

View File

@ -0,0 +1,4 @@
Handlebars.registerHelper('loading-spinner', function(property, options) {
var spinner = "<div class='spinner-wrap'><div class='spinner'><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div></div>";
return new Handlebars.SafeString(spinner);
});

View File

@ -36,11 +36,11 @@
{{/each}}
</div>
{{#if canLoadMore}}
<div class='spinner'></div>
{{loading-spinner}}
{{/if}}
{{else}}
{{#unless userBadgesLoaded}}
<div class='spinner'></div>
{{loading-spinner}}
{{/unless}}
{{/if}}
</div>

View File

@ -56,5 +56,5 @@
</div>
{{/if}}
{{else}}
<div class='spinner'></div>
{{loading-spinner}}
{{/if}}

View File

@ -1,4 +1,4 @@
<div class='spinner'></div>
{{loading-spinner}}
<div class='contents'>

View File

@ -11,7 +11,7 @@
</div>
<div {{bind-attr class="loadingSpinner::hidden"}}>
<div class='spinner'></div>
{{loading-spinner}}
</div>

View File

@ -53,5 +53,5 @@
</div>
{{/if}}
{{else}}
<div class='spinner'></div>
{{loading-spinner}}
{{/if}}

View File

@ -73,7 +73,7 @@
{{render 'topic-progress'}}
{{#if postStream.loadingAbove}}
<div class='spinner'></div>
{{loading-spinner}}
{{/if}}
{{#unless postStream.loadingFilter}}
@ -90,7 +90,7 @@
{{/unless}}
{{#if postStream.loadingBelow}}
<div class='spinner'></div>
{{loading-spinner}}
{{/if}}
</div>
<div id='topic-bottom'></div>
@ -137,13 +137,13 @@
{{/if}}
</div>
{{#if retrying}}
<div class='spinner'></div>
{{loading-spinner}}
{{/if}}
{{/if}}
</div>
{{else}}
<div class='container'>
<div class='spinner'></div>
{{loading-spinner}}
</div>
{{/if}}
{{/if}}

View File

@ -70,7 +70,7 @@
{{/each}}
</table>
{{#if invitesLoading}}
<div class='spinner'></div>
{{loading-spinner}}
{{/if}}
{{else}}

View File

@ -23,7 +23,7 @@
{{/each}}
{{#if loading}}
<div class='spinner'></div>
{{loading-spinner}}
{{/if}}
{{#unless canLoadMore}}
<div class='end-of-stream'></div>

View File

@ -27,5 +27,5 @@
</div>
{{/each}}
{{#if loading}}
<div class='spinner'></div>
{{loading-spinner}}
{{/if}}

View File

@ -26,5 +26,5 @@
</div>
{{/grouped-each}}
{{#if loading}}
<div class='spinner'></div>
{{loading-spinner}}
{{/if}}

View File

@ -148,26 +148,44 @@ body {
}
.spinner {
width: 20px;
margin: 0 auto;
padding: 25px 15px;
background: {
image: image-url("spinner_96.gif");
repeat: no-repeat;
size: 50px;
};
-webkit-animation: spinner .25s;
animation: spinner .25s;
margin-top: 10px;
height: 50px; width: 50px;
margin: 20px auto 0 auto;
-webkit-animation: spin 1s steps(12, end) infinite;
animation: spin 1s steps(12, end) infinite;
}
//loading spinner fade-in
@-webkit-keyframes spinner {
from {opacity: 0}
to {opacity: 1}
}@keyframes fade {
from {opacity: 0}
to {opacity: 1}
.spinner i {
height: 12px; width: 4px;
margin-left: -2px;
display: block;
position: absolute;
left: 50%;
transform-origin: center 25px;
background: $primary;
border-radius: 10px;
}
.spinner i:nth-child(1) { opacity: 0.08; }
.spinner i:nth-child(2) { transform: rotate(30deg); opacity: 0.167; }
.spinner i:nth-child(3) { transform: rotate(60deg); opacity: 0.25; }
.spinner i:nth-child(4) { transform: rotate(90deg); opacity: 0.33; }
.spinner i:nth-child(5) { transform: rotate(120deg); opacity: 0.4167; }
.spinner i:nth-child(6) { transform: rotate(150deg); opacity: 0.5; }
.spinner i:nth-child(7) { transform: rotate(180deg); opacity: 0.583; }
.spinner i:nth-child(8) { transform: rotate(210deg); opacity: 0.67; }
.spinner i:nth-child(9) { transform: rotate(240deg); opacity: 0.75; }
.spinner i:nth-child(10) { transform: rotate(270deg); opacity: 0.833; }
.spinner i:nth-child(11) { transform: rotate(300deg); opacity: 0.9167; }
.spinner i:nth-child(12) { transform: rotate(330deg); opacity: 1; }
@-webkit-keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.avatar-wrapper {