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

Από Wiki The-West GR
Jump to navigation
Χωρίς σύνοψη επεξεργασίας
Χωρίς σύνοψη επεξεργασίας
Ετικέτα: Χειροκίνητη αναστροφή
 
(216 ενδιάμεσες εκδόσεις από 2 χρήστες δεν εμφανίζονται)
Γραμμή 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()}})});
$('.tbbox-logo').wrap('<a href="/wiki/Αρχική_σελίδα"></a>');
 
$(document).ready(function() {
$(document).ready(function() {
     $('.clignote a').removeAttr('title');
     $('.sb_link a').hover(function(ea){
var currentUrl = window.location.pathname.split('/').pop();
         var a = $(this).html();
         $(this).attr('custom-title', a);
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());
     });
     });
     $('[title]').hover(function(et){
     $("input[name='input_new']").on('input paste keyup', function() {
         var customtitle = $(this).attr('title');
         this.value > 50000 ? (this.value = 50000) : this.value < 0 && (this.value = 0);
         $(this).attr('custom-title', customtitle);
        multiplierValue = this.value;
         $(this).removeAttr('title');
        $('.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");
         }
     });
     });
         oPui = {
};
 
$(function() {
    $("table.tableWithFloatingHeader").each(function() {
         $(this).wrap("<div class=\"divTableWithFloatingHeader\" style=\"position:relative\"></div>");


            toolup: {
        var cls = "tr.floatingHeader";
                content: "",
        if ($(cls, this).length == 0) {
                delay: 200,
            cls = "tr";
                active: !1,
        }
                show: function(t) {
        var originalHeaderRow = $(cls, this).first();
                    oPui.toolup.content = oPui.toolup.createPopup($(t).attr("custom-title")), oPui.toolup.active = !0, oPui.toolup.setTimeout(), oPui.toolup.getContainer().html(oPui.toolup.content)
        var clonedHeaderRow = originalHeaderRow.clone().insertBefore(originalHeaderRow);
                },
 
                hide: function() {
        clonedHeaderRow.addClass("tableFloatingHeader");
                    oPui.toolup.getEl().css({
        clonedHeaderRow.css("position", "fixed");
                        display: "none",
        clonedHeaderRow.css("top", "0px");
                        top: 0,
        clonedHeaderRow.css("left", $(this).offset().left);
                        left: 0
        clonedHeaderRow.css("visibility", "hidden");
                    }), oPui.toolup.active = !1, oPui.toolup.clearTimeout()
        clonedHeaderRow.css("z-index", 1);
                },
 
                setTimeout: function() {
        originalHeaderRow.addClass("tableFloatingHeaderOriginal");
                    oPui.toolup.clearTimeout(), oPui.toolup.timer = window.setTimeout(function() {
    });
                        oPui.toolup.getEl().css("display", "block")
    UpdateTableHeaders();
                    }, oPui.toolup.delay)
    $(window).on('scroll', UpdateTableHeaders);
                },
    $(window).on('resize', UpdateTableHeaders);
                clearTimeout: function() {
});
                    oPui.toolup.timer && window.clearTimeout(oPui.toolup.timer)
 
                },
(function($) {
                getEl: function() {
    $(document).ready(function() {
                    return $(".overlay-popup")
        $('.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;
                getContainer: function() {
        var currentXPArray = [];
                    return $(".overlay-contents")
        var currentCashArray = [];
                },
        $('.xp').each(function(index) {
                createPopup: function (t) {
            currentXPArray[index] = parseInt($(this).text());
                    var s = '<div class="oPtitle">'+t+'</div>';
        });
                    return s;
        $('.money').each(function(index) {
                },
            var getNumber = $(this).text().replace(/[^0-9]/gi, '');
                setPosition: function(t) {
            currentCashArray[index] = parseFloat(getNumber, 10);
                    var e, i, a = $(window).width(),
        });
                        s = $(window).height(),
        $("input[name='selectRadio']").change(function() {
                        p = oPui.toolup.getEl().outerWidth(),
            multiplierValue = $(this).val();
                        n = oPui.toolup.getEl().outerHeight(),
            $('.xp').each(function(index) {
                        o = t.clientX,
                var finalXP = currentXPArray[index] + (currentXPArray[index] * (multiplierValue / 100));
                        l = t.clientY;
                $(this).text(Math.round(finalXP));
                    i = o + p + 20 > a ? o - p - 20 + (t.pageX - t.clientX) : o + 20 + (t.pageX - t.clientX), e = l + n + 20 > s ? s - n + (t.pageY - t.clientY) : l + 20 + (t.pageY - t.clientY), oPui.toolup.getEl().css({
                $(this).css({
                        top: e,
                    'font-weight': 'bold'
                        left: i
                });
                    })
            });
                },
            $('.money').each(function(index) {
                init: function() {
                var finalCash = currentCashArray[index] + (currentCashArray[index] * (multiplierValue / 100));
                    $("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) {
                var cashSymbol = "$ ";
                        oPui.toolup.show(this), oPui.toolup.setPosition(t)
                $(this).text(cashSymbol + Math.round(finalCash));
                     }), $(document).on("mouseleave", "[custom-title]", function() {
                $(this).css({
                        oPui.toolup.hide()
                    'font-weight': 'bold'
                     }), $(document).on("mousemove", "[custom-title]", function(t) {
                });
                         oPui.toolup.setPosition(t)
            });
                     }), $(".item_level").mousedown(function(t) {
        });
                         t.preventDefault()
        $('.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);
             init: function() {
             });
                 oPui.toolup.init()
    });
})(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');
             }
             }
         }, oPui.init();
         });
});
    });
})(jQuery);
 
(function($) {
    $(document).on('click', '.dock-toggler', function() {
        const dockItems = $('.dock-items-container');
        const toggler = $('.dock-toggler');
        const toggleDockIcon = $('.toggle-dock');


if ($('.item_container').length!==0) {
        dockItems.toggleClass('toggled');
    $('.item_container').each(function() {
         toggler.toggleClass('toggled');
         $(this).append('<img src="https://westgr.innogamescdn.com/images/items/' + $(this).attr('data-url') + '">');
        toggleDockIcon.toggleClass('toggled');
     });
     });
     $.getScript("https://wiki.the-west.gr/wiki/Popup.js?action=raw");
})(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).scroll(function() {
        $(window).resize(adjustColspan);
    if ($(this).scrollTop() > 100) {
     });
        $('#back-top').fadeIn();
})(jQuery);
     } else {
        $('#back-top').fadeOut();
    }
});
// Scroll body to top on click
$('#back-top a').click(function() {
    $('body,html').animate({
        scrollTop: 0
    }, 800);
    return false;
});


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


if ($('#navbar').length !== 0) {
        if (currentUrl !== 'MediaWiki:Common.css' || currentUrl !== 'MediaWiki:Common.js') {
    $('#navbar a').removeAttr("title");
            $('#firstHeading').hide();
}
        }
// Embed youtube videos
        if (currentUrl == 'Category:Item_sets' || currentUrl == 'Category:Questlines') {
if ($('.youtube_video').length !== 0) {
            $('.mw-category-generated').hide();
    $('.youtube_video').each(function() {
        }
        $(this).html('<iframe width="100%" height="100%" src="https://www.youtube.com/embed/' + $(this).attr('data-id') + '?cc_load_policy=1&cc_lang_pref=' + $(this).attr('data-subtitles') + '" frameborder="0" allowfullscreen></iframe>');
     });
     });
}
})(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();


//Configuration du tri des diacritique dans les tables de class "sortable"
if (height < 40) {
mw.config.set( 'tableSorterCollation', {'à':'a', 'â':'a', 'æ':'ae', 'é':'e', 'è':'e', 'ê':'e', 'î':'i', 'ï':'i', 'ô':'o', 'œ':'oe', 'û':'u', 'ç':'c',  } );
  $(this).css("margin-top", "10px");
if ($('#calcLvlLoss').length !== 0) {
}
  var context = $('#calcLvlLoss');
  });
  var input_character_level = $('<input type="number" style="width:150px;" class="west" placeholder="Επίπεδο χαρακτήρα" min="0" max="150">').bind("propertychange keyup input paste", function() {
});
    if (this.value > 150) {
})(jQuery);
      this.value = 150;
    } else if (this.value < 0) {
      this.value = 0;
    }
    calcLvlLoss();
  }).appendTo(context.find(".character_level"));
  var input_duel_level = $('<input type="number" style="width:150px;" class="west" placeholder="Επίπεδο μονομαχίας" min="0" max="450">').bind("propertychange keyup input paste", function() {
    if (this.value > 450) {
      this.value = 450;
    } else if (this.value < 0) {
      this.value = 0;
    }
    calcLvlLoss();
  }).appendTo(context.find(".duel_level"));
  function calcLvlLoss() {
    var duel_lvl = parseInt(input_duel_level.val()),
      char_lvl = parseInt(input_character_level.val());
    if (isNaN(duel_lvl) || isNaN(char_lvl) || duel_lvl < char_lvl) {
      context.find('.result').html('');
    } else {
      var getXp = function(lvl) {
          return Math.ceil(Math.pow((lvl) / 0.1, 1 / 0.6));
        },
        getLvl = function(xp, perc) {
          return char_lvl + Math.floor(Math.pow(xp * (perc || 1), 0.6) * 0.1);
        };
      var minXp = getXp(duel_lvl - char_lvl),
        maxXp = duel_lvl === 450 ? '∞' : getXp(duel_lvl + 1 - char_lvl),
        minLvl = getLvl(minXp, 0.9),
        maxLvl = duel_lvl === 450 ? 450 : getLvl(maxXp, 0.9);
      context.find('.result').html('Τρέχουσα εμπειρία μονομαχίας: <b><i>' + minXp + '</b></i> - <b><i>' + maxXp + '</b></i><br/>Επίπεδο μονομαχίας μετά τη λήψη του φίλτρου: <b><i>' + minLvl + (maxLvl > minLvl ? '</b></i> - <b><i>' + maxLvl : ''));
    }
  }
}

Τελευταία αναθεώρηση της 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);