Changeset 191 in t29-www for shared/js


Ignore:
Timestamp:
Sep 5, 2010, 9:25:46 PM (9 years ago)
Author:
sven
Message:

Translation System (alles nur in /en):

  • Alle Texte auf englischen Seiten in Absaetze gepackt, damit bearbeitbar
  • Extraseiten aufgeraeumt (uralte Weiterleitungen geloescht)
  • Translation-System-Verbesserung: "Enabled"-Text erst mit Script anzeigen
  • Verbessertes Preloader-System in tools.js
  • Sidebar-Boxen auch auf Extraseiten anzeigen
  • Kleine Designverbesserungen
File:
1 edited

Legend:

Unmodified
Added
Removed
  • shared/js/tools.js

    r189 r191  
    203203 * @returns immediately returns, asynchronous content loading
    204204 **/
    205 t29.start_tr = function(success_function) {
     205if(!t29.tr) t29.tr = {}; // translation system namespace
     206t29.tr.preloader = {}; // namespace for this preloading system
     207t29.tr.preloader.enabled_string = // text for sidebar with enabled tr system
     208        "<h3>Improve this page</h3><p>Simply click on any paragraph to correct it. Thank you!</p>"
     209        +"<span class='button gray'>Finished!</span>";
     210
     211t29.tr.preloader.start = function(success_function) {
    206212        // kruder Hack, um die Ladezeit zu ueberstehen: schon mal Designaenderung
    207213        $("body").toggleClass("tr-enabled tr-disabled");
     
    212218                $("<style type='text/css'/>").html(css).appendTo("head");
    213219        });*/
     220       
     221        // text, nur einaml und so. bessere bedingung - schauen ob schon mal gestartet wurde.
     222        if(!$("#sidebar-tr .tr-enabled").length) {
     223                //$('#sidebar-tr').wrapInner("<div class='tr-disabled'/>")
     224                $("<div class='tr-enabled'/>").html(t29.tr.preloader.enabled_string).appendTo('#sidebar-tr');
     225        }
    214226};
    215227
    216 t29.prepare_tr = function() {
    217         $("#sidebar-tr .tr-disabled a").click(function() {
    218                 t29.start_tr();
     228t29.tr.preloader.onload = function() {
     229        $("#sidebar-tr a").click(function() {
     230                t29.tr.preloader.start();
    219231                return false;
    220232        }).attr('href', '#help_with_mistakes');
     
    223235        // or for people who opened link in another tab
    224236        if(location.search.match(/tr-|^tr/i) || location.hash.match(/help_with_mistakes/)) {
    225                 t29.start_tr(function(){ t29.tr.display_top_notice(); });
     237                t29.tr.preloader.start(function(){ t29.tr.display_top_notice(); });
    226238        }
    227239}
     
    234246$(t29.img_license);
    235247$(t29.heading_links);
    236 $(t29.prepare_tr);
     248$(t29.tr.preloader.onload);
Note: See TracChangeset for help on using the changeset viewer.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License