Changeset 277 in t29-www


Ignore:
Timestamp:
Jul 8, 2012, 2:13:09 AM (7 years ago)
Author:
sven
Message:

JavaScript-Preferences-System, mit dem die Einstellungen fuers Menue erhalten bleiben. Refactoring des menu.js-Codes. startup.js um Reihenfolge der Scripte festzulegen. Diverse Bugfixes im PHP und Inhalt.

Files:
2 added
17 edited

Legend:

Unmodified
Added
Removed
  • de-v6/navigation.xml

    r276 r277  
    108108                                        <li><a href="/de-v6/rechnertechnik/fruehe-computer.php#pdp12">PDP 12</a></li>
    109109                                        <li><a href="/de-v6/rechnertechnik/fruehe-computer.php#lab8e">LAB 8e</a></li>
    110                                         <li><a href="/de-v6/rechnertechnik/fruehe-computer.php#nova2">NOVA 2</a></li>
     110                                        <li><a href="/de-v6/rechnertechnik/fruehe-computer.php#nova">NOVA 2</a></li>
    111111                                        <li><a href="/de-v6/rechnertechnik/fruehe-computer.php#wang2200">WANG 2200</a></li>
    112112                                </ul>
  • en-v6/computer/analog.php

    r258 r277  
    7070<p class="small">
    7171Excerpt from the original prospekt:<br>
    72 This is a highly flexible and accurate analog computer, designed to fill requirements not presently met by commercial computer. It is an instrument suitable for use as a design tool in industry and universities. An advanced “slide rule” which permits engineering or research personnel to electronically simulate equations or physical problems and save many hours of calculation or experimentation.....
     72This is a highly flexible and accurate analog computer, designed to fill requirements not presently met by commercial computer. It is an instrument suitable for use as a design tool in industry and universities. An advanced “slide rule” which permits engineering or research personnel to electronically simulate equations or physical problems and save many hours of calculation or experimentation.....
    7373Because it is a kit, and the labor and overhead costs found in present day computers are eliminated, the Heath Computer can be obtained for use in situations where a computer was ruled out in the past because of cost.......</p>
    7474    </div>
  • en-v6/navigation.xml

    r268 r277  
    106106                        <li><a seiten_id="tontechnik" href="/en-v6/communication/sound_technology.php">Sound recording and reproducing technology</a></li>
    107107                        <li><a seiten_id="fernsehen" href="/en-v6/communication/television.php">Television</a></li>
    108                         <li><a seiten_id="faxtechnik" href="/en-v6/communication/fax.pjp">Telegraphy and Fax engineering</a></li>
     108                        <li><a seiten_id="faxtechnik" href="/en-v6/communication/fax.php">Telegraphy and Fax engineering</a></li>
    109109                </ul>
    110110        </li>
    111         <li><a href="/en-v6/kommunikaionstechnik/measurement.php#DUMME-VERLINKUNG">Weitere Themen</a>
     111        <li><a href="/en-v6/communication/measurement.php#DUMME-VERLINKUNG">Miscellaneous</a>
    112112                <ul class="u2">
    113                         <li><a seiten_id="messtechnik" href="/en-v6/kommunikaionstechnik/measurement.php">Measurement and Experimental technology</a></li>
     113                        <li><a seiten_id="messtechnik" href="/en-v6/communication/measurement.php">Measurement and Experimental technology</a></li>
    114114                        <li><a seiten_id="sonstiges" href="/en-v6/miscellaneous.php">Pianola</a></li>
    115115                        <li><a href="/en-v6/miscellaneous.php#kinomaschine">Movie projector</a></li>
  • index.php

    r92 r277  
    88 if( ($en !== false && $de !== false && $de < $en) ||
    99     ($en === false && de !== false)              )
    10         header("Location: /de/");
     10        header("Location: /de-v6/");
    1111 else
    12         header("Location: /en/");
     12        header("Location: /en-v6/");
    1313?>
    1414<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  • lib/cache.php

    r275 r277  
    7171        function is_valid() {
    7272                // no double calculation
    73                 if($this->is_valid) return $this->is_valid;
     73                if($this->is_valid !== null) return $this->is_valid;
    7474
    7575                if($this->debug) {
  • lib/loader.php

    r273 r277  
    4848extract($conf); // for saving long human reading times :D
    4949
    50 
    5150require "$lib/cache.php";
    5251$js_cache = new t29Cache();
     
    6059require "$lib/ressourceloader.php";
    6160$loader = new $class($conf);
    62 $js_cache->start_cache(array($loader, 'compression_filter'), true);
     61if(!$debug) $js_cache->start_cache(array($loader, 'compression_filter'), true);
    6362$loader->run();
  • lib/technikum29.php

    r275 r277  
    1313$webroot = realpath("$lib/../");  # file path to root of t29 web installation
    1414$file = substr($_SERVER['SCRIPT_FILENAME'], strlen($_SERVER['DOCUMENT_ROOT'])); # e.g.: "/de/page.php"
     15
     16// exactly define debugging behaviour
     17if(isset($_GET['debug'])) {
     18        $_GET['purge_cache'] = true;
     19        $_GET['rl_debug'] = true;
     20}
    1521
    1622$cache_dir = "$webroot/shared/cache";
  • lib/template.php

    r276 r277  
    104104  <?php
    105105        if(isset($this->conf['version'])) printf('<meta name="t29.version" content="%s">', $this->conf['version']);
     106        if(isset($_GET['debug']))
     107                foreach(explode(' ','debug rl_debug skip_cache purge_cache verbose_cache') as $x)
     108                        printf("\n  <meta name='t29.template.data-%s' content='%s'>", $x, isset($_GET[$x])?'true':'false');
    106109  ?>
    107110 
     
    251254    </footer>
    252255  </div> <!--! end of #container -->
    253 
     256</div><!-- end of div id="footer-background-container" helper -->
    254257
    255258  <!-- JavaScript at the bottom for fast page loading -->
     
    264267                printf('  <script src="%s"></script>'.PHP_EOL, $js);
    265268  ?>
    266 </div><!-- end of div id="footer-background-container" helper -->
    267269</body>
    268270</html>
  • shared/js-v6/modules/auto_bildbreite.js

    r260 r277  
    1515
    1616if(!t29) window.t29 = {}; // the t29 namespace
    17  
    18 t29.auto_bildbreite = function() {
     17
     18t29.auto_bildbreite = {};
     19t29.auto_bildbreite.setup = function() {
    1920        $("div.auto-bildbreite, div.desc-right, div.desc-left")
    2021                .each(function(){ $(this).css("width", $("img", this).width()); });
    2122}
    22 
    23 $(t29.auto_bildbreite);
  • shared/js-v6/modules/defaultvalue.js

    r260 r277  
    2929        });
    3030};
    31 
    32 $(t29.defaultvalue.setup);
  • shared/js-v6/modules/heading_links.js

    r260 r277  
    1313
    1414if(!t29) window.t29 = {}; // the t29 namespace
    15  
    16 t29.heading_links = function() {
     15
     16t29.heading_links = {};
     17t29.heading_links.setup = function() {
    1718        $("#content").find("h2,h3").not("h2:first").each(function(){
    1819                anchor = ($(this).attr("title") || $(this).attr("id") || $(this).text())
     
    3031                $('html, body').scrollTop(link.parent().offset().top); // springen
    3132}
    32 
    33 $(t29.heading_links);
  • shared/js-v6/modules/img_license.js

    r260 r277  
    7070};
    7171
    72 // use this function from outer, see onload for help.
     72// use this function from outer, see setup for help.
    7373// improvement possibility: converse to $.fn so can call $("img#my").img_license();
    7474t29.img_license.apply = function($elem) {
     
    7676};
    7777
    78 t29.img_license.onload = function() {
     78t29.img_license.setup = function() {
    7979        $("body").append('<div id="img-license-tag"><p>'+t29._('js-img-license')+'</p></div>');
    8080        t29.img_license.tag = $("#img-license-tag");
     
    8686        t29.img_license.apply( $("img").not(t29.img_license.settings.exclude) );
    8787};
    88 
    89 $(t29.img_license.onload);
  • shared/js-v6/modules/lightbox.js

    r260 r277  
    88 
    99if(!t29) window.t29 = {}; // the t29 namespace
    10  
    11 t29.lightbox = function() {
     10
     11t29.lightbox = {};
     12t29.lightbox.setup = function() {
    1213        var elements = $("#content .popup");
    1314        if(elements.length) {
     
    3536        } // if lightbox elements
    3637}
    37 
    38 $(t29.lightbox);
  • shared/js-v6/modules/menu.js

    r276 r277  
    2525};
    2626
    27 //////////////////////////// Menu Collapsed System.
     27/***************************************************************************************
     28  1. Collapsable Menu system  t29.menu.collapsed
     29 
     30     The collapsable menu system is capable of collapse parts of the menu by user
     31     interaction or program request. The current state is stored in t29.prefs.
     32
     33***************************************************************************************/
     34
     35/**
     36 * Construct a new collapsible. It needs three named arguments:
     37 *   c = new t29.menu.Collapsible({
     38 *       id: 'foobar',  // a senseful id for the t29.prefs cookie system
     39 *       lists: $(".your ul"),  // some element which should be collapsed
     40 *       button: $("<button/>").appendTo("body"); // some button which should do the work
     41 *   });
     42 *
     43 **/
     44t29.menu.Collapsible = function(arglist) {
     45        for (var n in arguments[0]) { this[n] = arguments[0][n]; }
     46        this.store_key = 'menu-collapsible-'+this.id; // key for t29.prefs.get/set
     47
     48        // default values
     49        if(!this.button)
     50                this.button = $('<span class="button collapse-menu"></span>')
     51                              .addClass('for-'+this.id).appendTo("nav.side");
     52
     53        // constants for the 'set' method
     54        this.FOLD = true;   this.EXPAND = false;
     55        this.QUICK = true;  this.ANIMATE = false;
     56
     57        // set initial state
     58        this.set(t29.prefs.get(this.store_key, this.FOLD), this.QUICK);
     59       
     60        // set button callback
     61        this.button.click($.proxy(function(){ this.set(); }, this));
     62}
     63
    2864/**
    2965 * Menu ein- oder ausklappen.
     66 *
    3067 * @param target_state  true: Eingeklappt, false: ausgeklappt
    3168 * @param quick  true=keine Animation, false/undefined=Animation
    3269 **/
    33 t29.menu.collapsed.set = function(collapse, quick) {
    34         if(collapse==undefined) collapse = !t29.menu.collapsed.is();
    35         log("Collapse zu "+(collapse?"KLEIN":"GROß")+" quick="+quick);
    36         if(quick) collapse ? t29.menu.collapsed.lists.hide() : t29.menu.collapsed.lists.show();
    37         else      collapse ? t29.menu.collapsed.lists.slideUp() : t29.menu.collapsed.lists.slideDown();
    38         t29.menu.collapsed.but.text(t29._(collapse ? "js-menu-collapse-out" : "js-menu-collapse-in"));
    39         collapse ? $("html").addClass("collapsed-menu") : $("html").removeClass("collapsed-menu");
     70t29.menu.Collapsible.prototype.set = function(collapse, quick) {
     71        if(collapse == undefined)
     72                collapse = ! this.is_collapsed();
     73        log("Collapsing "+this.id+" to " +(collapse==this.FOLD ? "klein (fold)" : "gross (expand)")+" quick = " + (quick==this.QUICK ? "quick!" : "animated"));
     74        if(quick) collapse ? this.lists.hide()    : this.lists.show();
     75        else      collapse ? this.lists.slideUp() : this.lists.slideDown();
     76        this.button.text(t29._(collapse ? "js-menu-collapse-out" : "js-menu-collapse-in"));
     77        //collapse ? $("html").addClass("collapsed-menu") : $("html").removeClass("collapsed-menu");
     78        t29.prefs.set(this.store_key, collapse);
    4079}
     80
    4181// returns whether menu is collapsed (boolean).
    42 t29.menu.collapsed.is = function() { return $("html").hasClass("collapsed-menu"); };
     82t29.menu.Collapsible.prototype.is_collapsed = function() { return t29.prefs.get(this.store_key) == this.FOLD; }
     83
    4384t29.menu.collapsed.setup = function() {
    44         t29.menu.collapsed.but = $('<span class="button collapse-menu"></span>').appendTo("nav.side");
    45         t29.menu.collapsed.lists = $("nav.side .u3").not("nav.side li.active > .u3"); // ein/auszuklappende Listen
    46         t29.menu.collapsed.set(true, true); // initial state
    47         t29.menu.collapsed.but.click(function(){ t29.menu.collapsed.set(); });
     85        // set up some collapsible lists
     86        t29.menu.collapsed.u3 = new t29.menu.Collapsible({
     87                id: 'u3',
     88                lists: $("nav.side .u3").not("nav.side li.active > .u3, .geraete"),
     89        });
     90
     91        /*t29.menu.collapsed.geraete = new t29.menu.Collapsible({
     92                id: 'geraete',
     93                lists: $("nav.side ul.geraete"),
     94        });*/
     95       
     96        // hide geraete
     97        //t29.menu.collapsed.geraete.button.hide();
     98        $("ul.geraete").hide();
    4899};
    49100
    50 //////////////////////////// Menu Scroll System
     101/***************************************************************************************
     102  2. Menu scroll system  t29.menu.scroll
     103 
     104     The scrollable menu system can handle a position:fixed navigation area with dynamic
     105     switching to static or absolute positioning. It is narrowly toothed to the
     106     collapse system. Current state is stored in t29.prefs.
     107
     108***************************************************************************************/
     109
    51110// enums, die CSS-Klassen im <html> entsprechen:
    52111t29.menu.scroll.States = Object.freeze({STATIC:"static-menu",FIX:"fixed-menu",STICK_TOP:"stick-top-menu",STICK_BOTTOM:"stick-bottom-menu"});
     
    76135                case t29.menu.scroll.States.STATIC:
    77136                        // die CSS-Klassen regeln eigentlich alles.
    78                         t29.menu.collapsed.but.show();
     137                        t29.menu.collapsed.u3.button.show();
    79138                        t29.menu.scroll.but.text(t29._("js-menu-scroll-show"));
    80139                        t29.menu.side.show();
     
    99158                        }*/
    100159
    101                         t29.menu.collapsed.set(true, true); // Sicherstellen, dass Navi eingeklappt.
    102                         t29.menu.collapsed.but.hide(); // Ausgeklappte Navi passt auf keinen Bildschirm.
     160                        t29.menu.collapsed.u3.set(true, true); // Sicherstellen, dass Navi eingeklappt.
     161                        t29.menu.collapsed.u3.button.hide(); // Ausgeklappte Navi passt auf keinen Bildschirm.
    103162                        t29.menu.scroll.but.text(t29._("js-menu-scroll-hide"));
    104163                        break;
     
    114173t29.menu.scroll.setup = function() {
    115174        t29.menu.scroll.but = $('<span class="button get-menu"></span>').appendTo("section.sidebar");
    116         t29.menu.scroll.set(t29.menu.scroll.States.STATIC); // initial state
     175
     176        /**
     177         * t29.prefs and t29.menu.scroll: Valid values are only FIX and STATIC.
     178         * Crossover states like STICK_BOTTOM, STICK_TOP shall not be stored.
     179         **/
     180        t29.menu.scroll.store_key = 'menu-scroll'; // key for accessing t29.prefs value
     181       
     182        // set initial state:
     183        initial = t29.prefs.get(t29.menu.scroll.store_key, t29.menu.scroll.States.STATIC);
     184        switch(initial) {
     185                case t29.menu.scroll.States.STATIC:
     186                        t29.menu.scroll.set(initial);
     187                        break;
     188                case t29.menu.scroll.States.FIX:
     189                        // davon ausgehend, dass wir uns ganz oben befinden beim Seiten-Laden.
     190                        // TODO / PENDING: Wenn man mit Anker #foobar auf die Seite reinkommt,
     191                        //                 ist das nicht der Fall! Das kann kombiniert werden
     192                        //                 mit t29.smoothscroll!
     193                        t29.menu.scroll.set(t29.menu.scroll.States.STICK_TOP);
     194                        break;
     195                default:
     196                        log("t29.menu.scroll.setup: Invalid value "+initial+" for initial prefs");
     197        }
    117198       
    118199        t29.menu.scroll.but.click(function(){
     
    123204                                t29.menu.scroll.set(t29.menu.scroll.States.FIX);
    124205                                t29.menu.side.fadeIn();
     206                                t29.prefs.set(t29.menu.scroll.store_key, t29.menu.scroll.States.FIX);
    125207                                break;
    126208                        case t29.menu.scroll.States.FIX:
     
    128210                                // zu Static uebergehen, mit Animation.
    129211                                t29.menu.side.fadeOut(function(){
    130                                         t29.menu.scroll.set(t29.menu.scroll.States.STATIC); });
     212                                        t29.menu.scroll.set(t29.menu.scroll.States.STATIC);
     213                                });
     214                                t29.prefs.set(t29.menu.scroll.store_key, t29.menu.scroll.States.STATIC);
    131215                                break;
    132216                        case t29.menu.scroll.States.STICK_TOP:
     
    158242                                if(y > t29.menu.scroll.origin_top) {
    159243                                        // wir sind wieder weiter runter gescrollt.
    160                                         if(t29.menu.collapsed.is())
     244                                        if(t29.menu.collapsed.u3.is_collapsed())
    161245                                                // und der Benutzer hat zwischenzeitlich nicht das Menue ausgeklappt
    162246                                                t29.menu.scroll.set(t29.menu.scroll.States.FIX);
     
    186270
    187271
    188 //////////////////////////// Footer Guided Tour System (auch Menu)
     272/***************************************************************************************
     273  2. Footer Guided Tour System   t29.menu.guide
     274 
     275     The "beam" is a fancy jquery application where the menu is cloned and displayed
     276     in the footer in a very other way. This is quite static compared to the
     277     applications above.
     278
     279***************************************************************************************/
    189280t29.menu.guide.setup = function() {
    190281        // Zentraler Hauptschritt: Das Menue ab oberster Ebene klonen und im Footer dranhaengen,
     
    250341        */
    251342};
    252 
    253 $(t29.menu.setup);
  • shared/js-v6/modules/pagescripts.js

    r275 r277  
    5959}
    6060
    61 t29.common = function(){
     61t29.page.setup = function(){
    6262        pagename = t29.conf.seiten_id;
    63         if(t29.page[pagename])
     63        if(t29.page[pagename]
     64          && (pagename != "setup")) // no recursion
    6465                t29.page[pagename]();
    6566};
    6667
    6768// to execute, run:
    68 $(t29.common);
     69//$(t29.common);
  • shared/js-v6/modules/smoothscroll.js

    r275 r277  
    77if(!t29) window.t29 = {}; // the t29 namespace
    88
    9 t29.smoothscroll = function() {
     9t29.smoothscroll = {};
     10t29.smoothscroll.setup = function() {
    1011        $("nav.side a").smoothScroll();
    1112       
     
    1718};
    1819
    19 $(t29.smoothscroll);
     20//$(t29.smoothscroll);
    2021
    2122
  • shared/js-v6/modules/tr_preloader.js

    r260 r277  
    4646}
    4747
    48 $(t29.tr.preloader);
     48//$(t29.tr.preloader);
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