From 9e3b8dad3a369c212c5d7d3cc0af7fc4f3cf2b6c Mon Sep 17 00:00:00 2001 From: zuber Date: Tue, 26 Jan 2010 22:15:05 +0100 Subject: [PATCH] =?utf8?q?Dodanie=20planszy=20=C5=82adowania=20do=20docume?= =?utf8?q?nt=5Fdetails.html.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- platforma/static/css/master.css | 42 +++++++++++++- platforma/static/img/spinner.gif | Bin 2767 -> 2608 bytes platforma/static/js/main.js | 53 ++++++++++++------ .../templates/wiki/document_details.html | 3 + 4 files changed, 81 insertions(+), 17 deletions(-) diff --git a/platforma/static/css/master.css b/platforma/static/css/master.css index 5c5587d5..9d3efeca 100755 --- a/platforma/static/css/master.css +++ b/platforma/static/css/master.css @@ -3,6 +3,8 @@ body { overflow: hidden; padding: 0; min-width: 960px; + width: 100%; + height: 100%; } .vsplitbar { @@ -193,7 +195,7 @@ p { margin: 0;} overflow: hidden; } -img { +.gallery-image img { position: absolute; -moz-drag: none; user-select: none; @@ -201,4 +203,42 @@ img { -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 diff --git a/platforma/static/img/spinner.gif b/platforma/static/img/spinner.gif index f864d5fd38b7466c76b5a36dc0e3e9455c0126e2..c69e937232b24ea30f01c68bbd2ebc798dcecfcb 100644 GIT binary patch literal 2608 zcmdVcdr(tX9tZGC9yiG~=H_*Q-0%n(kWqP*D#hw{AQu8;1%gl-Hrf&{2?48KX;hHy z3Ze*zEz4t3XdUFyLbNPU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zyLi>X3c7>F!|Jyn`+5{LG=E`sIQbHA8!=`uday6D6Y zNtVL?j^`6A%UuwO!`}j#s~H?w=P<5}Z2)*PPx|5q$MM+1K6_d_cie9JVArbrB2sRy zOl**1Mc+|zLM>munG#O|##RApuODr^1+pL-?SHX+D6Dz_@%-Oo(fM&hHYZ-jWU5jf z&nBYG;>F6&Y`veoLdZ@0WyrDsuXOP)9g*C`A(+R`Ryc2+9w_DJNaf@Dzg?~N{uI_} zjV(!yygvrGv#KF*Mt{6H^v1Ve=hQyF2^E~bd#&iZg;(%dS^nM;oGSF1Y^&rY}Ian zFrp%SBGPyN{Z?t%Mo#!qgLQ2)k{>KAv?=zezKN*qPRf>^4QjcWgyxiC}7Vb6vGrBLR(1J&B%*gb{`!Jljb^2%jB$ zFBNUHANC6Q?0~M}cVtgk_;_DAB-BE?2dP z(C9OIXza3Ao-@UyqX%`5cjg#cHl!uHq;&?~JO{eE+A2KSSD)s8v&CiV$kV$A=DG@i z;6JY7z*8oPdj@bbJQoTAENW#ls(ucbGA#yhN>zbWqBTbLl>rGqOAY+` z=psSt8VQE=9+X8^$l@oeDzRvja79ry3nvLcOR7+)bIFyJVoz4}URM-47_u>V zY*^e(o`?|l++*Y0uQ#&dKapW1o?J{jx+*_gKV^cW+W87KI7hZ5viXv$$=1IR^Z~yA XWBrHU7iSEP8X8hQyAJO{V6g1pwSv80 diff --git a/platforma/static/js/main.js b/platforma/static/js/main.js index edd82e35..22ec7332 100644 --- 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(); + if (callback) { + callback(); + } }, error: function(text) { $('#html-view').html('

Wystąpił błąd:

' + text + '
'); $.unblockUI(); + if (callback) { + callback(); + } } }); }, 200); }; -function reverseTransform(editor, cont) { +function reverseTransform(editor, cont, errorCont, dontBlock) { var serializer = new XMLSerializer(); if ($('#html-view .error').length > 0) { + if (errorCont) { + errorCont(); + } 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); - $.unblockUI(); + if (!dontBlock) { + $.unblockUI(); + } if (cont) { cont(); } }, error: function(text) { $('#source-editor').html('

Wystąpił błąd:

' + text + '
'); - $.unblockUI(); + if (!dontBlock) { + $.unblockUI(); + } + if (errorCont) { + errorCont(); + } } }); }, 200); @@ -688,19 +708,20 @@ $(function() { $('#save-cancel').click(function() { $.unblockUI(); }); - - $('#simple-view-tab').click(function() { - if ($(this).hasClass('active')) { + + function changeTab(callback) { + if ($('#simple-view-tab').hasClass('active')) { return; } - $(this).addClass('active'); + $('#simple-view-tab').addClass('active'); $('#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; } @@ -708,7 +729,7 @@ $(function() { $('#simple-view-tab').removeClass('active'); $('#simple-editor').hide(); $('#source-editor').show(); - reverseTransform(editor); + reverseTransform(editor); }); $('#source-editor .toolbar button').click(function(event) { @@ -727,7 +748,7 @@ $(function() { $('.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 10a3af09..ad71c847 100644 --- a/platforma/templates/wiki/document_details.html +++ b/platforma/templates/wiki/document_details.html @@ -18,6 +18,9 @@ {% endblock %} {% block maincontent %} +
+

Ładowanie

+