« Popup.js » : différence entre les versions
Aucun résumé des modifications |
Aucun résumé des modifications |
||
Ligne 1 : | Ligne 1 : | ||
westui={lang:{input_level:"Votre niveau",input_search:"Recherche",damages:"Dégâts",per_level:"par Niveau",speed:"Vitesse",level:"Niveau",unsalable:"Non vendable",auction:"Peut être acheté/vendu aux enchères",not_auction:"Ne peut pas être acheté/vendu aux enchères",not_upgrade:"Non améliorable",upgrade:"Améliorable",total:"Total",popup:{dmg:{dglvl:'<p class="popup_dmg">+ #1 Dégâts#2</p>'},skills:{fo:'<p class="popup_attribute">+ #1 Force#2</p>',mo:'<p class="popup_attribute">+ #1 Mobilité#2</p>',ha:'<p class="popup_attribute">+ #1 Habileté#2</p>',ch:'<p class="popup_attribute">+ #1 Charisme#2</p>',co:'<p class="popup_skill">+ #1 Construction#2</p>',pu:'<p class="popup_skill">+ #1 Puissance#2</p>',te:'<p class="popup_skill">+ #1 Ténacité#2</p>',pe:'<p class="popup_skill">+ #1 Persévérance#2</p>',pv:'<p class="popup_skill">+ #1 Points de vie#2</p>',mc:'<p class="popup_skill">+ #1 Monter à cheval#2</p>',rx:'<p class="popup_skill">+ #1 Réflexe#2</p>',ev:'<p class="popup_skill">+ #1 Eviter#2</p>',ca:'<p class="popup_skill">+ #1 Se cacher#2</p>',na:'<p class="popup_skill">+ #1 Nager#2</p>',vi:'<p class="popup_skill">+ #1 Viser#2</p>',ti:'<p class="popup_skill">+ #1 Tirer#2</p>',pi:'<p class="popup_skill">+ #1 Piéger#2</p>',de:'<p class="popup_skill">+ #1 Dextérité#2</p>',re:'<p class="popup_skill">+ #1 Réparer#2</p>',di:'<p class="popup_skill">+ #1 Diriger#2</p>',ta:'<p class="popup_skill">+ #1 Tactique#2</p>',ma:'<p class="popup_skill">+ #1 Marchander#2</p>',an:'<p class="popup_skill">+ #1 Manier les animaux#2</p>',pr:'<p class="popup_skill">+ #1 Prestance#2</p>'},fb:{fbdef:'<p class="popup_fb">+ #1 <b>Défense</b> (Bonus de BdF)</p>',fboff:'<p class="popup_fb">+ #1 <b>Attaque</b> (Bonus de BdF)</p>',fbres:'<p class="popup_fb">+ #1 <b>Résistance</b> (Bonus de BdF)</p>',fbdefs:'<p class="popup_fb">+ #1 <b>Défense</b> (Bonus de secteur de BdF)</p>',fboffs:'<p class="popup_fb">+ #1 <b>Attaque</b> (Bonus de secteur de BdF)</p>',fbdmgs:'<p class="popup_fb">+ #1 <b>Dégâts</b> (Bonus de secteur de BdF)</p>'},special:{xp:'<p class="popup_txtgreen">+ #1% d\'expérience pour les travaux, duels et batailles de fort#2</p>',money:'<p class="popup_txtgreen">+ #1% d\'argent en travaux et duels#2</p>',luck:'<p class="popup_txtgreen">+ #1% de probabilité de chance en plus#2</p>',regen:'<p class="popup_txtgreen">+ #1% Régénération#2</p>',drop:'<p class="popup_txtgreen">+ #1% de chance de drop#2</p>',labor_pts:'<p class="popup_txtgreen">+ #1 points de travail#2</p>'}}},config:{enable_set_calc:!1,plain_popup:!1,redirect_on_dblclick:!1,cdn:"https://westfr.innogamescdn.com",img_buyprice:"/images/2/22/Achat.png",img_sellprice:"/images/3/3b/Vente.png",img_male:"/images/8/83/Homme.png",img_female:"/images/8/8c/Femme.png",set_bonus:{str:{name:"Strength",img:"/images/thumb/8/8b/Strength.png/40px-Strength.png"},mob:{name:"Mobility",img:"/images/thumb/5/5a/Mobility.png/40px-Mobility.png"},dex:{name:"Dexterity",img:"/images/thumb/0/0d/Dexterity.png/40px-Dexterity.png"},cha:{name:"Charisma",img:"/images/thumb/c/c9/Charisma.png/40px-Charisma.png"},con:{name:"Construction",img:"/images/thumb/3/37/Construction.png/40px-Construction.png"},vig:{name:"Vigor",img:"/images/thumb/9/90/Skill_Punch.png/40px-Skill_Punch.png"},tou:{name:"Toughness",img:"/images/thumb/f/f8/Skill_Tough.png/40px-Skill_Tough.png"},sta:{name:"Stamina",img:"/images/thumb/8/8d/Stamina.png/40px-Stamina.png"},hea:{name:"Health Points",img:"/images/thumb/9/94/Health.png/40px-Health.png"},rid:{name:"Horseback Riding",img:"/images/thumb/7/78/Hbr.png/40px-Hbr.png"},ref:{name:"Reflex",img:"/images/thumb/e/e9/Skill_Reflex.png/40px-Skill_Reflex.png"},dod:{name:"Dodging",img:"/images/thumb/0/07/Skill_Dodge.png/40px-Skill_Dodge.png"},hid:{name:"Hiding",img:"/images/thumb/9/97/Hiding.png/40px-Hiding.png"},swi:{name:"Swimming",img:"/images/thumb/f/f4/Swimming.png/40px-Swimming.png"},aim:{name:"Aiming",img:"/images/thumb/5/53/Skill_Aim.png/40px-Skill_Aim.png"},sho:{name:"Shooting",img:"/images/thumb/7/73/Skill_Shot.png/40px-Skill_Shot.png"},pit:{name:"Setting traps",img:"/images/thumb/e/e1/Trapping.png/40px-Trapping.png"},fin:{name:"Fine Motor Skills",img:"/images/thumb/1/18/Fms.png/40px-Fms.png"},rep:{name:"Repairing",img:"/images/thumb/d/d5/Repairing.png/40px-Repairing.png"},lea:{name:"Leadership",img:"/images/thumb/4/44/Leadership.png/40px-Leadership.png"},tac:{name:"Tactics",img:"/images/thumb/9/91/Skill_Tactic.png/40px-Skill_Tactic.png"},tra:{name:"Trading",img:"/images/thumb/f/f3/Skill_Trading.png/40px-Skill_Trading.png"},ani:{name:"Animal Instinct",img:"/images/thumb/9/9d/AnimalInstinct.png/40px-AnimalInstinct.png"},app:{name:"Appearance",img:"/images/thumb/4/4c/Skill_Appearance.png/40px-Skill_Appearance.png"},fbdef:{name:"<b>Defense</b> (Fort battle bonus)",img:"/images/8/82/Set_Fb_defense.png"},fboff:{name:"<b>Attack</b> (Fort battle bonus)",img:"/images/3/30/Set_Fb_offense.png"},fbres:{name:"<b>Resistance</b> (Fort battle bonus)",img:"/images/4/4b/Resistance.png"},fbdefs:{name:"<b>Defense</b> (Fort battle sector bonus)",img:"/images/1/1a/Set_Fb_defense_sec.png"},fboffs:{name:"<b>Attack</b> (Fort battle sector bonus)",img:"/images/f/fe/Set_Fb_offense_sec.png"},fbdmgs:{name:"<b>Damages</b> (Fort battle sector bonus)",img:"/images/b/b3/Damages_sector.png"},xp:{name:"Experience from jobs, duels, and fort battles (%)",img:"/images/7/71/Set_xp.png"},money:{name:"Money from jobs and duels (%)",img:"/images/d/df/Set_money.png"},luck:{name:"Increased Luck",img:"/images/c/c1/Set_luck.png"},regen:{name:"Regeneration",img:"/images/5/53/Regeneration.png"},drop:{name:"Improved drop chance",img:"/images/thumb/b/b8/Drop.png/40px-Drop.png"},labor_pts:{name:"Labor points (all jobs)",img:"/images/5/5e/Labor_pts.png"}}},initPage:function(){if(1===$("#input_level").length)var t=$('<input type="number" style="width:80px;" class="west" placeholder="'+westui.lang.input_level+'" min="0" max="150">').bind("propertychange keyup input paste",function(){150<this.value?this.value=150:this.value<0&&(this.value=0),$(".calc").each(function(){0==t.val()?($(this).html(this.id),$(".per_level_off").addClass("per_level").removeClass("per_level_off")):($(this).html(Math.ceil(Number(this.id)*t.val())),$(".per_level").addClass("per_level_off").removeClass("per_level"))})}).appendTo($("#input_level"));if(1===$("#input_search").length)$('<input type="search" class="west" placeholder="'+westui.lang.input_search+'">').bind("propertychange keyup input paste",function(){var t=this.value.toLowerCase();""===t?$(".item_container").show():($(".item_container").hide(),$(".item_container").filter(function(){return-1<$(this).attr("data-popup").toLowerCase().indexOf(t)}).show())}).appendTo($("#input_search"));1===$("#switch").length&&($("#fire").hide(),$("#switch").on("click",function(){$("#melee, #fire").toggle()})),1===$("#switch_prod").length&&($("#prod2").hide(),$("#switch_prod").on("click",function(){$("#prod, #prod2").toggle()})),westui.config.plain_popup&&new RegExp(mw.config.get("wgFormattedNamespaces")[10]+":Item_*").test(mw.config.get("wgPageName"))&&1===$(".item_container").length&&($("#mw-content-text").append('<center><div id="popup_plain" class="popup_window"><div class="popup_front"><div class="tw_bg_popup_tl"></div><div class="tw_bg_popup_tr"></div><div class="tw_bg_popup_bl"></div><div class="tw_bg_popup_br"></div></div><div id="popup_plain_contents" class="popup_contents"></div></div></center>'),$("#popup_plain").hide(),$("#popup_plain_contents").append(westui.popup.createPopup($(".item_container").attr("data-popup"),$(".item_container").attr("data-cdn-cat"),$(".item_container").attr("data-cdn-img"),0)),$("#popup_plain").slideDown()),westui.config.redirect_on_dblclick&&$(".item_container img").on("dblclick",function(){window.location="/wiki/"+mw.config.get("wgFormattedNamespaces")[10]+":Item_"+JSON.parse($(this).parent().attr("data-popup")).id/1e3})},popup:{content:"",delay:200,active:!1,show:function(t){westui.popup.content=westui.popup.createPopup($(t).attr("data-popup"),$(t).attr("data-cdn-cat"),$(t).attr("data-cdn-img"),parseInt($(t).attr("data-lvl"))),westui.popup.active=!0,westui.popup.setTimeout(),westui.popup.getContainer().html(westui.popup.content)},hide:function(){westui.popup.getEl().css({display:"none",top:0,left:0}),westui.popup.active=!1,westui.popup.clearTimeout()},setTimeout:function(){westui.popup.clearTimeout(),westui.popup.timer=window.setTimeout(function(){westui.popup.getEl().css("display","block")},westui.popup.delay)},clearTimeout:function(){westui.popup.timer&&window.clearTimeout(westui.popup.timer)},getEl:function(){return $("#popup_window")},getContainer:function(){return $("#popup_contents")},createPopup:function(t,e,i,a){t=JSON.parse(t);var s='<div class="popup_image"><img src="'+westui.config.cdn+"/images/items/"+t.cdn_cat+"/"+t.cdn_img+'.png"/></div><div class="popup_divider"></div><p class="popup_name">'+t.name+'</p><p class="popup_type">'+t.type+"</p><br/>",p=!1;if(1<=a&&a<=5&&(p=!0,t.auc=!1),t. | westui={lang:{input_level:"Votre niveau",input_search:"Recherche",damages:"Dégâts",per_level:"par Niveau",speed:"Vitesse",level:"Niveau",unsalable:"Non vendable",auction:"Peut être acheté/vendu aux enchères",not_auction:"Ne peut pas être acheté/vendu aux enchères",not_upgrade:"Non améliorable",upgrade:"Améliorable",total:"Total",popup:{dmg:{dglvl:'<p class="popup_dmg">+ #1 Dégâts#2</p>'},skills:{fo:'<p class="popup_attribute">+ #1 Force#2</p>',mo:'<p class="popup_attribute">+ #1 Mobilité#2</p>',ha:'<p class="popup_attribute">+ #1 Habileté#2</p>',ch:'<p class="popup_attribute">+ #1 Charisme#2</p>',co:'<p class="popup_skill">+ #1 Construction#2</p>',pu:'<p class="popup_skill">+ #1 Puissance#2</p>',te:'<p class="popup_skill">+ #1 Ténacité#2</p>',pe:'<p class="popup_skill">+ #1 Persévérance#2</p>',pv:'<p class="popup_skill">+ #1 Points de vie#2</p>',mc:'<p class="popup_skill">+ #1 Monter à cheval#2</p>',rx:'<p class="popup_skill">+ #1 Réflexe#2</p>',ev:'<p class="popup_skill">+ #1 Eviter#2</p>',ca:'<p class="popup_skill">+ #1 Se cacher#2</p>',na:'<p class="popup_skill">+ #1 Nager#2</p>',vi:'<p class="popup_skill">+ #1 Viser#2</p>',ti:'<p class="popup_skill">+ #1 Tirer#2</p>',pi:'<p class="popup_skill">+ #1 Piéger#2</p>',de:'<p class="popup_skill">+ #1 Dextérité#2</p>',re:'<p class="popup_skill">+ #1 Réparer#2</p>',di:'<p class="popup_skill">+ #1 Diriger#2</p>',ta:'<p class="popup_skill">+ #1 Tactique#2</p>',ma:'<p class="popup_skill">+ #1 Marchander#2</p>',an:'<p class="popup_skill">+ #1 Manier les animaux#2</p>',pr:'<p class="popup_skill">+ #1 Prestance#2</p>'},fb:{fbdef:'<p class="popup_fb">+ #1 <b>Défense</b> (Bonus de BdF)</p>',fboff:'<p class="popup_fb">+ #1 <b>Attaque</b> (Bonus de BdF)</p>',fbres:'<p class="popup_fb">+ #1 <b>Résistance</b> (Bonus de BdF)</p>',fbdefs:'<p class="popup_fb">+ #1 <b>Défense</b> (Bonus de secteur de BdF)</p>',fboffs:'<p class="popup_fb">+ #1 <b>Attaque</b> (Bonus de secteur de BdF)</p>',fbdmgs:'<p class="popup_fb">+ #1 <b>Dégâts</b> (Bonus de secteur de BdF)</p>'},special:{xp:'<p class="popup_txtgreen">+ #1% d\'expérience pour les travaux, duels et batailles de fort#2</p>',money:'<p class="popup_txtgreen">+ #1% d\'argent en travaux et duels#2</p>',luck:'<p class="popup_txtgreen">+ #1% de probabilité de chance en plus#2</p>',regen:'<p class="popup_txtgreen">+ #1% Régénération#2</p>',drop:'<p class="popup_txtgreen">+ #1% de chance de drop#2</p>',labor_pts:'<p class="popup_txtgreen">+ #1 points de travail#2</p>'}}},config:{enable_set_calc:!1,plain_popup:!1,redirect_on_dblclick:!1,cdn:"https://westfr.innogamescdn.com",img_buyprice:"/images/2/22/Achat.png",img_sellprice:"/images/3/3b/Vente.png",img_male:"/images/8/83/Homme.png",img_female:"/images/8/8c/Femme.png",set_bonus:{str:{name:"Strength",img:"/images/thumb/8/8b/Strength.png/40px-Strength.png"},mob:{name:"Mobility",img:"/images/thumb/5/5a/Mobility.png/40px-Mobility.png"},dex:{name:"Dexterity",img:"/images/thumb/0/0d/Dexterity.png/40px-Dexterity.png"},cha:{name:"Charisma",img:"/images/thumb/c/c9/Charisma.png/40px-Charisma.png"},con:{name:"Construction",img:"/images/thumb/3/37/Construction.png/40px-Construction.png"},vig:{name:"Vigor",img:"/images/thumb/9/90/Skill_Punch.png/40px-Skill_Punch.png"},tou:{name:"Toughness",img:"/images/thumb/f/f8/Skill_Tough.png/40px-Skill_Tough.png"},sta:{name:"Stamina",img:"/images/thumb/8/8d/Stamina.png/40px-Stamina.png"},hea:{name:"Health Points",img:"/images/thumb/9/94/Health.png/40px-Health.png"},rid:{name:"Horseback Riding",img:"/images/thumb/7/78/Hbr.png/40px-Hbr.png"},ref:{name:"Reflex",img:"/images/thumb/e/e9/Skill_Reflex.png/40px-Skill_Reflex.png"},dod:{name:"Dodging",img:"/images/thumb/0/07/Skill_Dodge.png/40px-Skill_Dodge.png"},hid:{name:"Hiding",img:"/images/thumb/9/97/Hiding.png/40px-Hiding.png"},swi:{name:"Swimming",img:"/images/thumb/f/f4/Swimming.png/40px-Swimming.png"},aim:{name:"Aiming",img:"/images/thumb/5/53/Skill_Aim.png/40px-Skill_Aim.png"},sho:{name:"Shooting",img:"/images/thumb/7/73/Skill_Shot.png/40px-Skill_Shot.png"},pit:{name:"Setting traps",img:"/images/thumb/e/e1/Trapping.png/40px-Trapping.png"},fin:{name:"Fine Motor Skills",img:"/images/thumb/1/18/Fms.png/40px-Fms.png"},rep:{name:"Repairing",img:"/images/thumb/d/d5/Repairing.png/40px-Repairing.png"},lea:{name:"Leadership",img:"/images/thumb/4/44/Leadership.png/40px-Leadership.png"},tac:{name:"Tactics",img:"/images/thumb/9/91/Skill_Tactic.png/40px-Skill_Tactic.png"},tra:{name:"Trading",img:"/images/thumb/f/f3/Skill_Trading.png/40px-Skill_Trading.png"},ani:{name:"Animal Instinct",img:"/images/thumb/9/9d/AnimalInstinct.png/40px-AnimalInstinct.png"},app:{name:"Appearance",img:"/images/thumb/4/4c/Skill_Appearance.png/40px-Skill_Appearance.png"},fbdef:{name:"<b>Defense</b> (Fort battle bonus)",img:"/images/8/82/Set_Fb_defense.png"},fboff:{name:"<b>Attack</b> (Fort battle bonus)",img:"/images/3/30/Set_Fb_offense.png"},fbres:{name:"<b>Resistance</b> (Fort battle bonus)",img:"/images/4/4b/Resistance.png"},fbdefs:{name:"<b>Defense</b> (Fort battle sector bonus)",img:"/images/1/1a/Set_Fb_defense_sec.png"},fboffs:{name:"<b>Attack</b> (Fort battle sector bonus)",img:"/images/f/fe/Set_Fb_offense_sec.png"},fbdmgs:{name:"<b>Damages</b> (Fort battle sector bonus)",img:"/images/b/b3/Damages_sector.png"},xp:{name:"Experience from jobs, duels, and fort battles (%)",img:"/images/7/71/Set_xp.png"},money:{name:"Money from jobs and duels (%)",img:"/images/d/df/Set_money.png"},luck:{name:"Increased Luck",img:"/images/c/c1/Set_luck.png"},regen:{name:"Regeneration",img:"/images/5/53/Regeneration.png"},drop:{name:"Improved drop chance",img:"/images/thumb/b/b8/Drop.png/40px-Drop.png"},labor_pts:{name:"Labor points (all jobs)",img:"/images/5/5e/Labor_pts.png"}}},initPage:function(){if(1===$("#input_level").length)var t=$('<input type="number" style="width:80px;" class="west" placeholder="'+westui.lang.input_level+'" min="0" max="150">').bind("propertychange keyup input paste",function(){150<this.value?this.value=150:this.value<0&&(this.value=0),$(".calc").each(function(){0==t.val()?($(this).html(this.id),$(".per_level_off").addClass("per_level").removeClass("per_level_off")):($(this).html(Math.ceil(Number(this.id)*t.val())),$(".per_level").addClass("per_level_off").removeClass("per_level"))})}).appendTo($("#input_level"));if(1===$("#input_search").length)$('<input type="search" class="west" placeholder="'+westui.lang.input_search+'">').bind("propertychange keyup input paste",function(){var t=this.value.toLowerCase();""===t?$(".item_container").show():($(".item_container").hide(),$(".item_container").filter(function(){return-1<$(this).attr("data-popup").toLowerCase().indexOf(t)}).show())}).appendTo($("#input_search"));1===$("#switch").length&&($("#fire").hide(),$("#switch").on("click",function(){$("#melee, #fire").toggle()})),1===$("#switch_prod").length&&($("#prod2").hide(),$("#switch_prod").on("click",function(){$("#prod, #prod2").toggle()})),westui.config.plain_popup&&new RegExp(mw.config.get("wgFormattedNamespaces")[10]+":Item_*").test(mw.config.get("wgPageName"))&&1===$(".item_container").length&&($("#mw-content-text").append('<center><div id="popup_plain" class="popup_window"><div class="popup_front"><div class="tw_bg_popup_tl"></div><div class="tw_bg_popup_tr"></div><div class="tw_bg_popup_bl"></div><div class="tw_bg_popup_br"></div></div><div id="popup_plain_contents" class="popup_contents"></div></div></center>'),$("#popup_plain").hide(),$("#popup_plain_contents").append(westui.popup.createPopup($(".item_container").attr("data-popup"),$(".item_container").attr("data-cdn-cat"),$(".item_container").attr("data-cdn-img"),0)),$("#popup_plain").slideDown()),westui.config.redirect_on_dblclick&&$(".item_container img").on("dblclick",function(){window.location="/wiki/"+mw.config.get("wgFormattedNamespaces")[10]+":Item_"+JSON.parse($(this).parent().attr("data-popup")).id/1e3})},popup:{content:"",delay:200,active:!1,show:function(t){westui.popup.content=westui.popup.createPopup($(t).attr("data-popup"),$(t).attr("data-cdn-cat"),$(t).attr("data-cdn-img"),parseInt($(t).attr("data-lvl"))),westui.popup.active=!0,westui.popup.setTimeout(),westui.popup.getContainer().html(westui.popup.content)},hide:function(){westui.popup.getEl().css({display:"none",top:0,left:0}),westui.popup.active=!1,westui.popup.clearTimeout()},setTimeout:function(){westui.popup.clearTimeout(),westui.popup.timer=window.setTimeout(function(){westui.popup.getEl().css("display","block")},westui.popup.delay)},clearTimeout:function(){westui.popup.timer&&window.clearTimeout(westui.popup.timer)},getEl:function(){return $("#popup_window")},getContainer:function(){return $("#popup_contents")},createPopup:function(t,e,i,a){t=JSON.parse(t);var s='<div class="popup_image"><img src="'+westui.config.cdn+"/images/items/"+t.cdn_cat+"/"+t.cdn_img+'.png"/></div><div class="popup_divider"></div><p class="popup_name">'+t.name+'</p><p class="popup_type">'+t.type+"</p><br/>",p=!1;if(1<=a&&a<=5&&(p=!0,t.auc=!1),t.dgmin&&t.dgmax&&(p&&(t.dgmin+=Math.round(Math.max(1,.1*t.dgmin*a)),t.dgmax+=Math.round(Math.max(1,.1*t.dgmax*a))),s+='<p class="popup_dmg">'+t.dgmin+"-"+t.dgmax+" "+westui.lang.damages+"</p>"),t.text){for(var n=0;n<t.text.length;n++)s+='<p class="popup_text">'+t.text[n]+"</p>";s+="<br/>"}for(var o in westui.lang.popup){var l=0;for(var c in westui.lang.popup[o])if(t.hasOwnProperty(c)){l++;var u="";t[c]<0?0<$("#input_level input").val()?(t[c]=Math.ceil($("#input_level input").val()*-t[c]),p&&(t[c]+=Math.round(Math.max(1,.1*t[c]*a)))):(t[c]=-t[c],u=" ("+westui.lang.per_level+")",p&&(t[c]=Math.round(1e6*(1*t[c]+Math.round(Math.max(1,1e3*t[c]*a))/1e4))/1e6)):p&&(t[c]<1?t[c]=Math.round(1e6*(1*t[c]+Math.round(Math.max(1,1e3*t[c]*a))/1e4))/1e6:t[c]+=Math.round(Math.max(1,.1*t[c]*a))),s+=westui.lang.popup[o][c].replace("#1",t[c]).replace("#2",u)}0<l&&(s+="<br/>")}if(t.textjob){for(n=0;n<t.textjob.length;n++)s+='<p class="popup_txtgreen">'+t.textjob[n]+"</p>";s+="<br/>"}if(t.bonus){for(n=0;n<t.bonus.length;n++)s+='<p class="popup_bonus">'+t.bonus[n]+"</p>";s+="<br/>"}if(t.jobs){s+='<div style="text-align:center;"><table class="popup_job">';for(n=0;n<t.jobs.length;n++)s+='<tr><td><img src="'+westui.config.cdn+"/images/jobs/"+t.jobs[n][1]+'.png"/></td><td><span> '+t.jobs[n][0]+"</span></td></tr>";s+="</table></div>"}if(t.craft){s+='<div style="text-align:center;"><table class="popup_crafteditem"><tr><td><img src="'+westui.config.cdn+"/images/crafting/profsymbol_"+t.craft.id+'_small.png"/></td><td><table><tr>';for(n=0;n<t.craft.req.length;n++)s+='<td><img style="width:36px;height:36px;" src="'+westui.config.cdn+"/images/items/yield/"+t.craft.req[n][0]+'.png"/></td>';s+="</tr><tr>";for(n=0;n<t.craft.req.length;n++)s+="<td><span>x"+t.craft.req[n][1]+"</span></td>";s+="</tr></table></td></tr></table></div>"}return s+='<div class="popup_infos">',t.spd&&(p&&(t.spd+=Math.round(Math.max(1,.1*t.spd*a))),s+='<p class="popup_speed">'+westui.lang.speed+": +"+t.spd+"%</p><br/>"),t.set&&(s+='<p><a class="popup_set" href="/wiki/'+t.set+'">'+t.set+"</a></p><br/>"),t.sp?s+='<img src="'+westui.config.img_buyprice+'"/>'+t.bp+' <img src="'+westui.config.img_sellprice+'"/> '+t.sp+"<br/><br/>":s+="<i>"+westui.lang.unsalable+"</i><br/><br/>",t.lvl&&(s+=westui.lang.level+" <b>"+t.lvl+"</b><br/>"),t.sex&&(0==t.sex?s+='<img src="'+westui.config.img_male+'"/> ':s+='<img src="'+westui.config.img_female+'"/> '),1==t.auc?s+='<span class="popup_txtgreen">'+westui.lang.auction+"</span><br/>":s+='<span class="popup_txtred">'+westui.lang.not_auction+"</span><br/>",0==t.upg?s+='<span class="popup_txtred">'+westui.lang.not_upgrade+"</span><br/>":s+='<span class="popup_txtgreen">'+westui.lang.upgrade+"</span><br/>",s+='<br/><p class="popup_id">[item=<b>'+t.id+"</b>]</p></div>"},setPosition:function(t){var e,i,a=$(window).width(),s=$(window).height(),p=westui.popup.getEl().outerWidth(),n=westui.popup.getEl().outerHeight(),o=t.clientX,l=t.clientY;i=a<o+p+20?o-p-20+(t.pageX-t.clientX):o+20+(t.pageX-t.clientX),e=s<l+n+20?s-n+(t.pageY-t.clientY):l+20+(t.pageY-t.clientY),westui.popup.getEl().css({top:e,left:i})},init:function(){$("body").append('<div id="popup_window" class="popup_window"><div class="popup_front"><div class="tw_bg_popup_tl"></div><div class="tw_bg_popup_tr"></div><div class="tw_bg_popup_bl"></div><div class="tw_bg_popup_br"></div></div><div id="popup_contents" class="popup_contents"></div></div>'),$(document).on("mouseenter",".item_container",function(t){westui.popup.show(this),westui.popup.setPosition(t)}),$(document).on("mouseleave",".item_container",function(){westui.popup.hide()}),$(document).on("mousemove",".item_container",function(t){westui.popup.setPosition(t)}),$(".item_level").mousedown(function(t){t.preventDefault()}),$(document).on("click",".upgrade",function(){var t=$(this).closest(".item_container"),e=parseInt(t.attr("data-lvl"));5!==e&&(t.attr("data-lvl",e+1),t.find(".level").html(e+1)),westui.popup.show(t[0])}),$(document).on("click",".downgrade",function(){var t=$(this).closest(".item_container"),e=parseInt(t.attr("data-lvl"));0!==e&&(t.attr("data-lvl",e-1),t.find(".level").html(e-1)),westui.popup.show(t[0])})}},set_calc:{bonus:{extra_set_bonus:{}},data:{},itemStatus:{},getData:function(){$(".set_container").each(function(){var i=$(this).attr("data-set-id");westui.set_calc.itemStatus[i]={},westui.set_calc.data[i]={items:{},set:{}},$(this).find(".item_container").each(function(){var t=JSON.parse($(this).attr("data-popup"));for(var e in $(this).is(":hidden")?westui.set_calc.itemStatus[i][t.id]=!1:westui.set_calc.itemStatus[i][t.id]=0,t)t.hasOwnProperty(e)&&westui.config.set_bonus.hasOwnProperty(e)&&(westui.set_calc.data[i].items[e]||(westui.set_calc.data[i].items[e]={}),westui.set_calc.data[i].items[e][t.id]=t[e])})}),$(".infoSet").each(function(){var e=$(this).attr("data-set-id");$(this).find(".infosetatt").each(function(){var t=$(this).attr("data-nb");westui.set_calc.data[e].set[t]={},$(this).find(".set_bonus").each(function(){key=$(this).attr("data-type"),0!==$(this).find(".calc").length?westui.set_calc.data[e].set[t][key]=-parseFloat($(this).find(".calc").attr("id")):westui.set_calc.data[e].set[t][key]=parseFloat($(this).find(".val").text()),westui.config.set_bonus.hasOwnProperty(key)||(westui.set_calc.bonus.extra_set_bonus[key]={img:$(this).find("img").attr("src"),name:$(this).find("#tooltip_content").text()})})})})},calc:function(){if(0===$("#input_level").length|""!==$("#input_level input").val()){var t=parseInt($("#input_level input").val());for(var e in total={},westui.set_calc.data){for(var i in westui.set_calc.data[e].items)for(var a in westui.set_calc.data[e].items[i])if(!1!==westui.set_calc.itemStatus[e][a]){lvl=westui.set_calc.itemStatus[e][a],total[i]||(total[i]=0);var s=westui.set_calc.data[e].items[i][a];westui.set_calc.data[e].items[i][a]<0?(s=-s,0<westui.set_calc.itemStatus[e][a]?total[i]+=Math.ceil(s*t)+Math.round(Math.max(1,.1*Math.ceil(s*t)*lvl)):total[i]+=Math.ceil(s*t)):0<westui.set_calc.itemStatus[e][a]?total[i]+=s<1?Math.round(1e6*(1*s+Math.round(Math.max(1,1e3*s*lvl))/1e4))/1e6:Math.round(Math.max(1,.1*s*lvl)):total[i]+=s}var p=0;for(var a in westui.set_calc.itemStatus[e])!1!==westui.set_calc.itemStatus[e][a]&&p++;for(var i in westui.set_calc.data[e].set[p])total[i]||(total[i]=0),westui.set_calc.data[e].set[p][i]<0?total[i]+=Math.ceil(-westui.set_calc.data[e].set[p][i]*t):total[i]+=westui.set_calc.data[e].set[p][i]}var n='<center><table class="infoSet"><caption><br><big><b>'+westui.lang.total+"</b></big></caption><tbody><tr><td></center>";for(var i in westui.config.set_bonus)total.hasOwnProperty(i)&&(n+='<div class="set_bonus tooltip_container"><img src="'+westui.config.set_bonus[i].img+'"><b>+'+total[i]+'</b><div class="tooltip_outer"><div class="tooltip"><div class="tt_bg_tl"></div><div class="tt_bg_tr"></div><div class="tt_bg_bl"></div><div class="tt_bg_br"></div><div id="tooltip_content">'+westui.config.set_bonus[i].name+"</div></div></div></div>");for(var i in westui.set_calc.bonus.extra_set_bonus)total.hasOwnProperty(i)&&(n+='<div class="set_bonus tooltip_container"><img src="'+westui.set_calc.bonus.extra_set_bonus[i].img+'"><b>+'+total[i]+(-1!==["xp","money","luck","spd","regen","drop"].indexOf(i)?"%":"")+'</b><div class="tooltip_outer"><div class="tooltip"><div class="tt_bg_tl"></div><div class="tt_bg_tr"></div><div class="tt_bg_bl"></div><div class="tt_bg_br"></div><div id="tooltip_content">'+westui.set_calc.bonus.extra_set_bonus[i].name+"</div></div></div></div>");$("#set_calc").html(n)}else $("#set_calc").html("")},initEvents:function(){$(".item_container > img").on("click",function(){var t=$(this).closest(".item_container");t.toggleClass("item_off");var e=t.closest(".set_container").attr("data-set-id"),i=JSON.parse(t.attr("data-popup")).id;t.hasClass("item_off")||t.is(":hidden")?westui.set_calc.itemStatus[e][i]=!1:westui.set_calc.itemStatus[e][i]=parseInt(t.attr("data-lvl")),westui.set_calc.calc()}),$(document).on("click",".upgrade, .downgrade",function(){var t=$(this).closest(".item_container"),e=t.closest(".set_container").attr("data-set-id");t.hasClass("item_off")||t.is(":hidden")||(westui.set_calc.itemStatus[e][JSON.parse(t.attr("data-popup")).id]=parseInt(t.attr("data-lvl")),westui.set_calc.calc())}),$("#input_level").bind("propertychange keyup input paste",function(){westui.set_calc.calc()}),$("#switch").on("click",function(){$("#melee, #fire").each(function(){var t=$(this).find(".item_container"),e=$(this).closest(".set_container").attr("data-set-id");$(this).is(":hidden")?westui.set_calc.itemStatus[e][JSON.parse(t.attr("data-popup")).id]=!1:westui.set_calc.itemStatus[e][JSON.parse(t.attr("data-popup")).id]=parseInt(t.attr("data-lvl"))}),westui.set_calc.calc()})},init:function(){westui.set_calc.initEvents(),westui.set_calc.getData(),$("#mw-content-text").append('<div id="set_calc"></div>'),0===$("#input_level").length&&westui.set_calc.calc()}},init:function(){westui.initPage(),westui.popup.init(),westui.config.enable_set_calc&&0!==$(".infoSet").length&&westui.set_calc.init()}},westui.init(); |
Version du 7 juillet 2018 à 17:29
westui={lang:{input_level:"Votre niveau",input_search:"Recherche",damages:"Dégâts",per_level:"par Niveau",speed:"Vitesse",level:"Niveau",unsalable:"Non vendable",auction:"Peut être acheté/vendu aux enchères",not_auction:"Ne peut pas être acheté/vendu aux enchères",not_upgrade:"Non améliorable",upgrade:"Améliorable",total:"Total",popup:{dmg:{dglvl:'
+ #1 Dégâts#2
'},skills:{fo:'
+ #1 Force#2
',mo:'
+ #1 Mobilité#2
',ha:'
+ #1 Habileté#2
',ch:'
+ #1 Charisme#2
',co:'
+ #1 Construction#2
',pu:'
+ #1 Puissance#2
',te:'
+ #1 Ténacité#2
',pe:'
+ #1 Persévérance#2
',pv:'
+ #1 Points de vie#2
',mc:'
+ #1 Monter à cheval#2
',rx:'
+ #1 Réflexe#2
',ev:'
+ #1 Eviter#2
',ca:'
+ #1 Se cacher#2
',na:'
+ #1 Nager#2
',vi:'
+ #1 Viser#2
',ti:'
+ #1 Tirer#2
',pi:'
+ #1 Piéger#2
',de:'
+ #1 Dextérité#2
',re:'
+ #1 Réparer#2
',di:'
+ #1 Diriger#2
',ta:'
+ #1 Tactique#2
',ma:'
+ #1 Marchander#2
',an:'
+ #1 Manier les animaux#2
',pr:'
+ #1 Prestance#2
'},fb:{fbdef:'
+ #1 Défense (Bonus de BdF)
',fboff:'
+ #1 Attaque (Bonus de BdF)
',fbres:'
+ #1 Résistance (Bonus de BdF)
',fbdefs:'
+ #1 Défense (Bonus de secteur de BdF)
',fboffs:'
+ #1 Attaque (Bonus de secteur de BdF)
',fbdmgs:'
+ #1 Dégâts (Bonus de secteur de BdF)
'},special:{xp:'
+ #1% d\'expérience pour les travaux, duels et batailles de fort#2
',money:'
+ #1% d\'argent en travaux et duels#2
',luck:'
+ #1% de probabilité de chance en plus#2
',regen:'
+ #1% Régénération#2
',drop:'
+ #1% de chance de drop#2
',labor_pts:'
+ #1 points de travail#2
'}}},config:{enable_set_calc:!1,plain_popup:!1,redirect_on_dblclick:!1,cdn:"https://westfr.innogamescdn.com",img_buyprice:"/images/2/22/Achat.png",img_sellprice:"/images/3/3b/Vente.png",img_male:"/images/8/83/Homme.png",img_female:"/images/8/8c/Femme.png",set_bonus:{str:{name:"Strength",img:"/images/thumb/8/8b/Strength.png/40px-Strength.png"},mob:{name:"Mobility",img:"/images/thumb/5/5a/Mobility.png/40px-Mobility.png"},dex:{name:"Dexterity",img:"/images/thumb/0/0d/Dexterity.png/40px-Dexterity.png"},cha:{name:"Charisma",img:"/images/thumb/c/c9/Charisma.png/40px-Charisma.png"},con:{name:"Construction",img:"/images/thumb/3/37/Construction.png/40px-Construction.png"},vig:{name:"Vigor",img:"/images/thumb/9/90/Skill_Punch.png/40px-Skill_Punch.png"},tou:{name:"Toughness",img:"/images/thumb/f/f8/Skill_Tough.png/40px-Skill_Tough.png"},sta:{name:"Stamina",img:"/images/thumb/8/8d/Stamina.png/40px-Stamina.png"},hea:{name:"Health Points",img:"/images/thumb/9/94/Health.png/40px-Health.png"},rid:{name:"Horseback Riding",img:"/images/thumb/7/78/Hbr.png/40px-Hbr.png"},ref:{name:"Reflex",img:"/images/thumb/e/e9/Skill_Reflex.png/40px-Skill_Reflex.png"},dod:{name:"Dodging",img:"/images/thumb/0/07/Skill_Dodge.png/40px-Skill_Dodge.png"},hid:{name:"Hiding",img:"/images/thumb/9/97/Hiding.png/40px-Hiding.png"},swi:{name:"Swimming",img:"/images/thumb/f/f4/Swimming.png/40px-Swimming.png"},aim:{name:"Aiming",img:"/images/thumb/5/53/Skill_Aim.png/40px-Skill_Aim.png"},sho:{name:"Shooting",img:"/images/thumb/7/73/Skill_Shot.png/40px-Skill_Shot.png"},pit:{name:"Setting traps",img:"/images/thumb/e/e1/Trapping.png/40px-Trapping.png"},fin:{name:"Fine Motor Skills",img:"/images/thumb/1/18/Fms.png/40px-Fms.png"},rep:{name:"Repairing",img:"/images/thumb/d/d5/Repairing.png/40px-Repairing.png"},lea:{name:"Leadership",img:"/images/thumb/4/44/Leadership.png/40px-Leadership.png"},tac:{name:"Tactics",img:"/images/thumb/9/91/Skill_Tactic.png/40px-Skill_Tactic.png"},tra:{name:"Trading",img:"/images/thumb/f/f3/Skill_Trading.png/40px-Skill_Trading.png"},ani:{name:"Animal Instinct",img:"/images/thumb/9/9d/AnimalInstinct.png/40px-AnimalInstinct.png"},app:{name:"Appearance",img:"/images/thumb/4/4c/Skill_Appearance.png/40px-Skill_Appearance.png"},fbdef:{name:"Defense (Fort battle bonus)",img:"/images/8/82/Set_Fb_defense.png"},fboff:{name:"Attack (Fort battle bonus)",img:"/images/3/30/Set_Fb_offense.png"},fbres:{name:"Resistance (Fort battle bonus)",img:"/images/4/4b/Resistance.png"},fbdefs:{name:"Defense (Fort battle sector bonus)",img:"/images/1/1a/Set_Fb_defense_sec.png"},fboffs:{name:"Attack (Fort battle sector bonus)",img:"/images/f/fe/Set_Fb_offense_sec.png"},fbdmgs:{name:"Damages (Fort battle sector bonus)",img:"/images/b/b3/Damages_sector.png"},xp:{name:"Experience from jobs, duels, and fort battles (%)",img:"/images/7/71/Set_xp.png"},money:{name:"Money from jobs and duels (%)",img:"/images/d/df/Set_money.png"},luck:{name:"Increased Luck",img:"/images/c/c1/Set_luck.png"},regen:{name:"Regeneration",img:"/images/5/53/Regeneration.png"},drop:{name:"Improved drop chance",img:"/images/thumb/b/b8/Drop.png/40px-Drop.png"},labor_pts:{name:"Labor points (all jobs)",img:"/images/5/5e/Labor_pts.png"}}},initPage:function(){if(1===$("#input_level").length)var t=$('<input type="number" style="width:80px;" class="west" placeholder="'+westui.lang.input_level+'" min="0" max="150">').bind("propertychange keyup input paste",function(){150<this.value?this.value=150:this.value<0&&(this.value=0),$(".calc").each(function(){0==t.val()?($(this).html(this.id),$(".per_level_off").addClass("per_level").removeClass("per_level_off")):($(this).html(Math.ceil(Number(this.id)*t.val())),$(".per_level").addClass("per_level_off").removeClass("per_level"))})}).appendTo($("#input_level"));if(1===$("#input_search").length)$('<input type="search" class="west" placeholder="'+westui.lang.input_search+'">').bind("propertychange keyup input paste",function(){var t=this.value.toLowerCase();""===t?$(".item_container").show():($(".item_container").hide(),$(".item_container").filter(function(){return-1<$(this).attr("data-popup").toLowerCase().indexOf(t)}).show())}).appendTo($("#input_search"));1===$("#switch").length&&($("#fire").hide(),$("#switch").on("click",function(){$("#melee, #fire").toggle()})),1===$("#switch_prod").length&&($("#prod2").hide(),$("#switch_prod").on("click",function(){$("#prod, #prod2").toggle()})),westui.config.plain_popup&&new RegExp(mw.config.get("wgFormattedNamespaces")[10]+":Item_*").test(mw.config.get("wgPageName"))&&1===$(".item_container").length&&($("#mw-content-text").append('
'),$("#popup_plain").hide(),$("#popup_plain_contents").append(westui.popup.createPopup($(".item_container").attr("data-popup"),$(".item_container").attr("data-cdn-cat"),$(".item_container").attr("data-cdn-img"),0)),$("#popup_plain").slideDown()),westui.config.redirect_on_dblclick&&$(".item_container img").on("dblclick",function(){window.location="/wiki/"+mw.config.get("wgFormattedNamespaces")[10]+":Item_"+JSON.parse($(this).parent().attr("data-popup")).id/1e3})},popup:{content:"",delay:200,active:!1,show:function(t){westui.popup.content=westui.popup.createPopup($(t).attr("data-popup"),$(t).attr("data-cdn-cat"),$(t).attr("data-cdn-img"),parseInt($(t).attr("data-lvl"))),westui.popup.active=!0,westui.popup.setTimeout(),westui.popup.getContainer().html(westui.popup.content)},hide:function(){westui.popup.getEl().css({display:"none",top:0,left:0}),westui.popup.active=!1,westui.popup.clearTimeout()},setTimeout:function(){westui.popup.clearTimeout(),westui.popup.timer=window.setTimeout(function(){westui.popup.getEl().css("display","block")},westui.popup.delay)},clearTimeout:function(){westui.popup.timer&&window.clearTimeout(westui.popup.timer)},getEl:function(){return $("#popup_window")},getContainer:function(){return $("#popup_contents")},createPopup:function(t,e,i,a){t=JSON.parse(t);var s='
'+t.name+'
'+t.type+"
",p=!1;if(1<=a&&a<=5&&(p=!0,t.auc=!1),t.dgmin&&t.dgmax&&(p&&(t.dgmin+=Math.round(Math.max(1,.1*t.dgmin*a)),t.dgmax+=Math.round(Math.max(1,.1*t.dgmax*a))),s+='
'+t.dgmin+"-"+t.dgmax+" "+westui.lang.damages+"
"),t.text){for(var n=0;n<t.text.length;n++)s+='
'+t.text[n]+"
";s+="
"}for(var o in westui.lang.popup){var l=0;for(var c in westui.lang.popup[o])if(t.hasOwnProperty(c)){l++;var u="";t[c]<0?0<$("#input_level input").val()?(t[c]=Math.ceil($("#input_level input").val()*-t[c]),p&&(t[c]+=Math.round(Math.max(1,.1*t[c]*a)))):(t[c]=-t[c],u=" ("+westui.lang.per_level+")",p&&(t[c]=Math.round(1e6*(1*t[c]+Math.round(Math.max(1,1e3*t[c]*a))/1e4))/1e6)):p&&(t[c]<1?t[c]=Math.round(1e6*(1*t[c]+Math.round(Math.max(1,1e3*t[c]*a))/1e4))/1e6:t[c]+=Math.round(Math.max(1,.1*t[c]*a))),s+=westui.lang.popup[o][c].replace("#1",t[c]).replace("#2",u)}0<l&&(s+="
")}if(t.textjob){for(n=0;n<t.textjob.length;n++)s+='
'+t.textjob[n]+"
";s+="
"}if(t.bonus){for(n=0;n<t.bonus.length;n++)s+='
'+t.bonus[n]+"
";s+="
"}if(t.jobs){s+='
<img src="'+westui.config.cdn+"/images/jobs/"+t.jobs[n][1]+'.png"/> | '+t.jobs[n][0]+" |
"}if(t.craft){s+='
<img src="'+westui.config.cdn+"/images/crafting/profsymbol_"+t.craft.id+'_small.png"/> | ';for(n=0;n<t.craft.req.length;n++)s+='';s+="";for(n=0;n<t.craft.req.length;n++)s+="";s+="
|
"}return s+='
'+westui.lang.speed+": +"+t.spd+"%
"),t.set&&(s+='
<a class="popup_set" href="/wiki/'+t.set+'">'+t.set+"</a>
"),t.sp?s+='<img src="'+westui.config.img_buyprice+'"/>'+t.bp+' <img src="'+westui.config.img_sellprice+'"/> '+t.sp+"
":s+=""+westui.lang.unsalable+"
",t.lvl&&(s+=westui.lang.level+" "+t.lvl+"
"),t.sex&&(0==t.sex?s+='<img src="'+westui.config.img_male+'"/> ':s+='<img src="'+westui.config.img_female+'"/> '),1==t.auc?s+=''+westui.lang.auction+"
":s+=''+westui.lang.not_auction+"
",0==t.upg?s+=''+westui.lang.not_upgrade+"
":s+=''+westui.lang.upgrade+"
",s+='
[item='+t.id+"]
"},setPosition:function(t){var e,i,a=$(window).width(),s=$(window).height(),p=westui.popup.getEl().outerWidth(),n=westui.popup.getEl().outerHeight(),o=t.clientX,l=t.clientY;i=a<o+p+20?o-p-20+(t.pageX-t.clientX):o+20+(t.pageX-t.clientX),e=s<l+n+20?s-n+(t.pageY-t.clientY):l+20+(t.pageY-t.clientY),westui.popup.getEl().css({top:e,left:i})},init:function(){$("body").append('
'),$(document).on("mouseenter",".item_container",function(t){westui.popup.show(this),westui.popup.setPosition(t)}),$(document).on("mouseleave",".item_container",function(){westui.popup.hide()}),$(document).on("mousemove",".item_container",function(t){westui.popup.setPosition(t)}),$(".item_level").mousedown(function(t){t.preventDefault()}),$(document).on("click",".upgrade",function(){var t=$(this).closest(".item_container"),e=parseInt(t.attr("data-lvl"));5!==e&&(t.attr("data-lvl",e+1),t.find(".level").html(e+1)),westui.popup.show(t[0])}),$(document).on("click",".downgrade",function(){var t=$(this).closest(".item_container"),e=parseInt(t.attr("data-lvl"));0!==e&&(t.attr("data-lvl",e-1),t.find(".level").html(e-1)),westui.popup.show(t[0])})}},set_calc:{bonus:{extra_set_bonus:{}},data:{},itemStatus:{},getData:function(){$(".set_container").each(function(){var i=$(this).attr("data-set-id");westui.set_calc.itemStatus[i]={},westui.set_calc.data[i]={items:{},set:{}},$(this).find(".item_container").each(function(){var t=JSON.parse($(this).attr("data-popup"));for(var e in $(this).is(":hidden")?westui.set_calc.itemStatus[i][t.id]=!1:westui.set_calc.itemStatus[i][t.id]=0,t)t.hasOwnProperty(e)&&westui.config.set_bonus.hasOwnProperty(e)&&(westui.set_calc.data[i].items[e]||(westui.set_calc.data[i].items[e]={}),westui.set_calc.data[i].items[e][t.id]=t[e])})}),$(".infoSet").each(function(){var e=$(this).attr("data-set-id");$(this).find(".infosetatt").each(function(){var t=$(this).attr("data-nb");westui.set_calc.data[e].set[t]={},$(this).find(".set_bonus").each(function(){key=$(this).attr("data-type"),0!==$(this).find(".calc").length?westui.set_calc.data[e].set[t][key]=-parseFloat($(this).find(".calc").attr("id")):westui.set_calc.data[e].set[t][key]=parseFloat($(this).find(".val").text()),westui.config.set_bonus.hasOwnProperty(key)||(westui.set_calc.bonus.extra_set_bonus[key]={img:$(this).find("img").attr("src"),name:$(this).find("#tooltip_content").text()})})})})},calc:function(){if(0===$("#input_level").length|""!==$("#input_level input").val()){var t=parseInt($("#input_level input").val());for(var e in total={},westui.set_calc.data){for(var i in westui.set_calc.data[e].items)for(var a in westui.set_calc.data[e].items[i])if(!1!==westui.set_calc.itemStatus[e][a]){lvl=westui.set_calc.itemStatus[e][a],total[i]||(total[i]=0);var s=westui.set_calc.data[e].items[i][a];westui.set_calc.data[e].items[i][a]<0?(s=-s,0<westui.set_calc.itemStatus[e][a]?total[i]+=Math.ceil(s*t)+Math.round(Math.max(1,.1*Math.ceil(s*t)*lvl)):total[i]+=Math.ceil(s*t)):0<westui.set_calc.itemStatus[e][a]?total[i]+=s<1?Math.round(1e6*(1*s+Math.round(Math.max(1,1e3*s*lvl))/1e4))/1e6:Math.round(Math.max(1,.1*s*lvl)):total[i]+=s}var p=0;for(var a in westui.set_calc.itemStatus[e])!1!==westui.set_calc.itemStatus[e][a]&&p++;for(var i in westui.set_calc.data[e].set[p])total[i]||(total[i]=0),westui.set_calc.data[e].set[p][i]<0?total[i]+=Math.ceil(-westui.set_calc.data[e].set[p][i]*t):total[i]+=westui.set_calc.data[e].set[p][i]}var n='
";for(var i in westui.config.set_bonus)total.hasOwnProperty(i)&&(n+=' <img src="'+westui.config.set_bonus[i].img+'">+'+total[i]+' ");for(var i in westui.set_calc.bonus.extra_set_bonus)total.hasOwnProperty(i)&&(n+=''+westui.config.set_bonus[i].name+" <img src="'+westui.set_calc.bonus.extra_set_bonus[i].img+'">+'+total[i]+(-1!==["xp","money","luck","spd","regen","drop"].indexOf(i)?"%":"")+' ");$("#set_calc").html(n)}else $("#set_calc").html("")},initEvents:function(){$(".item_container > img").on("click",function(){var t=$(this).closest(".item_container");t.toggleClass("item_off");var e=t.closest(".set_container").attr("data-set-id"),i=JSON.parse(t.attr("data-popup")).id;t.hasClass("item_off")||t.is(":hidden")?westui.set_calc.itemStatus[e][i]=!1:westui.set_calc.itemStatus[e][i]=parseInt(t.attr("data-lvl")),westui.set_calc.calc()}),$(document).on("click",".upgrade, .downgrade",function(){var t=$(this).closest(".item_container"),e=t.closest(".set_container").attr("data-set-id");t.hasClass("item_off")||t.is(":hidden")||(westui.set_calc.itemStatus[e][JSON.parse(t.attr("data-popup")).id]=parseInt(t.attr("data-lvl")),westui.set_calc.calc())}),$("#input_level").bind("propertychange keyup input paste",function(){westui.set_calc.calc()}),$("#switch").on("click",function(){$("#melee, #fire").each(function(){var t=$(this).find(".item_container"),e=$(this).closest(".set_container").attr("data-set-id");$(this).is(":hidden")?westui.set_calc.itemStatus[e][JSON.parse(t.attr("data-popup")).id]=!1:westui.set_calc.itemStatus[e][JSON.parse(t.attr("data-popup")).id]=parseInt(t.attr("data-lvl"))}),westui.set_calc.calc()})},init:function(){westui.set_calc.initEvents(),westui.set_calc.getData(),$("#mw-content-text").append(''),0===$("#input_level").length&&westui.set_calc.calc()}},init:function(){westui.initPage(),westui.popup.init(),westui.config.enable_set_calc&&0!==$(".infoSet").length&&westui.set_calc.init()}},westui.init();'+westui.set_calc.bonus.extra_set_bonus[i].name+" |