|
|
Zeile 1: |
Zeile 1: |
| /////////////////////////////////////////////////////////
| | __NOTOC__ |
| // Code snippet to make your sidebar items expandable //
| | __NOEDITSECTION__ |
| // Use this code ONLY for the EIG skin - @Nirachand //
| | <!------------------------------------------------------------- |
| /////////////////////////////////////////////////////////
| | ENTÊTE DE BIENVENUE |
|
| | --------------------------------------------------------------> |
| /*Added By Nirachand*/
| | {| id="mp-topbanner" style="width:100%; background:#fcfcfc; margin-top:-30px; border:1px solid #ccc;" |
|
| | | style="width:56%; color:#000;" | |
|
| | {| style="width:280px; border:none; background:none;" |
|
| | | style="width:280px; text-align:left; white-space:nowrap; color:#000;" | |
| $( document ).ready( function() {
| | <div style="font-size:162%; border:none; margin:0; padding:.1em; |
|
| | color:#000;">Welcome to GERMAN [[WIKI-EIG]]</div><div style="font-size:130%; border:none; margin:0; padding:.1em; color:#000;">Wiki Electrical |
| // Set the default expanded items by their headline
| | Installation Guide</div> |
| var defaultExpandItemsID = ['p-About_us', 'p-navigation','p-lang', 'p-addthis'];
| | |} |
|
| | |} |
| //Id based Key value pairs e.g.: p-navigation, p-lang
| | <!------------------------------------------------------------- |
| var staticTexts = [{
| | LIGNE EN DESSOUS DE L'ENTÊTE |
| "key": "p-About_us",
| | --------------------------------------------------------------> |
| "isLink":true,
| | |
| "linkURL" : "Electrical Installation Wiki:About",
| | <!------------------------------------------------------------- |
| "linkCaption" : "To know more",
| | SUMMARY |
| "staticText" : "> Collaborative platform brought to you by Schneider Electric<br>> Helping to design electrical installations according to standards as IEC60364<br>> Our Experts continuously improve the content.<br>> Collaboration is open to all."
| | --------------------------------------------------------------> |
| }];
| | |
|
| | {| id="mp-left" style="width:100%; vertical-align:top; background:#f5fffa;" |
| addStaticText();
| | |- |
| setMaxLMaT();
| | ! style="padding:2px" | <h2 id="mp-dyk-h2" style="margin:3px; |
| function setMaxLMaT(){
| | background:#cef2e0; font-size:120%; font-weight:bold; border:1px solid #a3bfb1; text-align:left; color:#000; padding:0.2em 0.4em;">Electrical |
| maxL = minL + $('#column-one').width();
| | Installation Guide Summary</h2> |
| maxT = minT + $('#column-one').height();
| | |- |
| }
| | | style="color:#000;padding:2px 5px 5px" | <div id="mp-dyk"> |
|
| | |
| // Set the basic-name for the cookies, which save the current state of expanding
| | |
| var expandCookieName = 'wikieig_sidebar_expanded_';
| | {| class="wikitable" |
| var hoverID, minL, maxL, minT, maxT;
| | |- |
| minL = $('#column-one').position().left;
| | | A || [[Allgemeine Planungsgrundlagen – Bestimmungen – Installierte Leistung]] || [[Talk:Allgemeine Planungsgrundlagen – Bestimmungen – Installierte Leistung|Talk page]] |
| minT = $('#column-one').position().top;
| | |- |
| var maxHeights = [];
| | | B || [[Anschluss an das Hochspannungs-Versorgungsnetz des Netzbetreibers]] || [[Talk:Anschluss an das Hochspannungs-Versorgungsnetz des Netzbetreibers|Talk page]] |
| var expandeds = [];
| | |- |
| var flags = [];
| | | C || [[Anschluss an das NS-Verteilnetz des Netzbetreibers]] || [[Talk:Anschluss an das NS-Verteilnetz des Netzbetreibers|Talk page]] |
| var labels = [];
| | |- |
| initNav();
| | | D || [[Auswahlhilfe HS- und NS-Verteilnetzarchitektur]] || [[Talk:Auswahlhilfe HS- und NS-Verteilnetzarchitektur|Talk page]] |
| function initNav(){
| | |- |
| $('.generated-sidebar').each( function( i ) {
| | | E || [[Verteilsysteme in NS-Verteilnetzen]] || [[Talk:Verteilsysteme in NS-Verteilnetzen|Talk page]] |
| var id = $(this).attr( 'id' );
| | |- |
| if ( jQuery.inArray(id, defaultExpandItemsID) == -1 ){
| | | F || [[Schutz gegen elektrischen Schlag]] || [[Talk:Schutz gegen elektrischen Schlag|Talk page]] |
| $( this ).find('.barHeader').css({'cursor': 'pointer'});
| | |- |
| maxHeights[id] = $(this).find('.pBody').height();
| | | G || [[Schutz von Stromkreisen]] || [[Talk:Schutz von Stromkreisen|Talk page]] |
|
| | |- |
| //flags[ $(this).find('.barHeader').parent().attr('id')] = true;
| | | H || [[Schaltgeräte]] || [[Talk:Schaltgeräte|Talk page]] |
| }
| | |- |
|
| | | J || [[Schutz bei Überspannungen und Stoßüberspannungen]] || [[Talk:Schutz bei Überspannungen und Stoßüberspannungen|Talk page]] |
| if ( $.cookie( expandCookieName + id ) == 'false' ) {
| | |- |
| expandeds[id] = false;
| | | K || [[Energieeffizienz in elektrischen Verteilnetzen]] || [[Talk:Energieeffizienz in elektrischen Verteilnetzen|Talk page]] |
| minimize( $( this ) );
| | |- |
| } else if ( $.cookie( expandCookieName + id ) == 'true' ) {
| | | L || [[Blindleistungskompensation und Filterung von Oberschwingungen]] || [[Talk:Blindleistungskompensation und Filterung von Oberschwingungen|Talk page]] |
| expandeds[id] = true;
| | |- |
| maximize( $( this ) );
| | | M || [[Oberschwingungserfassung und - filterung]] || [[Talk:Oberschwingungserfassung und - filterung|Talk page]] |
| } else if ( jQuery.inArray(id, defaultExpandItemsID) == -1 ) {
| | |- |
| expandeds[id] = false;
| | | N || [[Stromversorgungen und Verbraucher besonderer Art]] || [[Talk:Stromversorgungen und Verbraucher besonderer Art|Talk page]] |
| minimize( $( this ) );
| | |- |
| } else {
| | | P || [[Solaranlagen]] || [[Talk:Solaranlagen|Talk page]] |
| expandeds[id] = true;
| | |- |
| maximize( $( this ) );
| | | Q || [[Wohngebäude und ähnliche Einsatzbereiche sowie besondere Orte und Bereiche]] || [[Talk:Wohngebäude und ähnliche Einsatzbereiche sowie besondere Orte und Bereiche|Talk page]] |
| }
| | |- |
| //$(this).find('.barHeader').click( toggleNav );
| | | R || [[EMV-Richtlinien]] || [[Talk:EMV-Richtlinien|Talk page]] |
|
| | |- |
| });
| | |} |
|
| | |
| }
| | |
|
| | </div> |
|
| | |} |
| function addStaticText(){
| | |
| var length = staticTexts.length, j=0, str;
| | [[Category:Chapter - Homepage]] |
| $("#column-one").find(".portlet").each(function(i){
| | |
| if(staticTexts[0].key == $(this).attr('id') ){
| | [[en:Main_Page]] |
| defaultExpandItemsID.push($(this).attr('id'));
| |
| renderHTML(staticTexts[0], $(this));
| |
| }
| |
| });
| |
| }
| |
|
| |
| function renderHTML(staticText, thiz){
| |
| $("#"+staticText.key).append("<div class='staticText'>"+staticText.staticText+"</div>");
| |
| if(staticText.isLink)
| |
| {
| |
| $("#"+staticText.key).find('.staticText').append("<div class='staticLink'><a class='linkText'>"+staticText.linkCaption+"</a></div>");
| |
| $("#"+staticText.key).find('.staticText').find('.linkText').attr('href', staticText.linkURL );;
| |
| }
| |
| }
| |
|
| |
|
| |
|
| |
| function minimize( target ) {
| |
| var id = $(target).attr( 'id' );
| |
| // You can change the expires parameter to save the cookie longer/shorter than 7 days like in this code
| |
| $.cookie( expandCookieName + id, 'false', { expires: 1} );
| |
| $(target).find('.pBody').animate({'height': '0px'},300,function(){
| |
| $(target).find('.pBody').css("display","none");
| |
| setMaxLMaT();
| |
| });
| |
| | |
| }
| |
| | |
| function maximize( target ) {
| |
| | |
| var id = $(target).attr( 'id' );
| |
| // You can change the expires parameter to save the cookie longer/shorter than 7 days like in this code
| |
| $.cookie( expandCookieName + id, 'true', { expires: 1} );
| |
| var newHeight = maxHeights[id];
| |
| $(target).find('.pBody').css("display","block");
| |
| $(target).find('.pBody').animate({'height': newHeight + 'px'}, 300);
| |
| setMaxLMaT();
| |
| | |
| }
| |
| | |
| function toggleNav() {
| |
| var id = $(this).parent().attr('id');
| |
| if ( jQuery.inArray(id, defaultExpandItemsID) == -1 ) {
| |
| expandeds[id] = !expandeds[id];
| |
| if( expandeds[id] == true ) {
| |
| maximize($(this).parent());
| |
| } else {
| |
| minimize($(this).parent());
| |
| }
| |
| }
| |
| }
| |
| | |
| $('body').mousemove(function(e){
| |
| if(e.pageX > 197){
| |
| | |
| $('.barHeader').each(function(){
| |
| var id = $(this).parent().attr('id');
| |
| if(jQuery.inArray(id, defaultExpandItemsID) == -1){
| |
| if($.cookie(id) != 'true'){
| |
| if( expandeds[id] == true ) {
| |
| expandeds[id] = !expandeds[id];
| |
| minimize($(this).parent());
| |
| }
| |
| }
| |
| }
| |
| });
| |
| }
| |
| });
| |
| | |
|
| |
| $('.barHeader').bind("click", function(){
| |
| var id = $(this).parent().attr('id');
| |
| if(jQuery.inArray(id, defaultExpandItemsID) == -1){
| |
| | |
| if( $.cookie(id) == null ){
| |
| $.cookie(id, 'true', { expires: 1} );
| |
| | |
| }else if( $.cookie(id) == 'true' ){
| |
| $.cookie(id, 'false', { expires: 1} );
| |
| if( expandeds[id] == true ) {
| |
| expandeds[id] = !expandeds[id];
| |
| minimize($(this).parent());
| |
| }
| |
| //$('.barHeader').trigger("mouseout");
| |
| | |
| }else if( $.cookie(id) == 'false')
| |
| {
| |
| $.cookie(id, 'true', { expires: 1} );
| |
|
| |
| }
| |
| | |
|
| |
| }
| |
| });
| |
| | |
| $('.barHeader').hover(function(){
| |
| var id = $(this).parent().attr('id');
| |
| if(jQuery.inArray(id, defaultExpandItemsID) == -1){
| |
| if( expandeds[id] == false ) {
| |
| expandeds[id] = !expandeds[id];
| |
| maximize($(this).parent());
| |
| }
| |
| }
| |
| }, function(){
| |
| });
| |
|
| |
|
| |
| }); | |
|
| |
|
| |
|
| |
|
| |
|
| |
| ///////////////////////////////////////////////////////
| |
| ///////////////////////////////////////////////////////
| |