MediaWiki:Common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
(5 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 62: | Zeile 62: | ||
//Chronik Toggle Buttons | //Chronik Toggle Buttons | ||
function | function chronikTogglerUpdate() { | ||
var toggles= | var toggles=[]; | ||
$("div.ChronikToggle").each(function(index) { | $("div.ChronikToggle").each(function(index) { | ||
var fullid=this.id; | var fullid=this.id; | ||
Zeile 73: | Zeile 73: | ||
var visible=true; | var visible=true; | ||
var classes=$(this).attr("class").split(' '); | var classes=$(this).attr("class").split(' '); | ||
for(line in classes) { | for(var line in classes) { | ||
if((typeof(toggles[classes[line]])!='undefined')&&(!toggles[classes[line]])) { | if((typeof(toggles[classes[line]])!='undefined')&&(!toggles[classes[line]])) { | ||
visible=false; | visible=false; | ||
Zeile 86: | Zeile 86: | ||
function createChronikTogglerSub(name,title) { | function createChronikTogglerSub(name,title) { | ||
var search=$("div.Chronik"+name); | |||
if(search.length===0) return; | |||
$("div.ChronikToggler").append('<div style="display:inline-block;width:100px;text-align:center;margin:5px;font-size:0.7em;cursor:pointer;" class="ChronikToggle dunkel" id="ChronikToggle'+name+'">'+title+'</div>'); | $("div.ChronikToggler").append('<div style="display:inline-block;width:100px;text-align:center;margin:5px;font-size:0.7em;cursor:pointer;" class="ChronikToggle dunkel" id="ChronikToggle'+name+'">'+title+'</div>'); | ||
$("#ChronikToggle"+name).click(function() { | $("#ChronikToggle"+name).click(function() { | ||
if($(this).hasClass("hell")) { | if($(this).hasClass("hell")) { | ||
$(this).removeClass("hell"); | $(this).removeClass("hell"); | ||
$(this).addClass("dunkel") | $(this).addClass("dunkel"); | ||
} else { | } else { | ||
$(this).removeClass("dunkel"); | $(this).removeClass("dunkel"); | ||
$(this).addClass("hell") | $(this).addClass("hell"); | ||
} | } | ||
chronikTogglerUpdate(); | |||
}); | }); | ||
} | } | ||
function createChronikToggler() { | function createChronikToggler() { | ||
createChronikTogglerSub("Ereignis","Ereignis"); | /* var hidestr=$("div.ChronikToggler").text(); | ||
createChronikTogglerSub("Herrscher","Herrscher"); | if(!hidestr) | ||
createChronikTogglerSub("Familie","Familie"); | hidestr=""; | ||
createChronikTogglerSub("Tsatag","Tsatag"); | console.log("hidestr: "+hidestr); | ||
createChronikTogglerSub("Traviabund","Traviabund"); | var hide=hidestr.split(";"); | ||
createChronikTogglerSub("Borontag","Borontag"); | console.log("hide: "+hide);*/ | ||
$("div.ChronikToggler").append('<br/>< | $("div.ChronikToggler").text(""); | ||
createChronikTogglerSub(" | $("div.ChronikToggler").append('<div style="display:inline-block;width:100px;text-align:right;margin:5px;font-size:0.7em;">Typ:</div>'); | ||
createChronikTogglerSub("Ereignis","Ereignis"/*,hide*/); | |||
createChronikTogglerSub("Periode02"," | createChronikTogglerSub("Herrscher","Herrscher"/*,hide*/); | ||
createChronikTogglerSub("Periode03"," | createChronikTogglerSub("Familie","Familie"/*,hide*/); | ||
createChronikTogglerSub("Periode04"," | createChronikTogglerSub("Tsatag","Tsatag"/*,hide*/); | ||
createChronikTogglerSub("Periode05"," | createChronikTogglerSub("Traviabund","Traviabund"/*,hide*/); | ||
createChronikTogglerSub("Periode06"," | createChronikTogglerSub("Borontag","Borontag"/*,hide*/); | ||
createChronikTogglerSub("Periode07"," | createChronikTogglerSub("Weihetag","Weihetag"/*,hide*/); | ||
createChronikTogglerSub("Periode08"," | createChronikTogglerSub("Schlacht","Schlacht"/*,hide*/); | ||
createChronikTogglerSub("Periode09"," | createChronikTogglerSub("Turnier","Turnier"/*,hide*/); | ||
createChronikTogglerSub("Periode10"," | $("div.ChronikToggler").append('<br/><div style="display:inline-block;width:100px;text-align:right;margin:5px;font-size:0.7em;">Zeit:</div>'); | ||
createChronikTogglerSub("Periode11"," | createChronikTogglerSub("Periode01","Die Taten der Altvorderen"/*,hide*/); | ||
createChronikTogglerSub("Periode12"," | createChronikTogglerSub("Periode02","Gründerzeit"/*,hide*/); | ||
createChronikTogglerSub("Periode13"," | createChronikTogglerSub("Periode03","Die Dunklen Zeiten"/*,hide*/); | ||
createChronikTogglerSub("Periode14"," | createChronikTogglerSub("Periode04","Ferdoker Fürsten"/*,hide*/); | ||
createChronikTogglerSub("Periode05","Garether Fürsten"/*,hide*/); | |||
createChronikTogglerSub("Periode06","Sonnenfürsten"/*,hide*/); | |||
createChronikTogglerSub("Periode07","Rohalszeit"/*,hide*/); | |||
createChronikTogglerSub("Periode08","Magierkriege"/*,hide*/); | |||
createChronikTogglerSub("Periode09","Grafenzeit"/*,hide*/); | |||
createChronikTogglerSub("Periode10","Angbarer Zitadellenfürsten"/*,hide*/); | |||
createChronikTogglerSub("Periode11","Der falsche Fürst"/*,hide*/); | |||
createChronikTogglerSub("Periode12","Angbarer Schlossfürsten"/*,hide*/); | |||
createChronikTogglerSub("Periode13","Fürst Blasius"/*,hide*/); | |||
createChronikTogglerSub("Periode14","Fürst Anshold"/*,hide*/); | |||
} | } | ||
mw.hook('wikipage.content').add(createChronikToggler); | mw.hook('wikipage.content').add(createChronikToggler); | ||
//Column Toggle Buttons | |||
function createColumnTogglerSub(count,title) { | |||
$("div.ColumnToggler").append('<div style="display:inline-block;width:100px;text-align:center;margin:5px;font-size:0.7em;cursor:pointer;" class="ColumnToggle dunkel" id="ColumnToggle'+count+'">'+title+'</div>'); | |||
$("#ColumnToggle"+count).click(function() { | |||
$("div.ColumnToToggle").css("column-count",count); | |||
}); | |||
} | |||
function createColumnToggler() { | |||
createColumnTogglerSub("1","einspaltig"); | |||
createColumnTogglerSub("2","zweispaltig"); | |||
createColumnTogglerSub("3","dreispaltig"); | |||
} | |||
mw.hook('wikipage.content').add(createColumnToggler); | |||
//Stammbaum Buttons | |||
function createStammbaumButtons() { | |||
$("div.StammbaumButtons").append('<div style="display:inline-block;width:100px;text-align:center;margin:5px;font-size:0.7em;cursor:pointer;" class="ColumnToggle dunkel" id="SBAusklappen">Ausklappen</div>'); | |||
$("div.StammbaumButtons").append('<div style="display:inline-block;width:100px;text-align:center;margin:5px;font-size:0.7em;cursor:pointer;" class="ColumnToggle dunkel" id="SBEinklappen">Einklappen</div>'); | |||
$("div#SBAusklappen").click(function() { | |||
$("div.fancytree").fancytree("getTree").visit(function(node){ | |||
node.setExpanded(true); | |||
}); | |||
}); | |||
$("div#SBEinklappen").click(function() { | |||
$("div.fancytree").fancytree("getTree").visit(function(node){ | |||
node.setExpanded(false); | |||
}); | |||
}); | |||
} | |||
mw.hook('wikipage.content').add(createStammbaumButtons); | |||
//FlowOverview | |||
$(document).ready( function() { | |||
$('.flowoverviewtoggler').click( function() { | |||
var c=$('#flowoverviewhideclosed').is(':checked'); | |||
var s=$('#flowoverviewhidesummarized').is(':checked'); | |||
var d=$('#flowoverviewhidedeleted').is(':checked'); | |||
$('.flowoverviewrow').each( function() { | |||
var no=(!$(this).hasClass('flowoverviewc'))&&(!$(this).hasClass('flowoverviews'))&&(!$(this).hasClass('flowoverviewd')); | |||
var c2=c&&$(this).hasClass('flowoverviewc'); | |||
var s2=s&&$(this).hasClass('flowoverviews'); | |||
var d2=d&&$(this).hasClass('flowoverviewd'); | |||
if(no||c2||s2||d2) | |||
$(this).show(); | |||
else | |||
$(this).hide(); | |||
} ); | |||
} ); | |||
} ); |
Aktuelle Version vom 6. November 2024, 05:35 Uhr
var customizeToolbar = function() { $('#wpTextbox1').wikiEditor('addToToolbar', { 'sections': { 'garetienwiki': { 'type': 'toolbar', 'label': 'KoschWiki' } } } ); $('#wpTextbox1').wikiEditor('addToToolbar', { 'section': 'garetienwiki', 'groups': { 'briefspielbuttons': { 'label': 'Briefspiel' } } } ); $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'garetienwiki', group: 'briefspielbuttons', tools: { 'briefspielbuttonshaupt': { label: 'Hautpdarsteller ist', type: 'button', icon: '/images/8/88/Button_Hauptdarstellerist.png', action: { type: 'encapsulate', options: { pre: "Hauptdarsteller ist::" } } } } }); $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'garetienwiki', group: 'briefspielbuttons', tools: { 'briefspielbuttonsneben': { label: 'Nebendarsteller ist', type: 'button', icon: '/images/a/ab/Button_Nebendarstellerist.png', action: { type: 'encapsulate', options: { pre: "Nebendarsteller ist::" } } } } }); $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'garetienwiki', group: 'briefspielbuttons', tools: { 'briefspielbuttonsbrief': { label: 'Briefspieltext mit', type: 'button', icon: '/images/3/36/Button_Briefspieltextmit.png', action: { type: 'encapsulate', options: { pre: "Briefspieltext mit::" } } } } }); $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'garetienwiki', group: 'briefspielbuttons', tools: { 'briefspielbuttonsorthandl': { label: 'Handlungsort ist', type: 'button', icon: '/images/5/51/Button_Handlungsortist.png', action: { type: 'encapsulate', options: { pre: "Handlungsort ist::" } } } } }); $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'garetienwiki', group: 'briefspielbuttons', tools: { 'briefspielbuttonsortnenn': { label: 'Ortsnennung ist', type: 'button', icon: '/images/6/68/Button_Ortsnennungist.png', action: { type: 'encapsulate', options: { pre: "Ortsnennung ist::" } } } } }); $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'garetienwiki', group: 'briefspielbuttons', tools: { 'briefspielbuttonsjahrist': { label: 'Jahr ist', type: 'button', icon: '/images/0/0c/Button_Jahrist.png', action: { type: 'encapsulate', options: { pre: "Jahr ist::" } } } } }); } if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) { mw.loader.using( 'user.options', function () { if ( mw.user.options.get('usebetatoolbar') ) { mw.loader.using( 'ext.wikiEditor.toolbar', function () { $(document).ready( customizeToolbar ); } ); } } ); } //Chronik Toggle Buttons function chronikTogglerUpdate() { var toggles=[]; $("div.ChronikToggle").each(function(index) { var fullid=this.id; var name=fullid.substring(13); toggles["Chronik"+name]=$("#"+fullid).hasClass("dunkel"); }); $("div.ChronikItem").each(function(index) { var wasvisible=$(this).is(":visible"); var visible=true; var classes=$(this).attr("class").split(' '); for(var line in classes) { if((typeof(toggles[classes[line]])!='undefined')&&(!toggles[classes[line]])) { visible=false; } } if((wasvisible)&&(!visible)) $(this).fadeOut(1000); if((!wasvisible)&&(visible)) $(this).fadeIn(1000); }); } function createChronikTogglerSub(name,title) { var search=$("div.Chronik"+name); if(search.length===0) return; $("div.ChronikToggler").append('<div style="display:inline-block;width:100px;text-align:center;margin:5px;font-size:0.7em;cursor:pointer;" class="ChronikToggle dunkel" id="ChronikToggle'+name+'">'+title+'</div>'); $("#ChronikToggle"+name).click(function() { if($(this).hasClass("hell")) { $(this).removeClass("hell"); $(this).addClass("dunkel"); } else { $(this).removeClass("dunkel"); $(this).addClass("hell"); } chronikTogglerUpdate(); }); } function createChronikToggler() { /* var hidestr=$("div.ChronikToggler").text(); if(!hidestr) hidestr=""; console.log("hidestr: "+hidestr); var hide=hidestr.split(";"); console.log("hide: "+hide);*/ $("div.ChronikToggler").text(""); $("div.ChronikToggler").append('<div style="display:inline-block;width:100px;text-align:right;margin:5px;font-size:0.7em;">Typ:</div>'); createChronikTogglerSub("Ereignis","Ereignis"/*,hide*/); createChronikTogglerSub("Herrscher","Herrscher"/*,hide*/); createChronikTogglerSub("Familie","Familie"/*,hide*/); createChronikTogglerSub("Tsatag","Tsatag"/*,hide*/); createChronikTogglerSub("Traviabund","Traviabund"/*,hide*/); createChronikTogglerSub("Borontag","Borontag"/*,hide*/); createChronikTogglerSub("Weihetag","Weihetag"/*,hide*/); createChronikTogglerSub("Schlacht","Schlacht"/*,hide*/); createChronikTogglerSub("Turnier","Turnier"/*,hide*/); $("div.ChronikToggler").append('<br/><div style="display:inline-block;width:100px;text-align:right;margin:5px;font-size:0.7em;">Zeit:</div>'); createChronikTogglerSub("Periode01","Die Taten der Altvorderen"/*,hide*/); createChronikTogglerSub("Periode02","Gründerzeit"/*,hide*/); createChronikTogglerSub("Periode03","Die Dunklen Zeiten"/*,hide*/); createChronikTogglerSub("Periode04","Ferdoker Fürsten"/*,hide*/); createChronikTogglerSub("Periode05","Garether Fürsten"/*,hide*/); createChronikTogglerSub("Periode06","Sonnenfürsten"/*,hide*/); createChronikTogglerSub("Periode07","Rohalszeit"/*,hide*/); createChronikTogglerSub("Periode08","Magierkriege"/*,hide*/); createChronikTogglerSub("Periode09","Grafenzeit"/*,hide*/); createChronikTogglerSub("Periode10","Angbarer Zitadellenfürsten"/*,hide*/); createChronikTogglerSub("Periode11","Der falsche Fürst"/*,hide*/); createChronikTogglerSub("Periode12","Angbarer Schlossfürsten"/*,hide*/); createChronikTogglerSub("Periode13","Fürst Blasius"/*,hide*/); createChronikTogglerSub("Periode14","Fürst Anshold"/*,hide*/); } mw.hook('wikipage.content').add(createChronikToggler); //Column Toggle Buttons function createColumnTogglerSub(count,title) { $("div.ColumnToggler").append('<div style="display:inline-block;width:100px;text-align:center;margin:5px;font-size:0.7em;cursor:pointer;" class="ColumnToggle dunkel" id="ColumnToggle'+count+'">'+title+'</div>'); $("#ColumnToggle"+count).click(function() { $("div.ColumnToToggle").css("column-count",count); }); } function createColumnToggler() { createColumnTogglerSub("1","einspaltig"); createColumnTogglerSub("2","zweispaltig"); createColumnTogglerSub("3","dreispaltig"); } mw.hook('wikipage.content').add(createColumnToggler); //Stammbaum Buttons function createStammbaumButtons() { $("div.StammbaumButtons").append('<div style="display:inline-block;width:100px;text-align:center;margin:5px;font-size:0.7em;cursor:pointer;" class="ColumnToggle dunkel" id="SBAusklappen">Ausklappen</div>'); $("div.StammbaumButtons").append('<div style="display:inline-block;width:100px;text-align:center;margin:5px;font-size:0.7em;cursor:pointer;" class="ColumnToggle dunkel" id="SBEinklappen">Einklappen</div>'); $("div#SBAusklappen").click(function() { $("div.fancytree").fancytree("getTree").visit(function(node){ node.setExpanded(true); }); }); $("div#SBEinklappen").click(function() { $("div.fancytree").fancytree("getTree").visit(function(node){ node.setExpanded(false); }); }); } mw.hook('wikipage.content').add(createStammbaumButtons); //FlowOverview $(document).ready( function() { $('.flowoverviewtoggler').click( function() { var c=$('#flowoverviewhideclosed').is(':checked'); var s=$('#flowoverviewhidesummarized').is(':checked'); var d=$('#flowoverviewhidedeleted').is(':checked'); $('.flowoverviewrow').each( function() { var no=(!$(this).hasClass('flowoverviewc'))&&(!$(this).hasClass('flowoverviews'))&&(!$(this).hasClass('flowoverviewd')); var c2=c&&$(this).hasClass('flowoverviewc'); var s2=s&&$(this).hasClass('flowoverviews'); var d2=d&&$(this).hasClass('flowoverviewd'); if(no||c2||s2||d2) $(this).show(); else $(this).hide(); } ); } ); } );