MediaWiki:Common.js: differenze tra le versioni

Da Wiki The-West IT.
Vai alla navigazione
Nessun oggetto della modifica
Nessun oggetto della modifica
 
(96 versioni intermedie di 3 utenti non mostrate)
Riga 1: Riga 1:
/*******************************
/* Any JavaScript here will be loaded for all users on every page load. */
/* Wiki Subpage Tooltip Script *
$('.tbbox-logo').wrap('<a href="/wiki/Pagina_principale"></a>');
/*******************************/
if ($('.item_container').length!==0) {
// Author:  Shawn Bruckner
    $('.item_container').each(function() {
// Date:    2013-Apr-28
        $(this).append('<img src="https://westzz.innogamescdn.com/images/items/' + $(this).attr('data-url') + '">');
// License: CC-BY 3.0
    });
// Version: beta
    $.getScript("https://wiki.the-west.it/wiki/Popup.js?action=raw");
}


var wst = wst || {
$(window).scroll(function() {
    if ($(this).scrollTop() > 100) {
        $('#back-top').fadeIn();
    } else {
        $('#back-top').fadeOut();
    }
});
// Scroll body to top on click
$('#back-top a').click(function() {
    $('body,html').animate({
        scrollTop: 0
    }, 800);
    return false;
});
// Embed youtube videos
if ($('.youtube_video').length !== 0) {
    $('.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>');
    });
}


    dataSubpageTitle : '/Tooltip',
//Let's generate an input box - Criminus
    loadingTemplate: 'Template:Tooltip hover box loading',
$('.target_input p').each(function() {
    loadedTemplate: 'Template:Tooltip hover box',
var id = $(this).attr('id');
    loadingHtml: null,
var phrase = $(this).text();
    classPrefix: 'wst-tooltip-',
var newInput="<input type='number' name='input_nou' value='"+phrase+"' class='target' max='999' min='1' />";
    articlePath : null,
$(this).replaceWith(newInput);
    fullScriptPath : null,
});
    scriptPath: null,
    dataTitlesToCheck: Array(),
    contentTitles: Array(),
    dataTitles: Array(),


    encodeAllSpecial : function( unencoded ) {
$("input[name=input_nou]").on("click", function() {
        var encoded = "";
    if ($(this).val() == "1")
        var c;
        $(this).val("")
        var safeChars = /[0-9A-Za-z]/;
});
        for( var i = 0; i < unencoded.length; i++ ) {
            c = unencoded.charAt(i);
            if ( safeChars.test( c ) ) {
                encoded = encoded + c;
            } else {
                encoded = encoded + '_' + c.charCodeAt().toString(16) + '-';
            }
        }
        return encoded;
    },


    getTitleFromHref : function( href ) {
$(function () {
        var end;
  $("input[name=input_nou]").keydown(function () {
        var result = null;
    // Save old value.
        if ( href.indexOf( wst.fullScriptPath ) === 0 ) {
    if (!$(this).val() || (parseInt($(this).val()) <= 9999 && parseInt($(this).val()) >= 0))
            end = href.substring( wst.fullScriptPath.length );
    $(this).data("old", $(this).val());
            result = ( new RegExp( 'title=([^&]*)' ) ).exec( end );
  });
        } else if ( href.indexOf( wst.scriptPath ) === 0 ) {
  $("input[name=input_nou]").keyup(function () {
            end = href.substring( wst.scriptPath.length );
    // Check correct, else revert back to old value.
            result = ( new RegExp( 'title=([^&]*)' ) ).exec( end );
    if (!$(this).val() || (parseInt($(this).val()) <= 9999 && parseInt($(this).val()) >= 0))
        } else if ( href.indexOf( wst.articlePath ) === 0 ) {
      ;
            end = href.substring( wst.articlePath.length );
    else
            result = ( new RegExp( '([^?]*)' ) ).exec( end );
      $(this).val($(this).data("old"));
        }
  });
});


         if ( result ) {
(function($) {
             if ( result[1].substring(0, 8) !== "Special:" ) {
    $(document).ready(function() {
                 return decodeURIComponent( result[1] );
         var multiplierValue = 1;
            } else {
        var currentAmountsArray = [];
                 return null;
        $('.item_number').each(function(index) {
            }
             currentAmountsArray[index] = parseInt($(this).text());
        } else {
        });
            return null;
        if ($("input[name='input_nou']").length > 0) {
        }
            $("input[name='input_nou']").change(function() {
    },
                 multiplierValue = $(this).val();
                $('.item_number').each(function(index) {
                    $(this).text(currentAmountsArray[index] * multiplierValue);
                });
                 $('.craft_extra').show();
                $('.craft_extra .item_container').each(function() {
                    $(this).children().addClass('OverlayItem');
                });


    getTitlesAndContentLinks : function() {
            });
        var links = $( '#mw-content-text a[href]' );
            $("input[name='input_nou']").keyup(function() {
        var uniqueTitles = {};
                multiplierValue = $(this).val();
        var title;
                $('.item_number').each(function(index) {
 
                    $(this).text(currentAmountsArray[index] * multiplierValue);
        for ( var i = 0; i < links.length; i++ ) {
                });
            if( title = wst.getTitleFromHref( links[i].href ) ) {
                $('.craft_extra').show();
                 uniqueTitles[title] = null; // hackish way to ensure only unique titles are added
                $('.craft_extra .item_container').each(function() {
             }
                    $(this).children().addClass('OverlayItem');
                 });
             });
         }
         }
    });
})(jQuery);


        for ( uniqueTitle in uniqueTitles ) {  
//Live search through craft items - Criminus
          wst.dataTitlesToCheck.push( uniqueTitle + wst.dataSubpageTitle ); // put unique titles into the array
$('.search_craft p').each(function() {
        }
var id = $(this).attr('id');
    },
var phrase = $(this).text();
var newInput="<input type='text' id='live_search' name='craft_search' value='"+phrase+"' class='craft_search' />";
$(this).replaceWith(newInput);
});


    beginLinkSetup : function() {
$("#live_search").on("keyup", function() {
        wst.articlePath = mw.config.get( 'wgServer' ) + mw.config.get( 'wgArticlePath' ).replace( /\$1/, '' );
    var value = $(this).val();
        wst.fullScriptPath = mw.config.get( 'wgServer' ) + mw.config.get( 'wgScript' );
    $("table tr").each(function(index) {
        wst.scriptPath = mw.config.get( 'wgScript' );
         if (index !== 0) {
 
             $row = $(this);
        wst.getTitlesAndContentLinks();
            var id = $.map($row.find('td .item_container'), function(element) {
 
                return $(element).attr("data-popup")
        if ( wst.dataTitlesToCheck.length > 0 ) {
             }).join(' ');
            $.ajax( {
             if (id.toLowerCase().indexOf(value.toLowerCase()) < 0) {
                type: 'POST',
                 $row.hide();
                url: mw.util.wikiScript( 'api' ),
            } else {
                data: { action: 'parse', format: 'json', text: '{{:' + wst.loadingTemplate + '}}' },
                 $row.show();
                dataType: 'json',
                success: wst.midLinkSetup
            } );
        }
    },
 
    midLinkSetup: function( jsonData ) {
         wst.loadingHtml = jsonData.parse.text['*'];
 
        wst.startQueryPageExistence();       
    },
 
    startQueryPageExistence : function( ) {
        titleSubset = Array();
        for ( i = 0; i < 50 && wst.dataTitlesToCheck.length > 0; i++ ) {
             titleSubset.push( wst.dataTitlesToCheck.pop() );
        }
        var titles = titleSubset.join( '|' );
 
        $.ajax( {
            type: 'POST',
            url: mw.util.wikiScript( 'api' ),
            data: { action: 'query', format: 'json', titles: titles },
            dataType: 'json',
            success: wst.finishQueryPageExistence
        } );
    },
 
    finishQueryPageExistence : function( jsonData ) {
        wst.filterTitles( jsonData.query.pages );
 
        if ( wst.dataTitlesToCheck.length > 0 ) {
            wst.startQueryPageExistence();
        } else {
             wst.finishLinkSetup();
        }
    },
 
    filterTitles : function( pageData ) {
        var result, title;
        for ( index in pageData ) {
            result = pageData[index];
             if ( result.missing === undefined ) {
                title = result.title.replace( / /g, '_' );
                 wst.dataTitles.push( title );
                 wst.contentTitles.push( title.substring( 0, title.length - wst.dataSubpageTitle.length ) );
             }
             }
         }
         }
     },
     });
 
});
    finishLinkSetup : function( ) {
        for ( var i = 0; i < wst.contentTitles.length; i++ ) {
            $( 'body' ).append( '<div id="' + wst.classPrefix + wst.encodeAllSpecial( wst.contentTitles[i] ) +
                '" style="display: none; position: absolute; z-index: 10000;">' +
                wst.loadingHtml.replace( /\$1/, wst.contentTitles[i].replace( /_/, " " ) ) + '</div>' );
        }
 
        var title, id;
        var links = $( '#mw-content-text a[href]' );
        for ( var i = 0; i < links.length; i++ ) {
            title = wst.getTitleFromHref( links[i].href );
            if ( title !== null && $.inArray( title, wst.contentTitles ) !== -1 ) {
                id = wst.classPrefix + wst.encodeAllSpecial( title );
                links.eq(i).on( 'mouseover', { id : id, title : title }, function( event ) { wst.showTooltip( event ); } );
                links.eq(i).on( 'mousemove', { id : id }, function( event ) { wst.moveTooltip( event ); } );
                links.eq(i).on( 'mouseout', { id : id }, function( event ) { wst.hideTooltip( event ); } );
            }
        }
    },
 
    showTooltip : function( event ) {
        tooltipBox = $( '#' + event.data.id );
        wst.positionTooltip( event.data.id, event.pageX, event.pageY );
        tooltipBox.fadeIn();
 
        if ( !tooltipBox.hasClass( 'loaded' ) && !tooltipBox.hasClass( 'loading' ) ) {
            tooltipBox.addClass( wst.classPrefix + 'loading' );
            wst.beginLoadTooltip( event.data.id, event.data.title );
        }
    },
 
    beginLoadTooltip : function( id, title ) {
        $.ajax( {
            type: 'POST',
            url: mw.util.wikiScript( 'api' ),
            data: { action: 'parse', format: 'json', title: title.replace( /_/, ' ' ),
                text: '{{:' + title + wst.dataSubpageTitle + '|' + wst.loadedTemplate + '}}' },
            dataType: 'json',
            success: function( jsonData ) { wst.finishLoadTooltip( id, jsonData ); }
        } );
    },
 
    finishLoadTooltip : function( id, jsonData ) {
        tooltipBox = $( '#' + id );
        tooltipBox.addClass( 'loaded' );
        tooltipBox.removeClass( 'loading' );
        tooltipBox.html( jsonData.parse.text['*'] );
    },
 
    moveTooltip : function( event ) {
        wst.positionTooltip( event.data.id, event.pageX, event.pageY );
    },
 
    positionTooltip: function( id, pageX, pageY ) {
        var tooltip = $( '#' + id );
        var bodyOffsets = document.body.getBoundingClientRect();
        var bodyX = pageX - bodyOffsets.left;
        var bodyY = pageY - bodyOffsets.top;
        var scrollX = $( document ).scrollLeft();
        var scrollY = $( document ).scrollTop();
        var bodyWidth = $( 'body' ).width();
        var bodyHeight = $( 'body' ).height();
        var viewWidth = $( window ).width();
        var viewHeight = $( window ).height();
        var topAdjust = 6;
 
        if ( tooltip.width() * 1.1 > pageX - scrollX ) {
            tooltip.css( { 'left' : bodyX - scrollX + 15, 'right' : 'auto' } );
            topAdjust = 36;
        } else {
            tooltip.css( { 'right' : bodyWidth - bodyX + scrollX + 6, 'left' : 'auto' } );
        }
 
        if ( tooltip.height() * 1.5 > pageY - scrollY ) {
            tooltip.css( { 'top' : bodyY - scrollY + topAdjust, 'bottom' : 'auto' } );
        } else {
            tooltip.css( { 'bottom' : bodyHeight - bodyY + scrollY + 3, 'top' : 'auto' } );
        }
    },
 
    hideTooltip : function( event ) {
        $( '#' + event.data.id ).fadeOut();
    }


};
$("#live_search").on("click", function() {
    if ($(this).val() == "Nome o ID")
        $(this).val("")
});


mw.loader.using( 'mediawiki.util' ).then( function() {
(function($) {
    wst.beginLinkSetup();
    $(document).ready(function() {
} );
$('.radioButtonsHere').replaceWith('<center><input id="normal" type="radio" value="0" class="selectRadio" name="selectRadio"/> Semplice <input id="silver" type="radio" value="50" class="selectRadio" name="selectRadio"/> Argento <input id="aura" type="radio" value="100" class="selectRadio" name="selectRadio"/> Oro</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);


/***********************************
/**
/* End Wiki Subpage Tooltip Script *
  stickybits - Stickybits is a lightweight alternative to `position: sticky` polyfills
/***********************************/
  @version v3.4.1
  @link https://github.com/dollarshaveclub/stickybits#readme
  @author Jeff Wainwright <yowainwright@gmail.com> (https://jeffry.in)
  @license MIT
**/
!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s():"function"==typeof define&&define.amd?define(s):s()}(0,function(){"use strict";var s=function(){function t(t,s){var e=void 0!==s?s:{};this.version="3.4.1",this.userAgent=window.navigator.userAgent||"no `userAgent` provided by the browser",this.props={customStickyChangeNumber:e.customStickyChangeNumber||null,noStyles:e.noStyles||!1,stickyBitStickyOffset:e.stickyBitStickyOffset||0,parentClass:e.parentClass||"js-stickybit-parent",scrollEl:"string"==typeof e.scrollEl?document.querySelector(e.scrollEl):e.scrollEl||window,stickyClass:e.stickyClass||"js-is-sticky",stuckClass:e.stuckClass||"js-is-stuck",stickyChangeClass:e.stickyChangeClass||"js-is-sticky--change",useStickyClasses:e.useStickyClasses||!1,useFixed:e.useFixed||!1,verticalPosition:e.verticalPosition||"top"};var i=this.props;i.positionVal=this.definePosition()||"fixed";var n=i.verticalPosition,o=i.noStyles,a=i.positionVal;this.els="string"==typeof t?document.querySelectorAll(t):t,"length"in this.els||(this.els=[this.els]),this.instances=[];for(var r=0;r<this.els.length;r+=1){var l=this.els[r],c=l.style;if(c[n]="top"!==n||o?"":i.stickyBitStickyOffset+"px",c.position="fixed"!==a?a:"","fixed"===a||i.useStickyClasses){var f=this.addInstance(l,i);this.instances.push(f)}}return this}var s=t.prototype;return s.definePosition=function(){var t;if(this.props.useFixed)t="fixed";else{for(var s=["","-o-","-webkit-","-moz-","-ms-"],e=document.head.style,i=0;i<s.length;i+=1)e.position=s[i]+"sticky";t=e.position?e.position:"fixed",e.position=""}return t},s.addInstance=function(t,s){var e=this,i={el:t,parent:t.parentNode,props:s};this.isWin=this.props.scrollEl===window;var n=this.isWin?window:this.getClosestParent(i.el,i.props.scrollEl);return this.computeScrollOffsets(i),i.parent.className+=" "+s.parentClass,i.state="default",i.stateContainer=function(){return e.manageState(i)},n.addEventListener("scroll",i.stateContainer),i},s.getClosestParent=function(t,s){var e=s,i=t;if(i.parentElement===e)return e;for(;i.parentElement!==e;)i=i.parentElement;return e},s.getOffsetTop=function(t){for(var s=0;s=t.offsetTop+s,t=t.offsetParent;);return s},s.computeScrollOffsets=function(t){var s=t,e=s.props,i=s.el,n=s.parent,o=!this.isWin&&"fixed"===e.positionVal,a="bottom"!==e.verticalPosition,r=o?this.getOffsetTop(e.scrollEl):0,l=o?this.getOffsetTop(n)-r:this.getOffsetTop(n),c=null!==e.customStickyChangeNumber?e.customStickyChangeNumber:i.offsetHeight;return s.offset=r+e.stickyBitStickyOffset,s.stickyStart=a?l-s.offset:0,s.stickyChange=s.stickyStart+c,s.stickyStop=a?l+n.offsetHeight-(s.el.offsetHeight+s.offset):l+n.offsetHeight,s},s.toggleClasses=function(t,s,e){var i=t,n=i.className.split(" ");e&&-1===n.indexOf(e)&&n.push(e);var o=n.indexOf(s);-1!==o&&n.splice(o,1),i.className=n.join(" ")},s.manageState=function(t){var s=t,e=s.el,i=s.props,n=s.state,o=s.stickyStart,a=s.stickyChange,r=s.stickyStop,l=e.style,c=i.noStyles,f=i.positionVal,u=i.scrollEl,p=i.stickyClass,h=i.stickyChangeClass,y=i.stuckClass,d=i.verticalPosition,k=function(t){t()},m=this.isWin&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame)||k,g=this.toggleClasses,v=this.isWin?window.scrollY||window.pageYOffset:u.scrollTop,C=v<=o&&"sticky"===n,w=r<=v&&"sticky"===n;o<v&&v<r&&("default"===n||"stuck"===n)?(s.state="sticky",m(function(){g(e,y,p),l.position=f,c||(l.bottom="",l[d]=i.stickyBitStickyOffset+"px")})):C?(s.state="default",m(function(){g(e,p),"fixed"===f&&(l.position="")})):w&&(s.state="stuck",m(function(){g(e,p,y),"fixed"!==f||c||(l.top="",l.bottom="0",l.position="absolute")}));var S=a<=v&&v<=r;return v<a||r<v?m(function(){g(e,h)}):S&&m(function(){g(e,"stub",h)}),s},s.update=function(){for(var t=0;t<this.instances.length;t+=1){var s=this.instances[t];this.computeScrollOffsets(s)}return this},s.removeInstance=function(t){var s=t.el,e=t.props,i=this.toggleClasses;s.style.position="",s.style[e.verticalPosition]="",i(s,e.stickyClass),i(s,e.stuckClass),i(s.parentNode,e.parentClass)},s.cleanup=function(){for(var t=0;t<this.instances.length;t+=1){var s=this.instances[t];s.props.scrollEl.removeEventListener("scroll",s.stateContainer),this.removeInstance(s)}this.manageState=!1,this.instances=[]},t}();if("undefined"!=typeof window){var t=window.$||window.jQuery||window.Zepto;t&&(t.fn.stickybits=function(t){return new s(this,t)})}});
$('#right_menu').stickybits({stickyBitStickyOffset: 25});

Versione attuale delle 13:39, 12 nov 2022

/* Any JavaScript here will be loaded for all users on every page load. */
$('.tbbox-logo').wrap('<a href="/wiki/Pagina_principale"></a>');
if ($('.item_container').length!==0) {
    $('.item_container').each(function() {
        $(this).append('<img src="https://westzz.innogamescdn.com/images/items/' + $(this).attr('data-url') + '">');
    });
    $.getScript("https://wiki.the-west.it/wiki/Popup.js?action=raw");
}

$(window).scroll(function() {
    if ($(this).scrollTop() > 100) {
        $('#back-top').fadeIn();
    } else {
        $('#back-top').fadeOut();
    }
});
// Scroll body to top on click
$('#back-top a').click(function() {
    $('body,html').animate({
        scrollTop: 0
    }, 800);
    return false;
});
// Embed youtube videos
if ($('.youtube_video').length !== 0) {
    $('.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>');
    });
}

//Let's generate an input box - Criminus
$('.target_input p').each(function() {
	var id = $(this).attr('id');
	var phrase = $(this).text();
	var newInput="<input type='number' name='input_nou' value='"+phrase+"' class='target' max='999' min='1' />";
	$(this).replaceWith(newInput);
});

$("input[name=input_nou]").on("click", function() {
    if ($(this).val() == "1")
        $(this).val("")
});

$(function () {
  $("input[name=input_nou]").keydown(function () {
    // Save old value.
    if (!$(this).val() || (parseInt($(this).val()) <= 9999 && parseInt($(this).val()) >= 0))
    $(this).data("old", $(this).val());
  });
  $("input[name=input_nou]").keyup(function () {
    // Check correct, else revert back to old value.
    if (!$(this).val() || (parseInt($(this).val()) <= 9999 && parseInt($(this).val()) >= 0))
      ;
    else
      $(this).val($(this).data("old"));
  });
});

(function($) {
    $(document).ready(function() {
        var multiplierValue = 1;
        var currentAmountsArray = [];
        $('.item_number').each(function(index) {
            currentAmountsArray[index] = parseInt($(this).text());
        });
        if ($("input[name='input_nou']").length > 0) {
            $("input[name='input_nou']").change(function() {
                multiplierValue = $(this).val();
                $('.item_number').each(function(index) {
                    $(this).text(currentAmountsArray[index] * multiplierValue);
                });
                $('.craft_extra').show();
                $('.craft_extra .item_container').each(function() {
                    $(this).children().addClass('OverlayItem');
                });

            });
            $("input[name='input_nou']").keyup(function() {
                multiplierValue = $(this).val();
                $('.item_number').each(function(index) {
                    $(this).text(currentAmountsArray[index] * multiplierValue);
                });
                $('.craft_extra').show();
                $('.craft_extra .item_container').each(function() {
                    $(this).children().addClass('OverlayItem');
                });
            });
        }
    });
})(jQuery);

//Live search through craft items - Criminus
$('.search_craft p').each(function() {
	var id = $(this).attr('id');
	var phrase = $(this).text();
	var newInput="<input type='text' id='live_search' name='craft_search' value='"+phrase+"' class='craft_search' />";
	$(this).replaceWith(newInput);
});

$("#live_search").on("keyup", function() {
    var value = $(this).val();
    $("table tr").each(function(index) {
        if (index !== 0) {
            $row = $(this);
            var id = $.map($row.find('td .item_container'), function(element) {
                return $(element).attr("data-popup")
            }).join(' ');
            if (id.toLowerCase().indexOf(value.toLowerCase()) < 0) {
                $row.hide();
            } else {
                $row.show();
            }
        }
    });
});

$("#live_search").on("click", function() {
    if ($(this).val() == "Nome o ID")
        $(this).val("")
});

(function($) {
    $(document).ready(function() {
		$('.radioButtonsHere').replaceWith('<center><input id="normal" type="radio" value="0" class="selectRadio" name="selectRadio"/> Semplice <input id="silver" type="radio" value="50" class="selectRadio" name="selectRadio"/> Argento <input id="aura" type="radio" value="100" class="selectRadio" name="selectRadio"/> Oro</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);

/**
  stickybits - Stickybits is a lightweight alternative to `position: sticky` polyfills
  @version v3.4.1
  @link https://github.com/dollarshaveclub/stickybits#readme
  @author Jeff Wainwright <yowainwright@gmail.com> (https://jeffry.in)
  @license MIT
**/
!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s():"function"==typeof define&&define.amd?define(s):s()}(0,function(){"use strict";var s=function(){function t(t,s){var e=void 0!==s?s:{};this.version="3.4.1",this.userAgent=window.navigator.userAgent||"no `userAgent` provided by the browser",this.props={customStickyChangeNumber:e.customStickyChangeNumber||null,noStyles:e.noStyles||!1,stickyBitStickyOffset:e.stickyBitStickyOffset||0,parentClass:e.parentClass||"js-stickybit-parent",scrollEl:"string"==typeof e.scrollEl?document.querySelector(e.scrollEl):e.scrollEl||window,stickyClass:e.stickyClass||"js-is-sticky",stuckClass:e.stuckClass||"js-is-stuck",stickyChangeClass:e.stickyChangeClass||"js-is-sticky--change",useStickyClasses:e.useStickyClasses||!1,useFixed:e.useFixed||!1,verticalPosition:e.verticalPosition||"top"};var i=this.props;i.positionVal=this.definePosition()||"fixed";var n=i.verticalPosition,o=i.noStyles,a=i.positionVal;this.els="string"==typeof t?document.querySelectorAll(t):t,"length"in this.els||(this.els=[this.els]),this.instances=[];for(var r=0;r<this.els.length;r+=1){var l=this.els[r],c=l.style;if(c[n]="top"!==n||o?"":i.stickyBitStickyOffset+"px",c.position="fixed"!==a?a:"","fixed"===a||i.useStickyClasses){var f=this.addInstance(l,i);this.instances.push(f)}}return this}var s=t.prototype;return s.definePosition=function(){var t;if(this.props.useFixed)t="fixed";else{for(var s=["","-o-","-webkit-","-moz-","-ms-"],e=document.head.style,i=0;i<s.length;i+=1)e.position=s[i]+"sticky";t=e.position?e.position:"fixed",e.position=""}return t},s.addInstance=function(t,s){var e=this,i={el:t,parent:t.parentNode,props:s};this.isWin=this.props.scrollEl===window;var n=this.isWin?window:this.getClosestParent(i.el,i.props.scrollEl);return this.computeScrollOffsets(i),i.parent.className+=" "+s.parentClass,i.state="default",i.stateContainer=function(){return e.manageState(i)},n.addEventListener("scroll",i.stateContainer),i},s.getClosestParent=function(t,s){var e=s,i=t;if(i.parentElement===e)return e;for(;i.parentElement!==e;)i=i.parentElement;return e},s.getOffsetTop=function(t){for(var s=0;s=t.offsetTop+s,t=t.offsetParent;);return s},s.computeScrollOffsets=function(t){var s=t,e=s.props,i=s.el,n=s.parent,o=!this.isWin&&"fixed"===e.positionVal,a="bottom"!==e.verticalPosition,r=o?this.getOffsetTop(e.scrollEl):0,l=o?this.getOffsetTop(n)-r:this.getOffsetTop(n),c=null!==e.customStickyChangeNumber?e.customStickyChangeNumber:i.offsetHeight;return s.offset=r+e.stickyBitStickyOffset,s.stickyStart=a?l-s.offset:0,s.stickyChange=s.stickyStart+c,s.stickyStop=a?l+n.offsetHeight-(s.el.offsetHeight+s.offset):l+n.offsetHeight,s},s.toggleClasses=function(t,s,e){var i=t,n=i.className.split(" ");e&&-1===n.indexOf(e)&&n.push(e);var o=n.indexOf(s);-1!==o&&n.splice(o,1),i.className=n.join(" ")},s.manageState=function(t){var s=t,e=s.el,i=s.props,n=s.state,o=s.stickyStart,a=s.stickyChange,r=s.stickyStop,l=e.style,c=i.noStyles,f=i.positionVal,u=i.scrollEl,p=i.stickyClass,h=i.stickyChangeClass,y=i.stuckClass,d=i.verticalPosition,k=function(t){t()},m=this.isWin&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame)||k,g=this.toggleClasses,v=this.isWin?window.scrollY||window.pageYOffset:u.scrollTop,C=v<=o&&"sticky"===n,w=r<=v&&"sticky"===n;o<v&&v<r&&("default"===n||"stuck"===n)?(s.state="sticky",m(function(){g(e,y,p),l.position=f,c||(l.bottom="",l[d]=i.stickyBitStickyOffset+"px")})):C?(s.state="default",m(function(){g(e,p),"fixed"===f&&(l.position="")})):w&&(s.state="stuck",m(function(){g(e,p,y),"fixed"!==f||c||(l.top="",l.bottom="0",l.position="absolute")}));var S=a<=v&&v<=r;return v<a||r<v?m(function(){g(e,h)}):S&&m(function(){g(e,"stub",h)}),s},s.update=function(){for(var t=0;t<this.instances.length;t+=1){var s=this.instances[t];this.computeScrollOffsets(s)}return this},s.removeInstance=function(t){var s=t.el,e=t.props,i=this.toggleClasses;s.style.position="",s.style[e.verticalPosition]="",i(s,e.stickyClass),i(s,e.stuckClass),i(s.parentNode,e.parentClass)},s.cleanup=function(){for(var t=0;t<this.instances.length;t+=1){var s=this.instances[t];s.props.scrollEl.removeEventListener("scroll",s.stateContainer),this.removeInstance(s)}this.manageState=!1,this.instances=[]},t}();if("undefined"!=typeof window){var t=window.$||window.jQuery||window.Zepto;t&&(t.fn.stickybits=function(t){return new s(this,t)})}});
$('#right_menu').stickybits({stickyBitStickyOffset: 25});