add throbber to wait until text is loaded
authorgibus
Sat, 10 Sep 2011 15:19:29 +0200
changeset 386 555135ac8900
parent 385 c67ddb086074
child 387 801da459c9ce
add throbber to wait until text is loaded
src/cm/locale/bg/LC_MESSAGES/django.mo
src/cm/locale/bg/LC_MESSAGES/django.po
src/cm/locale/en/LC_MESSAGES/django.po
src/cm/locale/es/LC_MESSAGES/django.mo
src/cm/locale/es/LC_MESSAGES/django.po
src/cm/locale/fr/LC_MESSAGES/django.mo
src/cm/locale/fr/LC_MESSAGES/django.po
src/cm/locale/no/LC_MESSAGES/django.mo
src/cm/locale/no/LC_MESSAGES/django.po
src/cm/locale/pt_BR/LC_MESSAGES/django.mo
src/cm/locale/pt_BR/LC_MESSAGES/django.po
src/cm/templates/site/text_view_comments.html
src/cm/templates/site/text_view_frame.html
src/cm/views/texts.py
Binary file src/cm/locale/bg/LC_MESSAGES/django.mo has changed
--- a/src/cm/locale/bg/LC_MESSAGES/django.po	Fri Sep 09 09:49:37 2011 +0200
+++ b/src/cm/locale/bg/LC_MESSAGES/django.po	Sat Sep 10 15:19:29 2011 +0200
@@ -1388,6 +1388,10 @@
 msgid "Text preferences"
 msgstr "Предпочитания за текста"
 
+#: templates/site/text_view_frame.html:93
+msgid "Loading text…"
+msgstr "Зареждане на текст…"
+
 #: templates/site/text_view_frame.html:104
 msgid "Which comments?"
 msgstr "Кой коментар?"
--- a/src/cm/locale/en/LC_MESSAGES/django.po	Fri Sep 09 09:49:37 2011 +0200
+++ b/src/cm/locale/en/LC_MESSAGES/django.po	Sat Sep 10 15:19:29 2011 +0200
@@ -1348,6 +1348,10 @@
 msgid "Text preferences"
 msgstr ""
 
+#: templates/site/text_view_frame.html:93
+msgid "Loading text…"
+msgstr ""
+
 #: templates/site/text_view_frame.html:104
 msgid "Which comments?"
 msgstr ""
Binary file src/cm/locale/es/LC_MESSAGES/django.mo has changed
--- a/src/cm/locale/es/LC_MESSAGES/django.po	Fri Sep 09 09:49:37 2011 +0200
+++ b/src/cm/locale/es/LC_MESSAGES/django.po	Sat Sep 10 15:19:29 2011 +0200
@@ -1460,6 +1460,10 @@
 msgid "Text preferences"
 msgstr "Preferencias de texto"
 
+#: templates/site/text_view_frame.html:93
+msgid "Loading text…"
+msgstr "Cargando texto…"
+
 #: templates/site/text_view_frame.html:104
 msgid "Which comments?"
 msgstr "¿Qué comentarios?"
Binary file src/cm/locale/fr/LC_MESSAGES/django.mo has changed
--- a/src/cm/locale/fr/LC_MESSAGES/django.po	Fri Sep 09 09:49:37 2011 +0200
+++ b/src/cm/locale/fr/LC_MESSAGES/django.po	Sat Sep 10 15:19:29 2011 +0200
@@ -1471,6 +1471,10 @@
 msgid "Text preferences"
 msgstr "Préférences pour le texte"
 
+#: templates/site/text_view_frame.html:93
+msgid "Loading text…"
+msgstr "Chargement du texte…"
+
 #: templates/site/text_view_frame.html:104
 msgid "Which comments?"
 msgstr "Quels commentaires ?"
Binary file src/cm/locale/no/LC_MESSAGES/django.mo has changed
--- a/src/cm/locale/no/LC_MESSAGES/django.po	Fri Sep 09 09:49:37 2011 +0200
+++ b/src/cm/locale/no/LC_MESSAGES/django.po	Sat Sep 10 15:19:29 2011 +0200
@@ -1373,6 +1373,10 @@
 msgid "Text preferences"
 msgstr "Tekstinnstillinger"
 
+#: templates/site/text_view_frame.html:93
+msgid "Loading text…"
+msgstr "Laster tekst…"
+
 #: templates/site/text_view_frame.html:104
 msgid "Which comments?"
 msgstr "Hvilke merknader?"
Binary file src/cm/locale/pt_BR/LC_MESSAGES/django.mo has changed
--- a/src/cm/locale/pt_BR/LC_MESSAGES/django.po	Fri Sep 09 09:49:37 2011 +0200
+++ b/src/cm/locale/pt_BR/LC_MESSAGES/django.po	Sat Sep 10 15:19:29 2011 +0200
@@ -1385,6 +1385,10 @@
 msgid "Text preferences"
 msgstr "Preferências de texto"
 
+#: templates/site/text_view_frame.html:93
+msgid "Loading text…"
+msgstr "Carregar o texto…"
+
 #: templates/site/text_view_frame.html:104
 msgid "Which comments?"
 msgstr "Quais comentários"
--- a/src/cm/templates/site/text_view_comments.html	Fri Sep 09 09:49:37 2011 +0200
+++ b/src/cm/templates/site/text_view_comments.html	Sat Sep 10 15:19:29 2011 +0200
@@ -107,7 +107,7 @@
 <script type="text/javascript" src="{{ CM_MEDIA_PREFIX }}js/site/c_text_view_comments_to_frame.js"></script>
 <script type="text/javascript" src="{{ CM_MEDIA_PREFIX }}js/site/c_text_view_comments.js"></script> 
 {% else %}
-<script type="text/javascript" src="{{ CM_MEDIA_PREFIX }}js/client/c_client-min.js?1315554446"></script> 
+<script type="text/javascript" src="{{ CM_MEDIA_PREFIX }}js/client/c_client-min.js?1315660663"></script> 
 {% endif %}
 
 
--- a/src/cm/templates/site/text_view_frame.html	Fri Sep 09 09:49:37 2011 +0200
+++ b/src/cm/templates/site/text_view_frame.html	Sat Sep 10 15:19:29 2011 +0200
@@ -36,7 +36,7 @@
     <script type="text/javascript" src="{{ CM_MEDIA_PREFIX }}js/client/f_printDialog.js"></script>
     <script type="text/javascript" src="{{ CM_MEDIA_PREFIX }}js/site/f_text_view_frame.js"></script>
 {% else %}
-    <script type="text/javascript" src="{{ CM_MEDIA_PREFIX }}js/client/f_client-min.js?1315554446"></script> 
+    <script type="text/javascript" src="{{ CM_MEDIA_PREFIX }}js/client/f_client-min.js?1315660663"></script> 
 {% endif %}
     <style type="text/css">
         /*
@@ -54,8 +54,14 @@
             padding:        8px 1em !important;
         }
     </style>
-
-
+    <script type="text/javascript">
+      <!--
+      function iframe_onload() {
+        var throbber = document.getElementById('throbber');
+        throbber.style.display = "none";
+      }
+      -->
+    </script>
 
 </head>
 <BODY>
@@ -83,6 +89,9 @@
             <div id="c_text_preferences" class="c_tab">
             </div>
 	    </DIV>
+      <div id="throbber" style="visibility: visible; position: absolute; top: 40%; left: 40%">
+              <img alt="throbber" src="{{ CM_MEDIA_PREFIX }}img/throbber.gif" /><br />{% blocktrans %}Loading text…{% endblocktrans %}
+      </div>
 	    {% url text-view-comments-version text.key text_version.key as frame_url %}
 	             <iframe id="text_view_comments" name="text_view_comments" class="ui-layout-center"
             width="100%" height="100%" frameborder="0" scrolling="auto"
--- a/src/cm/views/texts.py	Fri Sep 09 09:49:37 2011 +0200
+++ b/src/cm/views/texts.py	Sat Sep 10 15:19:29 2011 +0200
@@ -197,7 +197,7 @@
     text = get_text_by_keys_or_404(key)
     register_activity(request, "text_view", text=text)    
     text_version = text.get_latest_version()
-    embed_code = embed_html(key, 'id="text_view_frame" name="text_view_frame"', None, request.META.get('QUERY_STRING'))
+    embed_code = embed_html(key, 'id="text_view_frame" name="text_view_frame" onload="iframe_onload();"', None, request.META.get('QUERY_STRING'))
     template_dict = { 'embed_code':embed_code, 'text' : text, 'text_version' : text_version, 'title' : text_version.title, 'content' : text_version.get_content()}
     return render_to_response('site/text_view.html', template_dict, context_instance=RequestContext(request))