Changeset 347 in t29-www for shared/js-v6


Ignore:
Timestamp:
Mar 6, 2013, 3:58:15 AM (11 years ago)
Author:
sven
Message:

Diverse Verbesserungen am Homepagesystem, die bereits lange anstanden.

  • Die Suche ist endlich implementiert, wenngleich auch relativ unschoen mittels einer eingebundenen Google-Suche.

Bugfixes:

  • de/news.php: Syntaxfehler im Neuigkeiten-Menü

Backend-Aenderungen:

  • Englischsprachige Benutzer, die auf die deutsche Seite kommen oder andersrum erhalten einen Hinweis, dass es die andere Sprachversion gibt (noch nicht vollständig implementiert)
  • Es gibt ein besseres Logging-System, welches Client- und Serverausgaben verbindet
  • Das System generiert jetzt selbst Clean-URLs direkt (zumindest aus Menue/Template, Inhalte werden nicht touchiert). Das reduziert die Anzahl der Zugriffe erheblich.
  • Ein paar CSS-Details
  • navigation.xml: "#DUMME-VERLINKUNG"-Einträge entfernt
Location:
shared/js-v6/modules
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • shared/js-v6/modules/log.js

    r260 r347  
    11/**
    2  * Logging functions, basics provided by HTML5 Boilerplate
     2 * t29v6 Logging subsystem
     3 *
     4 * Logging on client side is splitted in two parts:
     5 *   1. Javascript console.log calls which won't offend the user
     6 *   2. the t29.log class to notify the user.
     7 *
     8 * Considering console.log, the code is borrowed by HTML5 Boilerplate
     9 *
    310 *
    411 **/
     
    2027{console.log();return window.console;}catch(err){return window.console={};}})());
    2128
     29
     30if(!t29) window.t29 = {}; // the t29 namespace
     31t29.log = {}; // the t29.log namespace
     32
     33t29.log.setup = function() {
     34        // setup our spaces
     35        t29.log.$panel = $(".messages.panel");
     36        t29.log.$end = $(".messages.footer");
     37       
     38        // find end messages and push them to the first
     39        if((end_li = t29.log.$end.find("li")).length) {
     40                end_li.appendTo(t29.log.$panel);
     41                t29.log.$end.hide(); // hide bottom panel
     42                t29.log.$panel.removeClass("empty"); // show top panel
     43        }
     44       
     45        // setup some functions
     46        levels = ["emerg", "alert", "crit", "error", "warn", "notice", "info"];
     47        $.each(levels, function() {
     48                level = this;
     49                t29.log[level] = function(msg) { t29.log.append(level, msg) }
     50        });
     51}
     52
     53t29.log.append = function(level, msg) {
     54        // tell the panel that it's now not empty (thus it will become CSS visible)
     55        t29.log.$panel.removeClass("empty");
     56       
     57        if(jQuery.type(msg) == "string")
     58                s = msg;
     59        else {
     60                s = "";
     61                if(msg.dismissable) s += "<button class='close'>&times;</button>";
     62                if(msg.heading) s += "<h5>"+msg.heading+"</h5>";
     63                if(msg.text) s += "<p>"+msg.text+"</p>";
     64        }
     65        infoelement = $("<li>", {"class": level}).html(s).hide().appendTo(t29.log.$panel).slideDown();
     66       
     67        // fill eventual close button with action
     68        $(infoelement).find("button.close").click(function(){
     69                $(this).closest("li").slideUp();
     70        });
     71}
  • shared/js-v6/modules/startup.js

    r306 r347  
    2020        'img_license',
    2121        'lightbox',
     22        'log',
    2223
    2324        // ganz am anfang
    2425        'prefs',
     26       
     27        // needs log, t29msg
     28        'interlang',
    2529
    2630        // needs prefs
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