MediaWiki:Common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
(7 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 42: | Zeile 42: | ||
$('#wpTextbox1').wikiEditor('addToToolbar', { | $('#wpTextbox1').wikiEditor('addToToolbar', { | ||
section: 'garetienwiki', group: 'briefspielbuttons', | section: 'garetienwiki', group: 'briefspielbuttons', | ||
tools: { ' | tools: { 'briefspielbuttonsjahrist': { label: 'Jahr ist', type: 'button', icon: '/images/0/0c/Button_Jahrist.png', | ||
action: { type: 'encapsulate', options: { pre: " | action: { type: 'encapsulate', options: { pre: "Jahr ist::" | ||
} } } } }); | } } } } }); | ||
} | } | ||
Zeile 70: | Zeile 57: | ||
} ); | } ); | ||
} | } | ||
//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(); | |||
} ); | |||
} ); | |||
} ); |
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(); } ); } ); } );