Skip to content

Commit

Permalink
Use Plone default spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
rodfersou committed Mar 2, 2017
1 parent efb2d97 commit 93d4db4
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
1.2b2 (unreleased)
------------------

- Nothing changed yet.
- Use Plone default spinner (fixes `#35`_).
[rodfersou]


1.2b1 (2016-06-21)
Expand Down
11 changes: 9 additions & 2 deletions src/collective/liveblog/browser/templates/update.pt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
i18n:domain="collective.liveblog">
<body>
<metal:block fill-slot="main">
<div id="spinner" tal:condition="view/automatic_updates_enabled"
i18n:translate="">Live updating</div>
<article itemscope itemtype="http://schema.org/BlogPosting">
<header>
<h1 class="documentFirstHeading" itemprop="headline"
Expand Down Expand Up @@ -138,6 +136,11 @@
parser.href = location.href;
parser.pathname = parser.pathname.replace(/\/update*|\/view*/, '');
parser.pathname = parser.pathname + '/recent-updates';
if (typeof require !== 'undefined' && require.defined('mockup-utils')) {
var utils = require('mockup-utils');
var loading = new utils.Loading();
loading.show();
}
$.ajax({
url: parser.href,
success: function (data) {
Expand All @@ -162,6 +165,10 @@
$("#kssPortalMessage").show();
}
}
}).always(function() {
if (typeof require !== 'undefined' && require.defined('mockup-utils')) {
loading.hide();
}
});
}, 1000 * 60);
</script>
Expand Down
11 changes: 9 additions & 2 deletions src/collective/liveblog/browser/templates/view.pt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
i18n:domain="collective.liveblog">
<body>
<metal:block fill-slot="main">
<div id="spinner" tal:condition="view/automatic_updates_enabled"
i18n:translate="">Live updating</div>
<article itemscope itemtype="http://schema.org/BlogPosting">
<header>
<div tal:replace="structure provider:plone.abovecontenttitle" />
Expand Down Expand Up @@ -93,6 +91,11 @@
parser.href = location.href;
parser.pathname = parser.pathname.replace(/\/update*|\/view*/, '');
parser.pathname = parser.pathname + '/recent-updates';
if (typeof require !== 'undefined' && require.defined('mockup-utils')) {
var utils = require('mockup-utils');
var loading = new utils.Loading();
loading.show();
}
$.ajax({
url: parser.href,
success: function (data) {
Expand All @@ -113,6 +116,10 @@
window.location.reload();
}
}
}).always(function() {
if (typeof require !== 'undefined' && require.defined('mockup-utils')) {
loading.hide();
}
});
}, 1000 * 60);
</script>
Expand Down
Binary file removed src/collective/liveblog/static/spinner.gif
Binary file not shown.
5 changes: 0 additions & 5 deletions src/collective/liveblog/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
.portaltype-liveblog #content header {
margin-bottom: 1em;
}
#spinner {
background: url('++resource++collective.liveblog/spinner.gif') no-repeat center right;
float: right;
padding-right: 20px;
}
.microupdate-helpers {
float: right;
}
Expand Down

0 comments on commit 93d4db4

Please sign in to comment.