diff --git a/apps/wiki/templates/wiki/tabs/gallery_view_item.html b/apps/wiki/templates/wiki/tabs/gallery_view_item.html
new file mode 100644
index 00000000..7325c825
--- /dev/null
+++ b/apps/wiki/templates/wiki/tabs/gallery_view_item.html
@@ -0,0 +1,4 @@
+{% load i18n %}
+
+ {% trans "Gallery" %}
+
diff --git a/apps/wiki/templates/wiki/tabs/search_view.html b/apps/wiki/templates/wiki/tabs/search_view.html
new file mode 100644
index 00000000..4bf1e893
--- /dev/null
+++ b/apps/wiki/templates/wiki/tabs/search_view.html
@@ -0,0 +1,19 @@
+{% load i18n %}
+
\ No newline at end of file
diff --git a/apps/wiki/templates/wiki/tabs/search_view_item.html b/apps/wiki/templates/wiki/tabs/search_view_item.html
new file mode 100644
index 00000000..dbd4e09a
--- /dev/null
+++ b/apps/wiki/templates/wiki/tabs/search_view_item.html
@@ -0,0 +1,4 @@
+{% load i18n %}
+
+ {% trans "Search and replace" %}
+
diff --git a/apps/wiki/templates/wiki/tabs/summary_view_item.html b/apps/wiki/templates/wiki/tabs/summary_view_item.html
index 79c9f8f1..2b4daeb3 100644
--- a/apps/wiki/templates/wiki/tabs/summary_view_item.html
+++ b/apps/wiki/templates/wiki/tabs/summary_view_item.html
@@ -1,5 +1,5 @@
{% load i18n %}
{% load wiki %}
- {{ document.name|wiki_title }}
+ {% trans "Summary" %}
diff --git a/apps/wiki/views.py b/apps/wiki/views.py
index b78959fb..b57347c2 100644
--- a/apps/wiki/views.py
+++ b/apps/wiki/views.py
@@ -84,6 +84,7 @@ def editor(request, name, template_name='wiki/document_details.html'):
"text_save": DocumentTextSaveForm(prefix="textsave"),
"add_tag": DocumentTagForm(prefix="addtag"),
},
+ 'REDMINE_URL': settings.REDMINE_URL,
})
@@ -113,6 +114,7 @@ def editor_readonly(request, name, template_name='wiki/document_details_readonly
'document_name': document.name,
'document_info': dict(document.info(), readonly=True),
'document_meta': document.meta,
+ 'REDMINE_URL': settings.REDMINE_URL,
})
@@ -155,7 +157,13 @@ def text(request, name):
comment = form.cleaned_data['comment']
if form.cleaned_data['stage_completed']:
comment += '\n#stage-finished: %s\n' % form.cleaned_data['stage_completed']
- author = "%s <%s>" % (form.cleaned_data['author_name'], form.cleaned_data['author_email'])
+ if request.user.is_authenticated():
+ author_name = request.user
+ author_email = request.user.email
+ else:
+ author_name = form.cleaned_data['author_name']
+ author_email = form.cleaned_data['author_email']
+ author = "%s <%s>" % (author_name, author_email)
storage.put(document, author=author, comment=comment, parent=revision)
document = storage.get(name)
return JSONResponse({
diff --git a/lib/vstorage/__init__.py b/lib/vstorage/__init__.py
index 843bb6b7..84d8ee7b 100644
--- a/lib/vstorage/__init__.py
+++ b/lib/vstorage/__init__.py
@@ -147,10 +147,18 @@ class VersionedStorage(object):
self.repo = mercurial.hg.repository(self.ui, self.repo_path)
def _file_path(self, title, type='.xml'):
- return os.path.join(self.path, urlquote(title, safe='')) + type
+ """ Return plain version if exists in repo, add extension otherwise. """
+ path = os.path.join(self.path, urlquote(title, safe=''))
+ if type and self._title_to_file(title, '') not in self.repo['tip']:
+ path += type
+ return path
def _title_to_file(self, title, type=".xml"):
- return os.path.join(self.repo_prefix, urlquote(title, safe='')) + type
+ """ Return plain version if exists in repo, add extension otherwise. """
+ path = os.path.join(self.repo_prefix, urlquote(title, safe=''))
+ if type and path not in self.repo['tip']:
+ path += type
+ return path
def _file_to_title(self, filename):
assert filename.startswith(self.repo_prefix)
diff --git a/redakcja/settings/compress.py b/redakcja/settings/compress.py
index 7207f1b9..5e8d721f 100644
--- a/redakcja/settings/compress.py
+++ b/redakcja/settings/compress.py
@@ -51,6 +51,7 @@ COMPRESS_JS = {
'js/wiki/view_editor_source.js',
'js/wiki/view_editor_wysiwyg.js',
'js/wiki/view_gallery.js',
+ 'js/wiki/view_search.js',
'js/wiki/view_column_diff.js',
),
'output_filename': 'compressed/detail_scripts_?.js',
diff --git a/redakcja/static/css/filelist.css b/redakcja/static/css/filelist.css
index c398c45e..b2f51ed2 100644
--- a/redakcja/static/css/filelist.css
+++ b/redakcja/static/css/filelist.css
@@ -64,4 +64,9 @@ a, a:visited, a:active {
a:hover {
text-decoration: underline;
-}
\ No newline at end of file
+}
+
+
+#loading-overlay {
+ display: none;
+}
diff --git a/redakcja/static/css/gallery.css b/redakcja/static/css/gallery.css
index 97c9c12c..9c6e3a59 100644
--- a/redakcja/static/css/gallery.css
+++ b/redakcja/static/css/gallery.css
@@ -1,18 +1,27 @@
-/* =========== */
-/* = Gallery = */
-/* =========== */
-
-#side-gallery {
+#sidebar {
+ display:none;
position: absolute;
- /* overflow: hidden; */
top: 0px;
right: 0px;
bottom: 0px;
width: 480px;
- display: none;
background-color: #FFF;
}
+#side-search {
+ height: 100%;
+ display: none;
+ background-color: #C1C1C1;
+}
+
+#side-search p {
+ padding: .5em;
+}
+
+/* =========== */
+/* = Gallery = */
+/* =========== */
+
#side-gallery .error_message
{
background-color: white;
diff --git a/redakcja/static/css/master.css b/redakcja/static/css/master.css
index c14a3dca..cbfe66ab 100644
--- a/redakcja/static/css/master.css
+++ b/redakcja/static/css/master.css
@@ -87,6 +87,20 @@ body {
font-weight: bold;
}
+#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;
@@ -103,16 +117,22 @@ body {
color: #222;
}
-#tabs {
+.tabs {
overflow: hidden;
margin: 0;
padding: 0;
height: 31px;
border: 0px;
padding-left: 1em;
+ float: left;
+}
+
+#tabs-right {
+ float: right;
+ padding-right: 1em;
}
-#tabs li {
+.tabs li {
height: 18px;
margin-top: 6px;
margin-bottom: 0px;
@@ -143,7 +163,7 @@ body {
-webkit-border-bottom-right-radius: 0px;
}
-#tabs li.active {
+.tabs li.active {
background-color: #C1C1C1;
}
diff --git a/redakcja/static/js/button_scripts.js b/redakcja/static/js/button_scripts.js
index 2a585dc5..4aa0c95a 100644
--- a/redakcja/static/js/button_scripts.js
+++ b/redakcja/static/js/button_scripts.js
@@ -48,9 +48,8 @@ function ScriptletCenter()
{
this.scriptlets = {};
- this.scriptlets['insert_tag'] = function(context, params, done)
+ this.scriptlets['insert_tag'] = function(context, params, text, move_forward, done)
{
- var text = this.XMLEditorSelectedText(context);
var start_tag = '<'+params.tag;
var move_cursor = false;
@@ -95,18 +94,14 @@ function ScriptletCenter()
}
}
- this.XMLEditorReplaceSelectedText(context, output);
-
- try {
- if (move_cursor) {
- this.XMLEditorMoveCursorForward(context, params.tag.length+2);
- }
- } catch(e) {}
+ if (move_cursor) {
+ move_forward += params.tag.length+2;
+ }
- done();
+ done(output, move_forward);
}.bind(this);
- this.scriptlets['lineregexp'] = function(context, params, done) {
+ this.scriptlets['lineregexp'] = function(context, params, text, move_forward, done) {
var self = this;
var exprs = $.map(params.exprs, function(expr) {
@@ -120,8 +115,7 @@ function ScriptletCenter()
});
var partial = true;
- var text = this.XMLEditorSelectedText(context);
- if(!text) return done();
+ if(!text) done(text, move_forward);
var changed = 0;
var lines = text.split('\n');
@@ -138,15 +132,15 @@ function ScriptletCenter()
if(old_line != line) changed += 1;
return line;
}, function(newlines) {
- if(changed > 0) {
- self.XMLEditorReplaceSelectedText(context, newlines.join('\n') );
- };
+ if(changed > 0) {
+ text = newlines.join('\n');
+ };
- done();
+ done(text, move_forward);
});
}.bind(this);
- this.scriptlets['fulltextregexp'] = function(context, params, done) {
+ this.scriptlets['fulltextregexp'] = function(context, params, text, move_forward, done) {
var self = this;
var exprs = $.map(params.exprs, function(expr) {
@@ -160,47 +154,39 @@ function ScriptletCenter()
};
});
- var text = this.XMLEditorSelectedText(context);
- if(!text) return done();
+ if(!text) done(text, move_forward);
var original = text;$
nblck_each(exprs, function(expr, index) {
$progress.html(600 + index);
text = text.replace(expr.rx, expr.repl);
}, function() {
- if( original != text) {
- self.XMLEditorReplaceSelectedText(context, text);
- }
-
- done();
+ done(text, move_forward);
});
}.bind(this);
- this.scriptlets['macro'] = function(context, params, done) {
+ this.scriptlets['macro'] = function(context, params, text, move_forward, done) {
var self = this;
var i = 0;
- function next() {
+ function next(text, move_forward) {
if (i < params.length) {
var e = params[i];
i = i + 1;
- self.scriptlets[e[0]](context, e[1], next);
+ self.scriptlets[e[0]](context, e[1], text, move_forward, next);
}
else {
- done();
+ done(text, move_forward);
}
};
- next();
+ next(text, move_forward);
}.bind(this);
- this.scriptlets['lowercase'] = function(context, params, done)
+ this.scriptlets['lowercase'] = function(context, params, text, move_forward, done)
{
- var text = this.XMLEditorSelectedText(context);
-
- if(!text) return;
+ if(!text) done(text, move_forward);
- var repl = '';
var lcase = text.toLowerCase();
var ucase = text.toUpperCase();
@@ -214,18 +200,14 @@ function ScriptletCenter()
return '';
}
});
- repl = words.join(' ');
+ text = words.join(' ');
}
- if(repl != text) this.XMLEditorReplaceSelectedText(context, repl);
-
- done();
+ done(text, move_forward);
}.bind(this);
- this.scriptlets["insert_stanza"] = function(context, params, done) {
- var text = this.XMLEditorSelectedText(context);
-
+ this.scriptlets["insert_stanza"] = function(context, params, text, move_forward, done) {
if(text) {
var verses = text.split('\n');
text = ''; var buf = ''; var ebuf = '';
@@ -243,14 +225,12 @@ function ScriptletCenter()
}
}
text = text + buf + '\n' + ebuf;
- this.XMLEditorReplaceSelectedText(context, text);
}
-
- if (!text) {
- this.XMLEditorMoveCursorForward(context, params.tag.length + 2);
+ else {
+ move_forward += params.tag.length + 2;
}
- done();
+ done(text, move_forward);
}.bind(this);
}
@@ -267,10 +247,20 @@ ScriptletCenter.prototype.callInteractive = function(opts) {
$.blockUI({message: $progress, showOverlay: false});
- self.scriptlets[opts.action](opts.context, opts.extra, function(){
+ var input = self.XMLEditorSelectedText(opts.context);
+ self.scriptlets[opts.action](opts.context, opts.extra, input, 0, function(output, move_forward){
/*if(timer)
clearTimeout(timer);
else */
+ if (input != output) {
+ self.XMLEditorReplaceSelectedText(opts.context, output)
+ }
+ if (move_forward) {
+ try {
+ self.XMLEditorMoveCursorForward(opts.context, move_forward)
+ }
+ catch(e) {}
+ }
$.unblockUI(); // done
});
}
diff --git a/redakcja/static/js/lib/codemirror/codemirror.js b/redakcja/static/js/lib/codemirror/codemirror.js
index 8c62dab9..8475989c 100644
--- a/redakcja/static/js/lib/codemirror/codemirror.js
+++ b/redakcja/static/js/lib/codemirror/codemirror.js
@@ -177,8 +177,8 @@ var CodeMirror = (function(){
replaceChars: function(text, start, end) {
this.editor.replaceChars(text, start, end);
},
- getSearchCursor: function(string, fromCursor) {
- return this.editor.getSearchCursor(string, fromCursor);
+ getSearchCursor: function(string, fromCursor, regexp, case_sensitive) {
+ return this.editor.getSearchCursor(string, fromCursor, regexp, case_sensitive);
},
undo: function() {this.editor.history.undo();},
diff --git a/redakcja/static/js/lib/codemirror/editor.js b/redakcja/static/js/lib/codemirror/editor.js
index f5fe8417..4eb6d099 100644
--- a/redakcja/static/js/lib/codemirror/editor.js
+++ b/redakcja/static/js/lib/codemirror/editor.js
@@ -223,7 +223,29 @@ var Editor = (function(){
// indicating whether anything was found, and can be called again to
// skip to the next find. Use the select and replace methods to
// actually do something with the found locations.
- function SearchCursor(editor, string, fromCursor) {
+ function SearchCursor(editor, string, fromCursor, regexp, case_sensitive) {
+
+ function casedIndexOf(hay, needle, case_sensitive) {
+ if (case_sensitive)
+ return hay.indexOf(needle);
+ else
+ return hay.toLowerCase().indexOf(needle.toLowerCase())
+ }
+
+ function casedLastIndexOf(hay, needle, case_sensitive) {
+ if (case_sensitive)
+ return hay.lastIndexOf(needle);
+ else
+ return hay.toLowerCase().lastIndexOf(needle.toLowerCase());
+ }
+
+ function casedEqual(a, b, case_sensitive) {
+ if (case_sensitive)
+ return a == b;
+ else
+ return a.toLowerCase() == b.toLowerCase();
+ }
+
this.editor = editor;
this.history = editor.history;
this.history.commit();
@@ -252,7 +274,8 @@ var Editor = (function(){
// For one-line strings, searching can be done simply by calling
// indexOf on the current line.
function() {
- var match = cleanText(self.history.textAfter(self.line).slice(self.offset)).indexOf(string);
+ var match = casedIndexOf(cleanText(self.history.textAfter(self.line).slice(self.offset)),
+ string, case_sensitive);
if (match > -1)
return {from: {node: self.line, offset: self.offset + match},
to: {node: self.line, offset: self.offset + match + string.length}};
@@ -262,19 +285,19 @@ var Editor = (function(){
// end of the line and the last match starts at the start.
function() {
var firstLine = cleanText(self.history.textAfter(self.line).slice(self.offset));
- var match = firstLine.lastIndexOf(target[0]);
+ var match = casedLastIndexOf(firstLine, target[0], case_sensitive);
if (match == -1 || match != firstLine.length - target[0].length)
return false;
var startOffset = self.offset + match;
var line = self.history.nodeAfter(self.line);
for (var i = 1; i < target.length - 1; i++) {
- if (cleanText(self.history.textAfter(line)) != target[i])
+ if (!casedEqual(cleanText(self.history.textAfter(line)), target[i], case_sensitive))
return false;
line = self.history.nodeAfter(line);
}
- if (cleanText(self.history.textAfter(line)).indexOf(target[target.length - 1]) != 0)
+ if (casedIndexOf(cleanText(self.history.textAfter(line)), target[target.length - 1], case_sensitive) != 0)
return false;
return {from: {node: self.line, offset: startOffset},
@@ -619,8 +642,8 @@ var Editor = (function(){
offset: lastLine.length};
},
- getSearchCursor: function(string, fromCursor) {
- return new SearchCursor(this, string, fromCursor);
+ getSearchCursor: function(string, fromCursor, regexp, case_sensitive) {
+ return new SearchCursor(this, string, fromCursor, regexp, case_sensitive);
},
// Re-indent the whole buffer
diff --git a/redakcja/static/js/wiki/base.js b/redakcja/static/js/wiki/base.js
index 61a3949b..de1d8e5d 100644
--- a/redakcja/static/js/wiki/base.js
+++ b/redakcja/static/js/wiki/base.js
@@ -111,7 +111,7 @@
if($tab.length != 1)
$tab = $(DEFAULT_PERSPECTIVE);
- var $old = $('#tabs li').filter('.active');
+ var $old = $tab.closest('.tabs').find('.active');
$old.each(function(){
$(this).removeClass('active');
diff --git a/redakcja/static/js/wiki/dialog_save.js b/redakcja/static/js/wiki/dialog_save.js
index 916f3260..aa9258d5 100644
--- a/redakcja/static/js/wiki/dialog_save.js
+++ b/redakcja/static/js/wiki/dialog_save.js
@@ -28,9 +28,10 @@
var self = this;
self.$elem.block({
- message: "Zapisywanie...",
+ message: "Zapisywanie...
ukryj ",
fadeIn: 0,
});
+ $.wiki.blocking = self.$elem;
try {
diff --git a/redakcja/static/js/wiki/loader.js b/redakcja/static/js/wiki/loader.js
index e2d4d2b4..42561157 100644
--- a/redakcja/static/js/wiki/loader.js
+++ b/redakcja/static/js/wiki/loader.js
@@ -17,10 +17,6 @@ $(function()
function initialize()
{
- gallery = new $.wiki.ScanGalleryPerspective({
- doc: CurrentDocument, id: "ScanGalleryPerspective"
- });
-
$(document).keydown(function(event) {
console.log("Received key:", event);
});
@@ -36,7 +32,7 @@ $(function()
/*
* TABS
*/
- $('#tabs li').live('click', function(event, callback) {
+ $('.tabs li').live('click', function(event, callback) {
$.wiki.switchToTab(this);
});
@@ -62,19 +58,19 @@ $(function()
$('.vsplitbar').toggle(
function() {
$.wiki.state.perspectives.ScanGalleryPerspective.show = true;
- $('#side-gallery').show();
- $('.vsplitbar').css('right', 480).addClass('.active');
+ $('#sidebar').show();
+ $('.vsplitbar').css('right', 480).addClass('active');
$('#editor .editor').css('right', 510);
$(window).resize();
- gallery.onEnter();
+ $.wiki.perspectiveForTab('#tabs-right .active').onEnter();
},
function() {
$.wiki.state.perspectives.ScanGalleryPerspective.show = false;
- $('#side-gallery').hide();
+ $('#sidebar').hide();
$('.vsplitbar').css('right', 0).removeClass('active');
$('#editor .editor').css('right', 30);
$(window).resize();
- gallery.onExit();
+ $.wiki.perspectiveForTab('#tabs-right .active').onExit();
}
);
@@ -137,6 +133,6 @@ $(function()
/*
* Initialize all perspectives
*/
- initAll( $.makeArray($('ol#tabs li')), initialize);
+ initAll( $.makeArray($('.tabs li')), initialize);
console.log(location.hash);
});
diff --git a/redakcja/static/js/wiki/view_editor_source.js b/redakcja/static/js/wiki/view_editor_source.js
index 9fc99227..0597140d 100644
--- a/redakcja/static/js/wiki/view_editor_source.js
+++ b/redakcja/static/js/wiki/view_editor_source.js
@@ -100,6 +100,10 @@
console.log('Exiting', this.doc);
this.doc.setText(this.codemirror.getCode());
+ if ($('.vsplitbar').hasClass('active') && $('#SearchPerspective').hasClass('active')) {
+ $.wiki.switchToTab('#ScanGalleryPerspective');
+ }
+
if(success) success();
}
diff --git a/redakcja/static/js/wiki/view_gallery.js b/redakcja/static/js/wiki/view_gallery.js
index 86793488..ec486bc0 100644
--- a/redakcja/static/js/wiki/view_gallery.js
+++ b/redakcja/static/js/wiki/view_gallery.js
@@ -225,6 +225,8 @@
$.wiki.Perspective.prototype.onEnter.call(this);
+ $('.vsplitbar').not('.active').trigger('click');
+
this.doc.refreshGallery({
success: function(doc, data){
self.$image.show();
diff --git a/redakcja/static/js/wiki/view_search.js b/redakcja/static/js/wiki/view_search.js
new file mode 100644
index 00000000..34393dc4
--- /dev/null
+++ b/redakcja/static/js/wiki/view_search.js
@@ -0,0 +1,113 @@
+(function($){
+
+ /*
+ * Perspective
+ */
+ function SearchPerspective(options){
+ var old_callback = options.callback || function() { };
+
+ this.noupdate_hash_onenter = true;
+
+ options.callback = function(){
+ var self = this;
+
+ this.editor = null;
+ this.$element = $("#side-search");
+ this.$searchInput = $('#search-input', this.$element);
+ this.$replaceInput = $('#replace-input', this.$element);
+ this.$searchButton = $('#search-button', this.$element);
+ this.$replaceButton = $('#replace-button', this.$element);
+
+ this.$replaceButton.attr("disabled","disabled");
+ this.options = Array();
+
+ // handlers
+ this.$searchInput.change(function(event){
+ self.searchCursor = null;
+ });
+ this.$replaceInput.change(function(event){
+ self.searchCursor = null;
+ });
+
+ $("#side-search input:checkbox").each(function() {
+ self.options[this.id] = this.checked;
+ }).change(function(){
+ self.options[this.id] = this.checked;
+ self.searchCursor = null;
+ });
+
+ this.$searchButton.click(function(){
+ if (!self.search())
+ alert('Brak wyników.');
+ });
+
+ this.$replaceButton.click(function(){
+ self.replace();
+ });
+
+ old_callback.call(this);
+ };
+
+ $.wiki.Perspective.call(this, options);
+ };
+
+ SearchPerspective.prototype = new $.wiki.Perspective();
+
+ SearchPerspective.prototype.search = function(){
+ var self = this;
+ var query = self.$searchInput.val();
+
+ if (!self.editor)
+ self.editor = $.wiki.perspectiveForTab('#CodeMirrorPerspective').codemirror
+
+ if (!self.searchCursor) {
+ self.searchCursor = self.editor.getSearchCursor(
+ self.$searchInput.val(),
+ self.options['search-from-cursor'],
+ self.options['search-regexp'],
+ self.options['search-case-sensitive']
+ );
+ }
+ if (self.searchCursor.findNext()) {
+ self.searchCursor.select();
+ self.$replaceButton.removeAttr("disabled");
+ return true;
+ }
+ else {
+ self.searchCursor = null;
+ this.$replaceButton.attr("disabled","disabled");
+ return false;
+ }
+ };
+
+ SearchPerspective.prototype.replace = function(){
+ var self = this;
+ var query = self.$replaceInput.val();
+
+ if (!self.searchCursor) {
+ self.search();
+ }
+ else {}
+ self.searchCursor.select();
+ self.searchCursor.replace(query);
+ self.search();
+ };
+
+ SearchPerspective.prototype.onEnter = function(success, failure){
+ var self = this;
+
+ $.wiki.Perspective.prototype.onEnter.call(this);
+ self.$searchCursor = null;
+
+ $('.vsplitbar').not('.active').trigger('click');
+ if ($.wiki.activePerspective() != 'CodeMirrorPerspective')
+ $.wiki.switchToTab('#CodeMirrorPerspective');
+ };
+
+ SearchPerspective.prototype.onExit = function(success, failure) {
+
+ };
+
+ $.wiki.SearchPerspective = SearchPerspective;
+
+})(jQuery);
\ No newline at end of file
diff --git a/redakcja/static/js/wiki/wikiapi.js b/redakcja/static/js/wiki/wikiapi.js
index ad31af3f..b6388f11 100644
--- a/redakcja/static/js/wiki/wikiapi.js
+++ b/redakcja/static/js/wiki/wikiapi.js
@@ -222,6 +222,8 @@
success: function(data) {
var changed = false;
+ $('#header').removeClass('saving');
+
if (data.text) {
self.text = data.text;
self.revision = data.revision;
@@ -233,17 +235,31 @@
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": "
Nie udaÅo siÄ zapisaÄ - bÅÄ
d serwera.
"
- });
- };
+ if ($('#header').hasClass('saving')) {
+ $('#header').removeClass('saving');
+ $.blockUI({
+ message: "
Nie udaÅo siÄ zapisaÄ zmian. OK
"
+ })
+ }
+ else {
+ try {
+ params['failure'](self, $.parseJSON(xhr.responseText));
+ }
+ catch (e) {
+ params['failure'](self, {
+ "__message": "
Nie udaÅo siÄ zapisaÄ - bÅÄ
d serwera.
"
+ });
+ };
+ }
}
});
+
+ $('#save-hide').click(function(){
+ $('#header').addClass('saving');
+ $.unblockUI();
+ $.wiki.blocking.unblock();
+ });
}; /* end of save() */
WikiDocument.prototype.publish = function(params) {
diff --git a/redakcja/templates/base.html b/redakcja/templates/base.html
index 749fd2a6..971213fe 100644
--- a/redakcja/templates/base.html
+++ b/redakcja/templates/base.html
@@ -10,7 +10,7 @@
-
+
{% trans "Loading" %}