fnp
/
redakcja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0d5ee6c
)
Dodanie planszy ładowania do document_details.html.
author
zuber
<marek@stepniowski.com>
Tue, 26 Jan 2010 21:15:05 +0000
(22:15 +0100)
committer
zuber
<marek@stepniowski.com>
Tue, 26 Jan 2010 21:15:05 +0000
(22:15 +0100)
platforma/static/css/master.css
patch
|
blob
|
history
platforma/static/img/spinner.gif
patch
|
blob
|
history
platforma/static/js/main.js
patch
|
blob
|
history
platforma/templates/wiki/document_details.html
patch
|
blob
|
history
diff --git
a/platforma/static/css/master.css
b/platforma/static/css/master.css
index
5c5587d
..
9d3efec
100755
(executable)
--- a/
platforma/static/css/master.css
+++ b/
platforma/static/css/master.css
@@
-3,6
+3,8
@@
body {
overflow: hidden;
padding: 0;
min-width: 960px;
overflow: hidden;
padding: 0;
min-width: 960px;
+ width: 100%;
+ height: 100%;
}
.vsplitbar {
}
.vsplitbar {
@@
-193,7
+195,7
@@
p { margin: 0;}
overflow: hidden;
}
overflow: hidden;
}
-img {
+
.gallery-image
img {
position: absolute;
-moz-drag: none;
user-select: none;
position: absolute;
-moz-drag: none;
user-select: none;
@@
-201,4
+203,42
@@
img {
-khtml-user-select: none;
-moz-user-select: none;
cursor: pointer;
-khtml-user-select: none;
-moz-user-select: none;
cursor: pointer;
+}
+
+
+#body-wrap {
+ height: 100%;
+ width: 100%;
+}
+#content {
+ height: 100%;
+ width: 100%;
+}
+
+#loading-overlay {
+ background-color: #FFF;
+ position: absolute;
+ z-index: 1000;
+ padding: 0;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+
+#loading-message {
+ position: absolute;
+ height: 20px;
+ width: 120px;
+ left: 50%;
+ margin-left: -60px;
+ top: 50%;
+ margin-top: -10px;
+/* text-align: center;*/
+}
+
+#loading-message img {
+ float: left;
+ margin-right: 10px;
+ margin-top: -6px;
}
\ No newline at end of file
}
\ No newline at end of file
diff --git
a/platforma/static/img/spinner.gif
b/platforma/static/img/spinner.gif
index
f864d5f
..
c69e937
100644
(file)
Binary files a/platforma/static/img/spinner.gif and b/platforma/static/img/spinner.gif differ
diff --git
a/platforma/static/js/main.js
b/platforma/static/js/main.js
index
edd82e3
..
22ec733
100644
(file)
--- a/
platforma/static/js/main.js
+++ b/
platforma/static/js/main.js
@@
-287,41
+287,61
@@
function gallery(element, url) {
}
}
-function transform(editor) {
- $.blockUI({message: 'Ładowanie...'});
+function transform(editor, callback) {
+ if (!callback) {
+ $.blockUI({message: 'Ładowanie...'});
+ }
setTimeout(function() {
xml2html({
xml: editor.getCode(),
success: function(element) {
$('#html-view').html(element);
$.unblockUI();
setTimeout(function() {
xml2html({
xml: editor.getCode(),
success: function(element) {
$('#html-view').html(element);
$.unblockUI();
+ if (callback) {
+ callback();
+ }
}, error: function(text) {
$('#html-view').html('<p class="error">Wystąpił błąd:</p><pre>' + text + '</pre>');
$.unblockUI();
}, error: function(text) {
$('#html-view').html('<p class="error">Wystąpił błąd:</p><pre>' + text + '</pre>');
$.unblockUI();
+ if (callback) {
+ callback();
+ }
}
});
}, 200);
};
}
});
}, 200);
};
-function reverseTransform(editor, cont) {
+function reverseTransform(editor, cont
, errorCont, dontBlock
) {
var serializer = new XMLSerializer();
if ($('#html-view .error').length > 0) {
var serializer = new XMLSerializer();
if ($('#html-view .error').length > 0) {
+ if (errorCont) {
+ errorCont();
+ }
return;
}
return;
}
- $.blockUI({message: 'Ładowanie...'});
+ if (!dontBlock) {
+ $.blockUI({message: 'Ładowanie...'});
+ }
setTimeout(function() {
html2xml({
xml: serializer.serializeToString($('#html-view div').get(0)),
success: function(text) {
editor.setCode(text);
setTimeout(function() {
html2xml({
xml: serializer.serializeToString($('#html-view div').get(0)),
success: function(text) {
editor.setCode(text);
- $.unblockUI();
+ if (!dontBlock) {
+ $.unblockUI();
+ }
if (cont) {
cont();
}
}, error: function(text) {
$('#source-editor').html('<p>Wystąpił błąd:</p><pre>' + text + '</pre>');
if (cont) {
cont();
}
}, error: function(text) {
$('#source-editor').html('<p>Wystąpił błąd:</p><pre>' + text + '</pre>');
- $.unblockUI();
+ if (!dontBlock) {
+ $.unblockUI();
+ }
+ if (errorCont) {
+ errorCont();
+ }
}
});
}, 200);
}
});
}, 200);
@@
-688,19
+708,20
@@
$(function() {
$('#save-cancel').click(function() {
$.unblockUI();
});
$('#save-cancel').click(function() {
$.unblockUI();
});
-
-
$('#simple-view-tab').click(function(
) {
- if ($(
this
).hasClass('active')) {
+
+
function changeTab(callback
) {
+ if ($(
'#simple-view-tab'
).hasClass('active')) {
return;
}
return;
}
- $(
this
).addClass('active');
+ $(
'#simple-view-tab'
).addClass('active');
$('#source-view-tab').removeClass('active');
$('#source-editor').hide();
$('#simple-editor').show();
$('#source-view-tab').removeClass('active');
$('#source-editor').hide();
$('#simple-editor').show();
- transform(editor);
- });
-
- $('#source-view-tab').click(function() {
+ transform(editor, callback);
+ }
+ $('#simple-view-tab').click(function() { changeTab(); });
+
+ $('#source-view-tab').click(function() {
if ($(this).hasClass('active')) {
return;
}
if ($(this).hasClass('active')) {
return;
}
@@
-708,7
+729,7
@@
$(function() {
$('#simple-view-tab').removeClass('active');
$('#simple-editor').hide();
$('#source-editor').show();
$('#simple-view-tab').removeClass('active');
$('#simple-editor').hide();
$('#source-editor').show();
- reverseTransform(editor);
+ reverseTransform(editor);
});
$('#source-editor .toolbar button').click(function(event) {
});
$('#source-editor .toolbar button').click(function(event) {
@@
-727,7
+748,7
@@
$(function() {
$('.toolbar-buttons-container').hide();
$('.toolbar select').change();
$('.toolbar-buttons-container').hide();
$('.toolbar select').change();
- $('#simple-view-tab').click();
+ changeTab(function() { $('#loading-overlay').fadeOut() }, function() { $('#loading-overlay').fadeOut() }, true)
}
});
}
});
diff --git
a/platforma/templates/wiki/document_details.html
b/platforma/templates/wiki/document_details.html
index
10a3af0
..
ad71c84
100644
(file)
--- a/
platforma/templates/wiki/document_details.html
+++ b/
platforma/templates/wiki/document_details.html
@@
-18,6
+18,9
@@
{% endblock %}
{% block maincontent %}
{% endblock %}
{% block maincontent %}
+ <div id="loading-overlay">
+ <div id="loading-message"><img src="{{STATIC_URL}}img/spinner.gif" /><p>Ładowanie</p></div>
+ </div>
<div id="document-meta" style="display:none">
{% for k, v in document.meta.items %}
<div class="{{ k }}">{{ v}}</div>
<div id="document-meta" style="display:none">
{% for k, v in document.meta.items %}
<div class="{{ k }}">{{ v}}</div>