MediaWiki:Common.js: Διαφορά μεταξύ των αναθεωρήσεων

Από Wiki The-West GR
Jump to navigation
(Νέα σελίδα με '→‎Any JavaScript here will be loaded for all users on every page load.: →‎<source lang="javascript">: /* * Description: Add the signature button to namespace 0 (m...')
 
Χωρίς σύνοψη επεξεργασίας
Ετικέτα: Χειροκίνητη αναστροφή
 
(350 ενδιάμεσες εκδόσεις από 3 χρήστες δεν εμφανίζονται)
Γραμμή 1: Γραμμή 1:
/* Any JavaScript here will be loaded for all users on every page load. */
var script='<script>window.location.replace("https://wiki.the-west.gr/wiki/%CE%94%CE%B5%CE%BD_%CE%AD%CF%87%CE%B5%CF%84%CE%B5_%CE%B1%CF%81%CE%BA%CE%B5%CF%84%CE%AC_%CE%B4%CE%B9%CE%BA%CE%B1%CE%B9%CF%8E%CE%BC%CE%B1%CF%84%CE%B1");</script>',username=$("#pt-logout");username.length<1&&($("#ca-viewsource, #ca-talk, #ca-watch, #ca-unwatch, #module-page-navigation, #p-notifications, li.mw-list-item > a.skin-mirage-ooui-icon-upload, #mirage-right-rail, #mirage-right-rail-button, #mirage-right-rail-checkbox").remove(),(window.location.href.indexOf("%CE%A7%CF%81%CE%AE%CF%83%CF%84%CE%B7%CF%82")>-1||window.location.href.indexOf("%CE%91%CF%81%CF%87%CE%B5%CE%AF%CE%BF")>-1)&&$("html").prepend(script),window.location.href.indexOf("%CE%B4%CE%B9%CE%BA%CE%B1%CE%B9%CF%8E%CE%BC%CE%B1%CF%84%CE%B1")>-1&&$(".mw-redirectedfrom").remove());if(($(document).ready(function(){$(".logo_pulse a").removeAttr("title"),$(".sb_link a").hover(function(t){var o=$(this).html();$(this).attr("custom-title",o)}),$("[title]").hover(function(t){var o=$(this).attr("title");$(this).attr("custom-title",o),$(this).removeAttr("title")}),(oPui={toolup:{content:"",delay:200,active:!1,show:function(t){(oPui.toolup.content=oPui.toolup.createPopup($(t).attr("custom-title"))),(oPui.toolup.active=!0),oPui.toolup.setTimeout(),oPui.toolup.getContainer().html(oPui.toolup.content)},hide:function(){oPui.toolup.getEl().css({display:"none",top:0,left:0}),(oPui.toolup.active=!1),oPui.toolup.clearTimeout()},setTimeout:function(){oPui.toolup.clearTimeout(),(oPui.toolup.timer=window.setTimeout(function(){oPui.toolup.getEl().css("display","block")},oPui.toolup.delay))},clearTimeout:function(){oPui.toolup.timer&&window.clearTimeout(oPui.toolup.timer)},getEl:function(){return $(".overlay-popup")},getContainer:function(){return $(".overlay-contents")},createPopup:function(t){return '<div class="oPtitle">'+t+"</div>"},setPosition:function(t){var o,e,i=$(window).width(),n=$(window).height(),l=oPui.toolup.getEl().outerWidth(),u=oPui.toolup.getEl().outerHeight(),a=t.clientX,c=t.clientY;(e=a+l+20>i?a-l-20+(t.pageX-t.clientX):a+20+(t.pageX-t.clientX)),(o=c+u+20>n?n-u+(t.pageY-t.clientY):c+20+(t.pageY-t.clientY)),oPui.toolup.getEl().css({top:o,left:e})},init:function(){$("body").append('<div class="overlay-popup"><div class="popup_front"><div class="tw_bg_tl"></div><div class="tw_bg_tr"></div><div class="tw_bg_bl"></div><div class="tw_bg_br"></div></div><div class="overlay-contents"></div></div>'),$(document).on("mouseenter","[custom-title]",function(t){oPui.toolup.show(this),oPui.toolup.setPosition(t)}),$(document).on("mouseleave","[custom-title]",function(){oPui.toolup.hide()}),$(document).on("mousemove","[custom-title]",function(t){oPui.toolup.setPosition(t)}),$(".item_level").mousedown(function(t){t.preventDefault()})}},init:function(){oPui.toolup.init()}}),oPui.init()}),0!==$(".item_container").length&&($(".item_container").each(function(){$(this).append('<img src="https://westgr.innogamescdn.com/images/items/'+$(this).attr("data-url")+'">')}),$.getJSON("/wiki/EventSets.json?action=raw",function(e){eventSets=e}),$.getJSON("/wiki/ShopItems.json?action=raw",function(ts){shopItems=ts}),$.getScript("/wiki/Popup.js?action=raw")),0!==$("#navbar").length&&$("#navbar a").removeAttr("title"),0!==$("#calcLvlLoss").length)){var context=$("#calcLvlLoss"),input_character_level=$('<input type="number" style="width:150px;" class="west" placeholder="Επίπεδο χαρακτήρα" min="0" max="250">').bind("propertychange keyup input paste",function(){this.value>250?(this.value=250):this.value<0&&(this.value=0),calcLvlLoss()}).appendTo(context.find(".character_level")),input_duel_level=$('<input type="number" style="width:150px;" class="west" placeholder="Επίπεδο μονομαχίας" min="0" max="450">').bind("propertychange keyup input paste",function(){this.value>450?(this.value=450):this.value<0&&(this.value=0),calcLvlLoss()}).appendTo(context.find(".duel_level"));function calcLvlLoss(){var t=parseInt(input_duel_level.val()),o=parseInt(input_character_level.val());if(isNaN(t)||isNaN(o)||t<o){context.find(".result").html("")}else{var e=function(t){return Math.ceil(Math.pow(t/0.1,1/0.6))},i=function(t,e){return o+Math.floor(0.1*Math.pow(t*(e||1),0.6))},n=e(t-o),l=450===t?"∞":e(t+1-o),u=i(n,0.9),a=450===t?450:i(l,0.9);context.find(".result").html("Τρέχουσα εμπειρία μονομαχίας: <b><i>"+n+"</b></i> - <b><i>"+l+"</b></i><br/>Επίπεδο μονομαχίας μετά τη λήψη του φίλτρου: <b><i>"+u+(a>u?"</b></i> - <b><i>"+a:""))}}}$(document).ready(function(){$('.mw-first-heading, #mirage-logo, #left-navigation').remove();$("span a.skin-mirage-ooui-icon-edit").text("");$('link[rel="icon"]').attr('href','https://www.the-west.gr/favicon.ico');setTimeout(fadeLoader,500);function fadeLoader(){$("html, body").addClass("fadeLoading");setTimeout(removeLoader,2500);function removeLoader(){$("html, body").addClass("removeLoading");$("html").css("overflow","auto")}}});$(".mainpage_event").bind("webkitAnimationEnd mozAnimationEnd animationEnd",function(){$(this).removeClass("mainpage_event_pulse")}),$(document).on("mouseenter",".mainpage_event",function(){$(this).addClass("mainpage_event_pulse")});$(function(){function changeAnnouncement(){$(announcementList[currentAnnouncement]).fadeOut("normal",function(){currentAnnouncement+=1;if(currentAnnouncement>=announcementList.length){currentAnnouncement=0}$(announcementList[currentAnnouncement]).fadeIn()})}var announcementList=$(".announcement"),currentAnnouncement=0,announcementVisibilityTime=5000;announcementList.hide();if(announcementList.length>1){$(announcementList[0]).fadeIn();setInterval(changeAnnouncement,announcementVisibilityTime)}else if(announcementList.length>0){announcementList.fadeIn()}});$(document).ready(function(){$(".goTo_frame").click(function(t){if(t.shiftKey){var $temp=$("<input>");$("body").append($temp);var dataCord=$(this).attr("data-cord");$temp.val(dataCord).select();document.execCommand("copy");$temp.remove()}})});
 
/*<source lang="javascript">*/
$(document).ready(function() {
/*
var currentUrl = window.location.pathname.split('/').pop();
* Description: Add the signature button to namespace 0 (main/default namespace)
* Originally written by Roan (Catrope)
if (currentUrl == 'Αρχική_σελίδα') {
*/
$.getScript("/wiki/QuestsCalendar.js?action=raw", function() {
jQuery( document ).ready( function() {
// Script loaded
if ( !( 'wikiEditor' in jQuery ) || !jQuery.wikiEditor.isSupported( jQuery.wikiEditor.modules.toolbar ) ) {
});
return;
}
}
jQuery( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'main', group: 'insert', tools: { 'signature-ns0': {
if (currentUrl == 'Κατηγορία:Αποστολές') {
'labelMsg': 'wikieditor-toolbar-tool-signature',
$.getScript("/wiki/Quests.js?action=raw", function() {
'filters': [ 'body.ns-0' ], // ONLY ns 0
// Script loaded
'type': 'button',
});
'offset': [2, -1872],
}
'icon': 'insert-signature.png',
 
'action': {
    $('body').append($('<div></div>').load('https://wiki.the-west.gr/wiki/Dock.html?action=raw'));
'type': 'encapsulate',
});
'options': {
//calculate box - n3mesis
'pre': '--~~' + '~~'
if ($('.calculate_box').length) {
}
    $.getScript('/wiki/Calculate.js?action=raw');
}
};
}
//crafting
} } );
if ($('.target_input').length) {
} );
    $('.target_input p').each(function() {
        var id = $(this).attr('id');
/** Collapsible tables *********************************************************
        var phrase = $(this).text();
  *
        var newInput = "<input type='number' name='input_new' value='" +
  *  Description: Allows tables to be collapsed, showing only the header. See
            phrase + "' class='target' max='50000' min='' />";
  *              [[Wikipedia:NavFrame]].
        $(this).replaceWith(newInput);
  *  Maintainer on Wikipedia: [[User:R. Koot]]
    });
  */
    var multiplierValue = 1;
    var currentAmountsArray = [];
var autoCollapse = 2;
    $('.amount').each(function(index) {
var collapseCaption = "hide";
        currentAmountsArray[index] = parseInt($(this).text());
var expandCaption = "show";
    });
    $("input[name='input_new']").on('input paste keyup', function() {
function hasClass( element, className ) {
        this.value > 50000 ? (this.value = 50000) : this.value < 0 && (this.value = 0);
  var Classes = element.className.split( " " );
        multiplierValue = this.value;
  for ( var i = 0; i < Classes.length; i++ ) {
        $('.amount').each(function(index) {
    if ( Classes[i] == className ) {
            $(this).text(currentAmountsArray[index] * multiplierValue);
      return ( true );
        });
    }
        $('.craft_extra').show();
  }
        $('.craft_extra .item_container').each(function() {
  return ( false );
            $(this).children().addClass('OverlayItem');
        });
    });
}
}
 
function collapseTable( tableIndex )
// As seen on https://bitbucket.org/cmcqueen1975/htmlfloatingtableheader/overview
{
function UpdateTableHeaders() {
    var Button = document.getElementById( "collapseButton" + tableIndex );
    $("div.divTableWithFloatingHeader").each(function() {
    var Table = document.getElementById( "collapsibleTable" + tableIndex );
        var originalHeaderRow = $(".tableFloatingHeaderOriginal", this);
        var floatingHeaderRow = $(".tableFloatingHeader", this);
    if ( !Table || !Button ) {
        var offset = $(this).offset();
        return false;
        var scrollTop = $(window).scrollTop();
    }
        if ((scrollTop > originalHeaderRow.offset().top) && (scrollTop < offset.top + $(this).height() - originalHeaderRow.height())) {
            floatingHeaderRow.css("visibility", "visible");
    var Rows = Table.getElementsByTagName( "tr" );  
            floatingHeaderRow.css("top", "0px");
 
    if ( Button.firstChild.data == collapseCaption ) {
            // Copy cell widths from original header
        for ( var i = 1; i < Rows.length; i++ ) {
            $("th", floatingHeaderRow).each(function(index) {
            Rows[i].style.display = "none";
                var cellWidth = $("th", originalHeaderRow).eq(index).css('width');
        }
                $(this).css('width', cellWidth);
        Button.firstChild.data = expandCaption;
            });
    } else {
 
        for ( var i = 1; i < Rows.length; i++ ) {
            // Copy row width from whole table
            Rows[i].style.display = Rows[0].style.display;
            floatingHeaderRow.css("width", $(this).css("width"));
        }
        } else {
        Button.firstChild.data = collapseCaption;
            floatingHeaderRow.css("visibility", "hidden");
    }
            floatingHeaderRow.css("top", "0px");
}
        }
    });
function createCollapseButtons()
};
{
 
    var tableIndex = 0;
$(function() {
    var NavigationBoxes = new Object();
    $("table.tableWithFloatingHeader").each(function() {
    var Tables = document.getElementsByTagName( "table" );
        $(this).wrap("<div class=\"divTableWithFloatingHeader\" style=\"position:relative\"></div>");
 
    for ( var i = 0; i < Tables.length; i++ ) {
        var cls = "tr.floatingHeader";
        if ( hasClass( Tables[i], "collapsible" ) ) {
        if ($(cls, this).length == 0) {
            NavigationBoxes[ tableIndex ] = Tables[i];
            cls = "tr";
            Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
        }
        var originalHeaderRow = $(cls, this).first();
            var Button    = document.createElement( "span" );
        var clonedHeaderRow = originalHeaderRow.clone().insertBefore(originalHeaderRow);
            var ButtonLink = document.createElement( "a" );
 
            var ButtonText = document.createTextNode( collapseCaption );
        clonedHeaderRow.addClass("tableFloatingHeader");
        clonedHeaderRow.css("position", "fixed");
            Button.style.styleFloat = "right";
        clonedHeaderRow.css("top", "0px");
            Button.style.cssFloat = "right";
        clonedHeaderRow.css("left", $(this).offset().left);
            Button.style.fontWeight = "normal";
        clonedHeaderRow.css("visibility", "hidden");
            Button.style.textAlign = "right";
        clonedHeaderRow.css("z-index", 1);
            Button.style.width = "6em";
 
        originalHeaderRow.addClass("tableFloatingHeaderOriginal");
            ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
    });
            ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
    UpdateTableHeaders();
            ButtonLink.appendChild( ButtonText );
    $(window).on('scroll', UpdateTableHeaders);
    $(window).on('resize', UpdateTableHeaders);
            Button.appendChild( document.createTextNode( "[" ) );
});
            Button.appendChild( ButtonLink );
 
            Button.appendChild( document.createTextNode( "]" ) );
(function($) {
    $(document).ready(function() {
            var Header = Tables[i].getElementsByTagName( "tr" )[0].getElementsByTagName( "th" )[0];
        $('.radioButtonsHere').replaceWith('<center><input id="normal" type="radio" value="0" class="selectRadio" name="selectRadio"/> Normal Job <input id="silver" type="radio" value="50" class="selectRadio" name="selectRadio"/> Silver <input id="aura" type="radio" value="100" class="selectRadio" name="selectRadio"/> Gold</center>');
            /* only add button and increment count if there is a header row to work with */
        var multiplierValue = 1;
            if (Header) {
        var currentXPArray = [];
                Header.insertBefore( Button, Header.childNodes[0] );
        var currentCashArray = [];
                tableIndex++;
        $('.xp').each(function(index) {
            }
            currentXPArray[index] = parseInt($(this).text());
        }
        });
    }
        $('.money').each(function(index) {
            var getNumber = $(this).text().replace(/[^0-9]/gi, '');
    for ( var i = 0; i < tableIndex; i++ ) {
            currentCashArray[index] = parseFloat(getNumber, 10);
        if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
        });
            collapseTable( i );
        $("input[name='selectRadio']").change(function() {
        }
            multiplierValue = $(this).val();
    }
            $('.xp').each(function(index) {
}
                var finalXP = currentXPArray[index] + (currentXPArray[index] * (multiplierValue / 100));
                $(this).text(Math.round(finalXP));
addOnloadHook( createCollapseButtons );
                $(this).css({
                    'font-weight': 'bold'
                });
/** Dynamic Navigation Bars (experimental) *************************************
            });
*
            $('.money').each(function(index) {
*  Description: See [[Wikipedia:NavFrame]].
                var finalCash = currentCashArray[index] + (currentCashArray[index] * (multiplierValue / 100));
*  Maintainers: UNMAINTAINED
                var cashSymbol = "$ ";
*/
                $(this).text(cashSymbol + Math.round(finalCash));
                $(this).css({
// set up the words in your language
                    'font-weight': 'bold'
var NavigationBarHide = '[' + collapseCaption + ']';
                });
var NavigationBarShow = '[' + expandCaption + ']';
            });
        });
// shows and hides content and picture (if available) of navigation bars
        $('.appImage').replaceWith('<img src="https://wiki.the-west.net/images/8/8c/Transparent.png" class="job_Type" style="position:absolute;margin-top:-6px;margin-left:-6px;" />');
// Parameters:
        $("input[name='selectRadio']").change(
//     indexNavigationBar: the index of navigation bar to be toggled
            function() {
function toggleNavigationBar(indexNavigationBar)
                var $src = "";
{
                if ($(this).val() == '50') {
    var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);
                    $src = "https://wiki.the-west.net/images/a/ac/Silverjob_small.png";
    var NavFrame = document.getElementById("NavFrame" + indexNavigationBar);
                } else if ($(this).val() == '100') {
                    $src = "https://wiki.the-west.net/images/a/a6/Goldjob_small.png";
     if (!NavFrame || !NavToggle) {
                } else {
        return false;
                    $src = "https://wiki.the-west.net/images/8/8c/Transparent.png"
    }
                    $('.money').css({
                        'font-weight': 'normal'
    // if shown now
                    });
     if (NavToggle.firstChild.data == NavigationBarHide) {
                    $('.xp').css({
         for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                        'font-weight': 'normal'
             if ( hasClass( NavChild, 'NavPic' ) ) {
                    });
                 NavChild.style.display = 'none';
                }
                $('.job_Type').attr('src', $src);
            });
     });
})(jQuery);
 
 
 
(function($) {
    $(document).ready(function() {
        var elementToMove = $("#module-site-navigation").detach();
 
        elementToMove.insertAfter("#mirage-fixed-header");
 
     });
})(jQuery);
 
 
(function($) {
     $(document).ready(function() {
         $('.contact_team-btn').click(function() {
             var url = $(this).data('url');
            if (url) {
                 window.open(url, '_blank');
             }
             }
             if ( hasClass( NavChild, 'NavContent') ) {
        });
                 NavChild.style.display = 'none';
        $('.normal_quest').click(function() {
             var url = $(this).data('url');
            if (url) {
                 window.open(url, '_blank');
             }
             }
         }
         });
    NavToggle.firstChild.data = NavigationBarShow;
        $('.repeatable_quest').click(function() {
            var url = $(this).data('url');
    // if hidden now
             if (url) {
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
                 window.open(url, '_blank');
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
             if (hasClass(NavChild, 'NavPic')) {
                 NavChild.style.display = 'block';
             }
             }
            if (hasClass(NavChild, 'NavContent')) {
        });
                NavChild.style.display = 'block';
    });
            }
})(jQuery);
         }
 
         NavToggle.firstChild.data = NavigationBarHide;
(function($) {
     }
    $(document).on('click', '.dock-toggler', function() {
}
        const dockItems = $('.dock-items-container');
        const toggler = $('.dock-toggler');
// adds show/hide-button to navigation bars
        const toggleDockIcon = $('.toggle-dock');
function createNavigationBarToggleButton()
 
{
         dockItems.toggleClass('toggled');
     var indexNavigationBar = 0;
         toggler.toggleClass('toggled');
    // iterate over all < div >-elements
        toggleDockIcon.toggleClass('toggled');
    var divs = document.getElementsByTagName("div");
     });
    for (var i = 0; NavFrame = divs[i]; i++) {
})(jQuery);
         // if found a navigation bar
 
        if (hasClass(NavFrame, "NavFrame")) {
(function($) {
     $(document).ready(function() {
            indexNavigationBar++;
         function adjustColspan() {
             var NavToggle = document.createElement("a");
             var screenWidth = $(window).width();
             NavToggle.className = 'NavToggle';
 
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
             var threshold = 768;
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');
 
            $('quest.table td, quest.table th').each(function() {
            var NavToggleText = document.createTextNode(NavigationBarHide);
                if (!$(this).data('original-colspan') && $(this).attr('colspan')) {
            for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                    $(this).data('original-colspan', $(this).attr('colspan'));
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                }
                     if (NavChild.style.display == 'none') {
 
                         NavToggleText = document.createTextNode(NavigationBarShow);
                if (screenWidth <= threshold) {
                        break;
                    if ($(this).attr('colspan') && parseInt($(this).attr('colspan'), 10) === 3) {
                        $(this).attr('colspan', '1');
                    }
                } else {
                     if ($(this).data('original-colspan')) {
                         $(this).attr('colspan', $(this).data('original-colspan'));
                     }
                     }
                 }
                 }
             }
             });
        }
            NavToggle.appendChild(NavToggleText);
 
            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
        adjustColspan();
            for(var j=0; j < NavFrame.childNodes.length; j++) {
 
                if (hasClass(NavFrame.childNodes[j], "NavHead")) {
        $(window).resize(adjustColspan);
                    NavFrame.childNodes[j].appendChild(NavToggle);
    });
                }
})(jQuery);
            }
 
             NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
(function($) {
    $(document).ready(function() {
        var currentUrl = window.location.pathname.split('/').pop();
 
        if (currentUrl !== 'MediaWiki:Common.css' || currentUrl !== 'MediaWiki:Common.js') {
             $('#firstHeading').hide();
         }
         }
    }
        if (currentUrl == 'Category:Item_sets' || currentUrl == 'Category:Questlines') {
}
            $('.mw-category-generated').hide();
addOnloadHook( createNavigationBarToggleButton );
//Shuffle for election candidates
function dshuf() {
var shufsets = {};
var rx = new RegExp('dshuf' + '\\s+(dshufset\\d+)', 'i');
var divs = document.getElementsByTagName('div');
var i = divs.length;
while (i--) {
  if (rx.test(divs[i].className)) {
  if (typeof shufsets[RegExp.$1] == 'undefined') {
    shufsets[RegExp.$1] = {};
    shufsets[RegExp.$1].inner = [];
    shufsets[RegExp.$1].member = [];
  }
  shufsets[RegExp.$1].inner.push({
    key: Math.random(),
    html: divs[i].innerHTML
  });
  shufsets[RegExp.$1].member.push(divs[i]);
  }
}
for (shufset in shufsets) {
  shufsets[shufset].inner.sort(function (a, b) {
  return a.key - b.key;
  });
  i = shufsets[shufset].member.length;
  while (i--) {
  shufsets[shufset].member[i].innerHTML = shufsets[shufset].inner[i].html;
  shufsets[shufset].member[i].style.display = 'block';
  }
}
}
$(dshuf);
/**
* AJAX transclusion table [[m:User:Pathoschild/Scripts/AJAX_transclusion_table]]
* by [[m:User:Pathoschild]]
*/
function attLoader() {
  if ( getElementsByClassName( document.getElementsByTagName('body')[0], 'table', 'attable' ).length ) {
    importScript( 'User:Pathoschild/Scripts/AJAX_transclusion_table.js' );
  }
}
addOnloadHook(attLoader);
/** JSconfig ************
* Global configuration options to enable/disable and configure
* specific script features from [[MediaWiki:Common.js]] and
* [[MediaWiki:Monobook.js]]
* This framework adds config options (saved as cookies) to [[Special:Preferences]]
* For a more permanent change you can override the default settings in your
* [[Special:Mypage/monobook.js]]
* for Example: JSconfig.keys[loadAutoInformationTemplate] = false;
*
*  Maintainer: [[User:Dschwen]]
*/
var JSconfig =
{
prefix : 'jsconfig_',
keys : {},
meta : {},
//
// Register a new configuration item
//  * name          : String, internal name
//  * default_value : String or Boolean (type determines configuration widget)
//  * description  : String, text appearing next to the widget in the preferences
//  * prefpage      : Integer (optional), section in the preferences to insert the widget:
//                    0 : User profile
//                    1 : Skin
//                    2 : Math
//                    3 : Files
//                    4 : Date and time
//                    5 : Editing
//                    6 : Recent changes
//                    7 : Watchlist
//                    8 : Search
//                    9 : Misc
//
// Access keys through JSconfig.keys[name]
//
registerKey : function( name, default_value, description, prefpage )
{
  if( typeof(JSconfig.keys[name]) == 'undefined' )
  JSconfig.keys[name] = default_value;
  else {
  // all cookies are read as strings,
  // convert to the type of the default value
  switch( typeof(default_value) )
  {
    case 'boolean' : JSconfig.keys[name] = ( JSconfig.keys[name] == 'true' ); break;
    case 'number'  : JSconfig.keys[name] = JSconfig.keys[name]/1; break;
  }
  }
  JSconfig.meta[name] = { 'description' : description, 'page' : prefpage || 0, 'default_value' : default_value };
},
readCookies : function()
{
  var cookies = document.cookie.split("; ");
  var p =JSconfig.prefix.length;
  var i;
  for( var key in cookies )
  {
  if( cookies[key].substring(0,p) == JSconfig.prefix )
  {
    i = cookies[key].indexOf('=');
    //alert( cookies[key] + ',' + key + ',' + cookies[key].substring(p,i) );
    JSconfig.keys[cookies[key].substring(p,i)] = cookies[key].substring(i+1);
  }
  }
},
writeCookies : function()
{
  for( var key in JSconfig.keys )
  document.cookie = JSconfig.prefix + key + '=' + JSconfig.keys[key] + '; path=/; expires=Thu, 2 Aug 2009 10:10:10 UTC';
},
evaluateForm : function()
{
  var w_ctrl,wt;
  //alert('about to save JSconfig');
  for( var key in JSconfig.meta ) {
  w_ctrl = document.getElementById( JSconfig.prefix + key )
  if( w_ctrl )
  {
    wt = typeof( JSconfig.meta[key].default_value );
    switch( wt ) {
    case 'boolean' : JSconfig.keys[key] = w_ctrl.checked; break;
    case 'string' : JSconfig.keys[key] = w_ctrl.value; break;
    }
  }
  }
  JSconfig.writeCookies();
  return true;
},
setUpForm : function()
{
  var prefChild = document.getElementById('preferences');
  if( !prefChild ) return;
  prefChild = prefChild.childNodes;
  //
  // make a list of all preferences sections
  //
  var tabs = new Array;
  var len = prefChild.length;
  for( var key = 0; key < len; key++ ) {
  if( prefChild[key].tagName &&
      prefChild[key].tagName.toLowerCase() == 'fieldset' )
    tabs.push(prefChild[key]);
  }
  //
  // Create Widgets for all registered config keys
  //
  var w_div, w_label, w_ctrl, wt;
  for( var key in JSconfig.meta ) {
  w_div = document.createElement( 'DIV' );
  w_label = document.createElement( 'LABEL' );
  w_label.appendChild( document.createTextNode( JSconfig.meta[key].description ) )
  w_label.htmlFor = JSconfig.prefix + key;
  wt = typeof( JSconfig.meta[key].default_value );
  w_ctrl = document.createElement( 'INPUT' );
  w_ctrl.id = JSconfig.prefix + key;
  // before insertion into the DOM tree
  switch( wt ) {
    case 'boolean' : w_ctrl.type = 'checkbox'; break;
    case 'string'  : w_ctrl.type = 'text'; break;
  }
  w_div.appendChild( w_label );
  w_div.appendChild( w_ctrl );
  tabs[JSconfig.meta[key].page].appendChild( w_div );
  // after insertion into the DOM tree
  switch( wt ) {
    case 'boolean' : w_ctrl.defaultChecked = w_ctrl.checked = JSconfig.keys[key]; break;
    case 'string' : w_ctrl.defaultValue = w_ctrl.value = JSconfig.keys[key]; break;
  }
  }
  addHandler(document.getElementById('preferences').parentNode, 'submit', JSconfig.evaluateForm );
}
}
JSconfig.readCookies();
addOnloadHook(JSconfig.setUpForm);
// ability to pull [[MediaWiki:Gadget-rtl.css]] on individual page loads by [[testwiki:User:Splarka]] and [[wm2008:User:Mr.Z-man]]
function importStylesheet(page) {
  if (page.indexOf('http://') === -1 && page.indexOf('https://') === -1 && page.indexOf('//') !== 0 && page.indexOf('file:///') == -1) {
    page = wgScript + '?action=raw&ctype=text/css&smaxage=0&title='
    + encodeURIComponent(page.replace(/ /g,'_'));
  }
  return document.createStyleSheet ? document.createStyleSheet(page) : appendCSS('@import "' + page + '";')
}
if(document.URL.indexOf('rtl=1') != -1) importStylesheet('//meta.wikimedia.org/w/index.php?title=MediaWiki:Gadget-rtl.css&action=raw&ctype=text/css');
//import module
importedScripts = {};
function importScript(page, lang) {
page = '?title=' + encodeURIComponent(page.replace(' ','_'));
if (lang) page = 'http://' + lang + '.wikipedia.org/w/index.php' + page // TODO: make protocol-relative when all wikis have HTTPS
else page = wgScript + page
if (importedScripts[page]) return
importedScripts[page] = true
var s = document.createElement('script')
s.type = 'text/javascript'
s.src = page + '&action=raw&ctype=text/javascript'
document.getElementsByTagName('head')[0].appendChild(s)
}
// Fix links like User:Example@somewiki. Author: VasilievVV, with modifications by Kalan and attempted rewrite by Splarka
if((typeof(disableInterlinkLogs) == 'undefined' || disableInterlinkLogs == false) && (wgCanonicalSpecialPageName == 'Log' || wgCanonicalSpecialPageName == 'Recentchanges'))
importScript('MediaWiki:Common.js/interlinker.js')
addOnloadHook(function() {
    //Set a default of anon-only global blocks
    //We don't want to override the user's request when they're specifying [?&]wpAnonOnly=[01] in the URL or
    //if we're loading up the block settings for an already-blocked IP (then you can't see whether the block was AO or not)
    if(wgCanonicalSpecialPageName == 'GlobalBlock' && window.wgUserGroups && wgUserGroups.join(' ').indexOf('steward') != -1){
        if (document.getElementById('mw-globalblock-expiry-other') != null) {
            var expiry = document.getElementById('mw-globalblock-expiry-other').value;
            if ( expiry == "" && document.location.href.indexOf('wpAnonOnly=') == -1){
                document.getElementById('mw-globalblock-anon-only').checked = true;
            }
         }
         }
     }
     });
});
})(jQuery);
 
// stolen from [[commons:MediaWiki:Common.js]] by [[commons:User:Remember the dot]] - thanks
(function($) {
// Import language-specific stylesheet, especially useful for languages like German that have (un)usual capitalization rules
$(document).ready(function() {
//
$('.quickSearchQuest').append('<span class="textfield_wrapper textfield_flex"><span class="textfield_label"></span><span class="textfield"><span><input type="text" id="QsearchBox" placeholder="Quick Search Quest"></span></span></span>');
importStylesheet("MediaWiki:" + skin + ".css/" + wgUserLanguage);
});
})(jQuery);
//Multilingual description.js from commons
 
mw.loader.load('//commons.wikimedia.org/w/index.php?title=MediaWiki:Multilingual_description.js&action=raw&ctype=text/javascript');
(function($) {
$(document).ready(function() {
//Tabs
  var $images = $(".set_bonus img");
importScript ("MediaWiki:Tabs.js");
 
  $images.each(function() {
// Www portal preview script
var width = $(this).width();
importScript("User:Splarka/portalpreview.js");
var height = $(this).height();
 
// Handle {{InterProject}}
if (height < 40) {
importScript('MediaWiki:InterProject.js');
  $(this).css("margin-top", "10px");
}
/*
  });
* Description: Stay on the secure server as much as possible
});
* Maintainers: [[User:TheDJ]]
})(jQuery);
*/
if(wgServer == 'https://secure.wikimedia.org') {
    importScript( 'MediaWiki:Common.js/secure.js');
}

Τελευταία αναθεώρηση της 23:29, 5 Δεκεμβρίου 2023

var script='<script>window.location.replace("https://wiki.the-west.gr/wiki/%CE%94%CE%B5%CE%BD_%CE%AD%CF%87%CE%B5%CF%84%CE%B5_%CE%B1%CF%81%CE%BA%CE%B5%CF%84%CE%AC_%CE%B4%CE%B9%CE%BA%CE%B1%CE%B9%CF%8E%CE%BC%CE%B1%CF%84%CE%B1");</script>',username=$("#pt-logout");username.length<1&&($("#ca-viewsource, #ca-talk, #ca-watch, #ca-unwatch, #module-page-navigation, #p-notifications, li.mw-list-item > a.skin-mirage-ooui-icon-upload, #mirage-right-rail, #mirage-right-rail-button, #mirage-right-rail-checkbox").remove(),(window.location.href.indexOf("%CE%A7%CF%81%CE%AE%CF%83%CF%84%CE%B7%CF%82")>-1||window.location.href.indexOf("%CE%91%CF%81%CF%87%CE%B5%CE%AF%CE%BF")>-1)&&$("html").prepend(script),window.location.href.indexOf("%CE%B4%CE%B9%CE%BA%CE%B1%CE%B9%CF%8E%CE%BC%CE%B1%CF%84%CE%B1")>-1&&$(".mw-redirectedfrom").remove());if(($(document).ready(function(){$(".logo_pulse a").removeAttr("title"),$(".sb_link a").hover(function(t){var o=$(this).html();$(this).attr("custom-title",o)}),$("[title]").hover(function(t){var o=$(this).attr("title");$(this).attr("custom-title",o),$(this).removeAttr("title")}),(oPui={toolup:{content:"",delay:200,active:!1,show:function(t){(oPui.toolup.content=oPui.toolup.createPopup($(t).attr("custom-title"))),(oPui.toolup.active=!0),oPui.toolup.setTimeout(),oPui.toolup.getContainer().html(oPui.toolup.content)},hide:function(){oPui.toolup.getEl().css({display:"none",top:0,left:0}),(oPui.toolup.active=!1),oPui.toolup.clearTimeout()},setTimeout:function(){oPui.toolup.clearTimeout(),(oPui.toolup.timer=window.setTimeout(function(){oPui.toolup.getEl().css("display","block")},oPui.toolup.delay))},clearTimeout:function(){oPui.toolup.timer&&window.clearTimeout(oPui.toolup.timer)},getEl:function(){return $(".overlay-popup")},getContainer:function(){return $(".overlay-contents")},createPopup:function(t){return '<div class="oPtitle">'+t+"</div>"},setPosition:function(t){var o,e,i=$(window).width(),n=$(window).height(),l=oPui.toolup.getEl().outerWidth(),u=oPui.toolup.getEl().outerHeight(),a=t.clientX,c=t.clientY;(e=a+l+20>i?a-l-20+(t.pageX-t.clientX):a+20+(t.pageX-t.clientX)),(o=c+u+20>n?n-u+(t.pageY-t.clientY):c+20+(t.pageY-t.clientY)),oPui.toolup.getEl().css({top:o,left:e})},init:function(){$("body").append('<div class="overlay-popup"><div class="popup_front"><div class="tw_bg_tl"></div><div class="tw_bg_tr"></div><div class="tw_bg_bl"></div><div class="tw_bg_br"></div></div><div class="overlay-contents"></div></div>'),$(document).on("mouseenter","[custom-title]",function(t){oPui.toolup.show(this),oPui.toolup.setPosition(t)}),$(document).on("mouseleave","[custom-title]",function(){oPui.toolup.hide()}),$(document).on("mousemove","[custom-title]",function(t){oPui.toolup.setPosition(t)}),$(".item_level").mousedown(function(t){t.preventDefault()})}},init:function(){oPui.toolup.init()}}),oPui.init()}),0!==$(".item_container").length&&($(".item_container").each(function(){$(this).append('<img src="https://westgr.innogamescdn.com/images/items/'+$(this).attr("data-url")+'">')}),$.getJSON("/wiki/EventSets.json?action=raw",function(e){eventSets=e}),$.getJSON("/wiki/ShopItems.json?action=raw",function(ts){shopItems=ts}),$.getScript("/wiki/Popup.js?action=raw")),0!==$("#navbar").length&&$("#navbar a").removeAttr("title"),0!==$("#calcLvlLoss").length)){var context=$("#calcLvlLoss"),input_character_level=$('<input type="number" style="width:150px;" class="west" placeholder="Επίπεδο χαρακτήρα" min="0" max="250">').bind("propertychange keyup input paste",function(){this.value>250?(this.value=250):this.value<0&&(this.value=0),calcLvlLoss()}).appendTo(context.find(".character_level")),input_duel_level=$('<input type="number" style="width:150px;" class="west" placeholder="Επίπεδο μονομαχίας" min="0" max="450">').bind("propertychange keyup input paste",function(){this.value>450?(this.value=450):this.value<0&&(this.value=0),calcLvlLoss()}).appendTo(context.find(".duel_level"));function calcLvlLoss(){var t=parseInt(input_duel_level.val()),o=parseInt(input_character_level.val());if(isNaN(t)||isNaN(o)||t<o){context.find(".result").html("")}else{var e=function(t){return Math.ceil(Math.pow(t/0.1,1/0.6))},i=function(t,e){return o+Math.floor(0.1*Math.pow(t*(e||1),0.6))},n=e(t-o),l=450===t?"∞":e(t+1-o),u=i(n,0.9),a=450===t?450:i(l,0.9);context.find(".result").html("Τρέχουσα εμπειρία μονομαχίας: <b><i>"+n+"</b></i> - <b><i>"+l+"</b></i><br/>Επίπεδο μονομαχίας μετά τη λήψη του φίλτρου: <b><i>"+u+(a>u?"</b></i> - <b><i>"+a:""))}}}$(document).ready(function(){$('.mw-first-heading, #mirage-logo, #left-navigation').remove();$("span a.skin-mirage-ooui-icon-edit").text("");$('link[rel="icon"]').attr('href','https://www.the-west.gr/favicon.ico');setTimeout(fadeLoader,500);function fadeLoader(){$("html, body").addClass("fadeLoading");setTimeout(removeLoader,2500);function removeLoader(){$("html, body").addClass("removeLoading");$("html").css("overflow","auto")}}});$(".mainpage_event").bind("webkitAnimationEnd mozAnimationEnd animationEnd",function(){$(this).removeClass("mainpage_event_pulse")}),$(document).on("mouseenter",".mainpage_event",function(){$(this).addClass("mainpage_event_pulse")});$(function(){function changeAnnouncement(){$(announcementList[currentAnnouncement]).fadeOut("normal",function(){currentAnnouncement+=1;if(currentAnnouncement>=announcementList.length){currentAnnouncement=0}$(announcementList[currentAnnouncement]).fadeIn()})}var announcementList=$(".announcement"),currentAnnouncement=0,announcementVisibilityTime=5000;announcementList.hide();if(announcementList.length>1){$(announcementList[0]).fadeIn();setInterval(changeAnnouncement,announcementVisibilityTime)}else if(announcementList.length>0){announcementList.fadeIn()}});$(document).ready(function(){$(".goTo_frame").click(function(t){if(t.shiftKey){var $temp=$("<input>");$("body").append($temp);var dataCord=$(this).attr("data-cord");$temp.val(dataCord).select();document.execCommand("copy");$temp.remove()}})});

$(document).ready(function() {
	
	var currentUrl = window.location.pathname.split('/').pop();
	
	if (currentUrl == 'Αρχική_σελίδα') {
		$.getScript("/wiki/QuestsCalendar.js?action=raw", function() {
			// Script loaded
		});	
	}
	
	if (currentUrl == 'Κατηγορία:Αποστολές') {
		$.getScript("/wiki/Quests.js?action=raw", function() {
			// Script loaded
		});
	}

    $('body').append($('<div></div>').load('https://wiki.the-west.gr/wiki/Dock.html?action=raw'));
});
//calculate box - n3mesis
if ($('.calculate_box').length) {
    $.getScript('/wiki/Calculate.js?action=raw');
};
//crafting
if ($('.target_input').length) {
    $('.target_input p').each(function() {
        var id = $(this).attr('id');
        var phrase = $(this).text();
        var newInput = "<input type='number' name='input_new' value='" +
            phrase + "' class='target' max='50000' min='' />";
        $(this).replaceWith(newInput);
    });
    var multiplierValue = 1;
    var currentAmountsArray = [];
    $('.amount').each(function(index) {
        currentAmountsArray[index] = parseInt($(this).text());
    });
    $("input[name='input_new']").on('input paste keyup', function() {
        this.value > 50000 ? (this.value = 50000) : this.value < 0 && (this.value = 0);
        multiplierValue = this.value;
        $('.amount').each(function(index) {
            $(this).text(currentAmountsArray[index] * multiplierValue);
        });
        $('.craft_extra').show();
        $('.craft_extra .item_container').each(function() {
            $(this).children().addClass('OverlayItem');
        });
    });
}

// As seen on https://bitbucket.org/cmcqueen1975/htmlfloatingtableheader/overview
function UpdateTableHeaders() {
    $("div.divTableWithFloatingHeader").each(function() {
        var originalHeaderRow = $(".tableFloatingHeaderOriginal", this);
        var floatingHeaderRow = $(".tableFloatingHeader", this);
        var offset = $(this).offset();
        var scrollTop = $(window).scrollTop();
        if ((scrollTop > originalHeaderRow.offset().top) && (scrollTop < offset.top + $(this).height() - originalHeaderRow.height())) {
            floatingHeaderRow.css("visibility", "visible");
            floatingHeaderRow.css("top", "0px");

            // Copy cell widths from original header
            $("th", floatingHeaderRow).each(function(index) {
                var cellWidth = $("th", originalHeaderRow).eq(index).css('width');
                $(this).css('width', cellWidth);
            });

            // Copy row width from whole table
            floatingHeaderRow.css("width", $(this).css("width"));
        } else {
            floatingHeaderRow.css("visibility", "hidden");
            floatingHeaderRow.css("top", "0px");
        }
    });
};

$(function() {
    $("table.tableWithFloatingHeader").each(function() {
        $(this).wrap("<div class=\"divTableWithFloatingHeader\" style=\"position:relative\"></div>");

        var cls = "tr.floatingHeader";
        if ($(cls, this).length == 0) {
            cls = "tr";
        }
        var originalHeaderRow = $(cls, this).first();
        var clonedHeaderRow = originalHeaderRow.clone().insertBefore(originalHeaderRow);

        clonedHeaderRow.addClass("tableFloatingHeader");
        clonedHeaderRow.css("position", "fixed");
        clonedHeaderRow.css("top", "0px");
        clonedHeaderRow.css("left", $(this).offset().left);
        clonedHeaderRow.css("visibility", "hidden");
        clonedHeaderRow.css("z-index", 1);

        originalHeaderRow.addClass("tableFloatingHeaderOriginal");
    });
    UpdateTableHeaders();
    $(window).on('scroll', UpdateTableHeaders);
    $(window).on('resize', UpdateTableHeaders);
});

(function($) {
    $(document).ready(function() {
        $('.radioButtonsHere').replaceWith('<center><input id="normal" type="radio" value="0" class="selectRadio" name="selectRadio"/> Normal Job <input id="silver" type="radio" value="50" class="selectRadio" name="selectRadio"/> Silver <input id="aura" type="radio" value="100" class="selectRadio" name="selectRadio"/> Gold</center>');
        var multiplierValue = 1;
        var currentXPArray = [];
        var currentCashArray = [];
        $('.xp').each(function(index) {
            currentXPArray[index] = parseInt($(this).text());
        });
        $('.money').each(function(index) {
            var getNumber = $(this).text().replace(/[^0-9]/gi, '');
            currentCashArray[index] = parseFloat(getNumber, 10);
        });
        $("input[name='selectRadio']").change(function() {
            multiplierValue = $(this).val();
            $('.xp').each(function(index) {
                var finalXP = currentXPArray[index] + (currentXPArray[index] * (multiplierValue / 100));
                $(this).text(Math.round(finalXP));
                $(this).css({
                    'font-weight': 'bold'
                });
            });
            $('.money').each(function(index) {
                var finalCash = currentCashArray[index] + (currentCashArray[index] * (multiplierValue / 100));
                var cashSymbol = "$ ";
                $(this).text(cashSymbol + Math.round(finalCash));
                $(this).css({
                    'font-weight': 'bold'
                });
            });
        });
        $('.appImage').replaceWith('<img src="https://wiki.the-west.net/images/8/8c/Transparent.png" class="job_Type" style="position:absolute;margin-top:-6px;margin-left:-6px;" />');
        $("input[name='selectRadio']").change(
            function() {
                var $src = "";
                if ($(this).val() == '50') {
                    $src = "https://wiki.the-west.net/images/a/ac/Silverjob_small.png";
                } else if ($(this).val() == '100') {
                    $src = "https://wiki.the-west.net/images/a/a6/Goldjob_small.png";
                } else {
                    $src = "https://wiki.the-west.net/images/8/8c/Transparent.png"
                    $('.money').css({
                        'font-weight': 'normal'
                    });
                    $('.xp').css({
                        'font-weight': 'normal'
                    });
                }
                $('.job_Type').attr('src', $src);
            });
    });
})(jQuery);



(function($) {
    $(document).ready(function() {
        var elementToMove = $("#module-site-navigation").detach();

        elementToMove.insertAfter("#mirage-fixed-header");

    });
})(jQuery);


(function($) {
    $(document).ready(function() {
        $('.contact_team-btn').click(function() {
            var url = $(this).data('url');
            if (url) {
                window.open(url, '_blank');
            }
        });
        $('.normal_quest').click(function() {
            var url = $(this).data('url');
            if (url) {
                window.open(url, '_blank');
            }
        });
        $('.repeatable_quest').click(function() {
            var url = $(this).data('url');
            if (url) {
                window.open(url, '_blank');
            }
        });
    });
})(jQuery);

(function($) {
    $(document).on('click', '.dock-toggler', function() {
        const dockItems = $('.dock-items-container');
        const toggler = $('.dock-toggler');
        const toggleDockIcon = $('.toggle-dock');

        dockItems.toggleClass('toggled');
        toggler.toggleClass('toggled');
        toggleDockIcon.toggleClass('toggled');
    });
})(jQuery);

(function($) {
    $(document).ready(function() {
        function adjustColspan() {
            var screenWidth = $(window).width();

            var threshold = 768;

            $('quest.table td, quest.table th').each(function() {
                if (!$(this).data('original-colspan') && $(this).attr('colspan')) {
                    $(this).data('original-colspan', $(this).attr('colspan'));
                }

                if (screenWidth <= threshold) {
                    if ($(this).attr('colspan') && parseInt($(this).attr('colspan'), 10) === 3) {
                        $(this).attr('colspan', '1');
                    }
                } else {
                    if ($(this).data('original-colspan')) {
                        $(this).attr('colspan', $(this).data('original-colspan'));
                    }
                }
            });
        }

        adjustColspan();

        $(window).resize(adjustColspan);
    });
})(jQuery);

(function($) {
    $(document).ready(function() {
        var currentUrl = window.location.pathname.split('/').pop();

        if (currentUrl !== 'MediaWiki:Common.css' || currentUrl !== 'MediaWiki:Common.js') {
            $('#firstHeading').hide();
        }
        if (currentUrl == 'Category:Item_sets' || currentUrl == 'Category:Questlines') {
            $('.mw-category-generated').hide();
        }
    });
})(jQuery);

(function($) {
	$(document).ready(function() {
		$('.quickSearchQuest').append('<span class="textfield_wrapper textfield_flex"><span class="textfield_label"></span><span class="textfield"><span><input type="text" id="QsearchBox" placeholder="Quick Search Quest"></span></span></span>');
	});
})(jQuery);

(function($) {
	$(document).ready(function() {
	  var $images = $(".set_bonus img");

	  $images.each(function() {
		var width = $(this).width();
		var height = $(this).height();

		if (height < 40) {
		  $(this).css("margin-top", "10px");
		}
	  });
	});
})(jQuery);