- Timestamp:
- Jul 8, 2012, 2:13:09 AM (12 years ago)
- Location:
- shared/js-v6/modules
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
shared/js-v6/modules/auto_bildbreite.js
r260 r277 15 15 16 16 if(!t29) window.t29 = {}; // the t29 namespace 17 18 t29.auto_bildbreite = function() { 17 18 t29.auto_bildbreite = {}; 19 t29.auto_bildbreite.setup = function() { 19 20 $("div.auto-bildbreite, div.desc-right, div.desc-left") 20 21 .each(function(){ $(this).css("width", $("img", this).width()); }); 21 22 } 22 23 $(t29.auto_bildbreite); -
shared/js-v6/modules/defaultvalue.js
r260 r277 29 29 }); 30 30 }; 31 32 $(t29.defaultvalue.setup); -
shared/js-v6/modules/heading_links.js
r260 r277 13 13 14 14 if(!t29) window.t29 = {}; // the t29 namespace 15 16 t29.heading_links = function() { 15 16 t29.heading_links = {}; 17 t29.heading_links.setup = function() { 17 18 $("#content").find("h2,h3").not("h2:first").each(function(){ 18 19 anchor = ($(this).attr("title") || $(this).attr("id") || $(this).text()) … … 30 31 $('html, body').scrollTop(link.parent().offset().top); // springen 31 32 } 32 33 $(t29.heading_links); -
shared/js-v6/modules/img_license.js
r260 r277 70 70 }; 71 71 72 // use this function from outer, see onloadfor help.72 // use this function from outer, see setup for help. 73 73 // improvement possibility: converse to $.fn so can call $("img#my").img_license(); 74 74 t29.img_license.apply = function($elem) { … … 76 76 }; 77 77 78 t29.img_license. onload= function() {78 t29.img_license.setup = function() { 79 79 $("body").append('<div id="img-license-tag"><p>'+t29._('js-img-license')+'</p></div>'); 80 80 t29.img_license.tag = $("#img-license-tag"); … … 86 86 t29.img_license.apply( $("img").not(t29.img_license.settings.exclude) ); 87 87 }; 88 89 $(t29.img_license.onload); -
shared/js-v6/modules/lightbox.js
r260 r277 8 8 9 9 if(!t29) window.t29 = {}; // the t29 namespace 10 11 t29.lightbox = function() { 10 11 t29.lightbox = {}; 12 t29.lightbox.setup = function() { 12 13 var elements = $("#content .popup"); 13 14 if(elements.length) { … … 35 36 } // if lightbox elements 36 37 } 37 38 $(t29.lightbox); -
shared/js-v6/modules/menu.js
r276 r277 25 25 }; 26 26 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 **/ 44 t29.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 28 64 /** 29 65 * Menu ein- oder ausklappen. 66 * 30 67 * @param target_state true: Eingeklappt, false: ausgeklappt 31 68 * @param quick true=keine Animation, false/undefined=Animation 32 69 **/ 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"); 70 t29.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); 40 79 } 80 41 81 // returns whether menu is collapsed (boolean). 42 t29.menu.collapsed.is = function() { return $("html").hasClass("collapsed-menu"); }; 82 t29.menu.Collapsible.prototype.is_collapsed = function() { return t29.prefs.get(this.store_key) == this.FOLD; } 83 43 84 t29.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(); 48 99 }; 49 100 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 51 110 // enums, die CSS-Klassen im <html> entsprechen: 52 111 t29.menu.scroll.States = Object.freeze({STATIC:"static-menu",FIX:"fixed-menu",STICK_TOP:"stick-top-menu",STICK_BOTTOM:"stick-bottom-menu"}); … … 76 135 case t29.menu.scroll.States.STATIC: 77 136 // die CSS-Klassen regeln eigentlich alles. 78 t29.menu.collapsed. but.show();137 t29.menu.collapsed.u3.button.show(); 79 138 t29.menu.scroll.but.text(t29._("js-menu-scroll-show")); 80 139 t29.menu.side.show(); … … 99 158 }*/ 100 159 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. 103 162 t29.menu.scroll.but.text(t29._("js-menu-scroll-hide")); 104 163 break; … … 114 173 t29.menu.scroll.setup = function() { 115 174 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 } 117 198 118 199 t29.menu.scroll.but.click(function(){ … … 123 204 t29.menu.scroll.set(t29.menu.scroll.States.FIX); 124 205 t29.menu.side.fadeIn(); 206 t29.prefs.set(t29.menu.scroll.store_key, t29.menu.scroll.States.FIX); 125 207 break; 126 208 case t29.menu.scroll.States.FIX: … … 128 210 // zu Static uebergehen, mit Animation. 129 211 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); 131 215 break; 132 216 case t29.menu.scroll.States.STICK_TOP: … … 158 242 if(y > t29.menu.scroll.origin_top) { 159 243 // wir sind wieder weiter runter gescrollt. 160 if(t29.menu.collapsed. is())244 if(t29.menu.collapsed.u3.is_collapsed()) 161 245 // und der Benutzer hat zwischenzeitlich nicht das Menue ausgeklappt 162 246 t29.menu.scroll.set(t29.menu.scroll.States.FIX); … … 186 270 187 271 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 ***************************************************************************************/ 189 280 t29.menu.guide.setup = function() { 190 281 // Zentraler Hauptschritt: Das Menue ab oberster Ebene klonen und im Footer dranhaengen, … … 250 341 */ 251 342 }; 252 253 $(t29.menu.setup); -
shared/js-v6/modules/pagescripts.js
r275 r277 59 59 } 60 60 61 t29. common= function(){61 t29.page.setup = function(){ 62 62 pagename = t29.conf.seiten_id; 63 if(t29.page[pagename]) 63 if(t29.page[pagename] 64 && (pagename != "setup")) // no recursion 64 65 t29.page[pagename](); 65 66 }; 66 67 67 68 // to execute, run: 68 $(t29.common);69 //$(t29.common); -
shared/js-v6/modules/smoothscroll.js
r275 r277 7 7 if(!t29) window.t29 = {}; // the t29 namespace 8 8 9 t29.smoothscroll = function() { 9 t29.smoothscroll = {}; 10 t29.smoothscroll.setup = function() { 10 11 $("nav.side a").smoothScroll(); 11 12 … … 17 18 }; 18 19 19 $(t29.smoothscroll);20 //$(t29.smoothscroll); 20 21 21 22 -
shared/js-v6/modules/tr_preloader.js
r260 r277 46 46 } 47 47 48 $(t29.tr.preloader);48 //$(t29.tr.preloader);
Note: See TracChangeset
for help on using the changeset viewer.