Added an option to hide the saving process, allowing the user to
save their work locally in case of connection problems.
| {% trans "Version" %}: <span id="document-revision">{% trans "Unknown" %}</span>
{% if not readonly %}
| <button style="margin-left: 6px" id="save-button">{% trans "Save" %}</button>
| {% trans "Version" %}: <span id="document-revision">{% trans "Unknown" %}</span>
{% if not readonly %}
| <button style="margin-left: 6px" id="save-button">{% trans "Save" %}</button>
+ <span id='save-attempt-info'>{% trans "Save attempt in progress" %}</span>
{% endif %}
</div>
<ol id="tabs">
{% endif %}
</div>
<ol id="tabs">
+#header.saving {
+ background-color: #E1C1C1;
+}
+#header.saving #save-button {
+ display: none;
+}
+#save-attempt-info {
+ color: #801000;
+ display: none;
+}
+.saving #save-attempt-info {
+ display: inline;
+}
+
#header h1, #header h1 a {
margin: 0;
padding: 0;
#header h1, #header h1 a {
margin: 0;
padding: 0;
var self = this;
self.$elem.block({
var self = this;
self.$elem.block({
- message: "Zapisywanie...",
+ message: "Zapisywanie... <br/><button id='save-hide'>ukryj</button>",
+ $.wiki.blocking = self.$elem;
success: function(data) {
var changed = false;
success: function(data) {
var changed = false;
+ $('#header').removeClass('saving');
+
if (data.text) {
self.text = data.text;
self.revision = data.revision;
if (data.text) {
self.text = data.text;
self.revision = data.revision;
params['success'](self, changed, ((changed && "Udało się zapisać :)") || "Twoja wersja i serwera jest identyczna"));
},
error: function(xhr) {
params['success'](self, changed, ((changed && "Udało się zapisać :)") || "Twoja wersja i serwera jest identyczna"));
},
error: function(xhr) {
- try {
- params['failure'](self, $.parseJSON(xhr.responseText));
- }
- catch (e) {
- params['failure'](self, {
- "__message": "<p>Nie udało się zapisać - błąd serwera.</p>"
- });
- };
+ if ($('#header').hasClass('saving')) {
+ $('#header').removeClass('saving');
+ $.blockUI({
+ message: "<p>Nie udało się zapisać zmian. <br/><button onclick='$.unblockUI()'>OK</button></p>"
+ })
+ }
+ else {
+ try {
+ params['failure'](self, $.parseJSON(xhr.responseText));
+ }
+ catch (e) {
+ params['failure'](self, {
+ "__message": "<p>Nie udało się zapisać - błąd serwera.</p>"
+ });
+ };
+ }
+
+ $('#save-hide').click(function(){
+ $('#header').addClass('saving');
+ $.unblockUI();
+ $.wiki.blocking.unblock();
+ });
}; /* end of save() */
WikiDocument.prototype.publish = function(params) {
}; /* end of save() */
WikiDocument.prototype.publish = function(params) {