MediaWiki:Common.js: Difference between revisions

From Ylvapedia
Jump to navigation Jump to search
m (Undo revision 5065 by Hachimitsu (talk))
Tag: Undo
(Formatting, fixed extraneous commas in lists)
 
(14 intermediate revisions by one other user not shown)
Line 4: Line 4:


$(document).ready(function () {
$(document).ready(function () {
    // Define the values for red and green text
// Define the values for red and green text
    var redValues = ["Dry", "Fairy-sized", "Dead", "Stinky", "Boring", "Lacks Firmness", "Crunchy", "Bitter", "Tarnished", "Bland","Hollow", "Coarse", "Rustic", "Dull Color", "Harmful Substance","Soggy","Squishy", "Tasteless", "Sandy", "Ugly","Dangerous","Hallucinogenic","Cat", "Poison Mix","毒物混入", "パサパサ","妖精サイズ","死んでいる","くさい","つまらない","コシがない","苦い","不格好","カチカチ","淡白","すかすか","無骨","曇った色","有害物質","ふにゃふにゃ"," 退屈","ざらざら","危険","幻覚作用","猫",];
var redValues = ["Dry", "Fairy-sized", "Dead", "Stinky", "Boring", "Lacks Firmness", "Crunchy", "Bitter", "Tarnished", "Bland", "Hollow", "Coarse", "Rustic", "Dull Color", "Harmful Substance", "Soggy", "Squishy", "Tasteless", "Sandy", "Ugly", "毒物混入", "パサパサ", "妖精サイズ", "死んでいる", "くさい", "つまらない", "コシがない", "苦い", "不格好", "淡白", "すかすか", "無骨", "曇った色", "有害物質", "ふにゃふにゃ", " 退屈", "ざらざら", "媚薬混入", "退屈"];
  var greenValues = ["Common Quality","Fair Quality", "Fine Quality","Premium Quality","Royal Quality","Slightly Moist", "Moist", "Fatty", "Juicy", "Bursting with Juice","Bursting", "Pumpkin-sized", "Putit-sized", "Monster-sized", "Mammoth-sized", "Titan-sized","Almost Moving", "Moving", "Lively", "Very Lively","Alive","Faint Aroma", "Pleasant Smell", "Fragrant", "Highly Fragrant", "Heavenly Scent","Slightly Unusual","Unusual", "Rare", "Super Rare","Ultra Rare", "Slightly Firm", "Stretchy", "Chewy","Infinitely Stretchy", "Resilient","Slightly Sweet", "Sweet", "Clearly Sweet", "Extremely Sweet", "Sugar Bomb", "Concerning", "Eye-Catching", "Cute", "Beautiful", "Creepy Cute", "Collagen Rich", "Creamy", "Mellow", "Thick", "Velvety","Somewhat Dense", "Dense", "Very Dense", "Concentrated", "Ultra Concentrated","Rich", "Slightly Rough", "Rough", "Delicate", "Extremely Delicate","Utterly Delicate","Pale Color", "Colorful", "Bright", "Vivid", "Trace Vitamins", "Small Vitamins", "Moderate Vitamins", "Large Vitamins","Abundant Vitamins", "Treasure Trove Vitamins", "Flaky", "Crispy", "Very Crispy", "Snappy", "Somewhat Spicy", "Spicy", "Very Spicy", "Extremely Spicy", "Intensely Spicy","Slightly Glossy","Glossy", "Bright", "Shiny", "Lustrous", "Bewitchingly Shiny","Rainbow Color","Fatten Up","Slim Down","Never Decay","Bug Mix","Adam","普通の出来","まあまあの出来","良い出来","高級品","極上品","しっとり","てかてか","脂たっぷり","ジューシー","じゅわっと溢れる脂","プチサイズ","かぼちゃサイズ","お化けサイズ","マンモスサイズ","巨人サイズ","動きそう","動く","活きがいい","ピチピチ","生きている","ほのかな香り","いい匂い","かぐわしい","香り高い","天上の香り","少し珍しい","珍しい","レア","スーパーレア","ウルトラレア","少しコシがある","粘り強い","もちもち","伸びる","どこまでも伸びる","ほんのり甘い","甘い","はっきり甘い","激甘","砂糖爆弾","少し気になる","気になる","綺麗","かわいい","きもかわいい","コラーゲン豊富","独特の味","クリーミー","まろやか","濃厚","こくまろ","ちょっとぎっしり","ぎっしり","みっちり","パンパン","超特濃縮","おおざっぱ","華奢","繊細","非常に繊細","極めて繊細","薄い色","カラフル","鮮やか","鮮烈","万色","ビタミン微量","ビタミン少量","ビタミン中量","ビタミン大量","ビタミンの宝庫","ポリポリ","シャキシャキ","サクサク","ザクザク","カリカリ","やや刺激的","刺激的","スパイシー","とてもスパイシー","恐ろしくスパイシー","僅かな光沢","つるつる","つやつや","艶やか","魅惑の光沢","太る","痩せる","腐らない","蟲混入","アダム",];
var greenValues = ["Common Quality", "Fair Quality", "Fine Quality", "Premium Quality", "Royal Quality", "Slightly Moist", "Moist", "Fatty", "Juicy", "Bursting with Juice", "Bursting", "Pumpkin-sized", "Putit-sized", "Monster-sized", "Mammoth-sized", "Titan-sized", "Almost Moving", "Moving", "Lively", "Very Lively", "Alive", "Faint Aroma", "Pleasant Smell", "Fragrant", "Highly Fragrant", "Heavenly Scent", "Slightly Unusual", "Unusual", "Rare", "Super Rare", "Ultra Rare", "Slightly Firm", "Stretchy", "Chewy", "Infinitely Stretchy", "Resilient", "Slightly Sweet", "Sweet", "Clearly Sweet", "Extremely Sweet", "Sugar Bomb", "Concerning", "Eye-Catching", "Cute", "Beautiful", "Creepy Cute", "Creamy", "Mellow", "Thick", "Velvety", "Somewhat Dense", "Dense", "Very Dense", "Concentrated", "Ultra Concentrated", "Rich", "Slightly Rough", "Rough", "Delicate", "Extremely Delicate", "Utterly Delicate", "Pale Color", "Colorful", "Bright", "Vivid", "Trace Vitamins", "Small Vitamins", "Moderate Vitamins", "Large Vitamins", "Abundant Vitamins", "Treasure Trove Vitamins", "Flaky", "Crispy", "Very Crispy", "Snappy", "Somewhat Spicy", "Spicy", "Very Spicy", "Extremely Spicy", "Intensely Spicy", "Slightly Glossy", "Glossy", "Bright", "Shiny", "Lustrous", "Bewitchingly Shiny", "Rainbow Color", "普通の出来", "まあまあの出来", "良い出来", "高級品", "極上品", "しっとり", "てかてか", "脂たっぷり", "ジューシー", "じゅわっと溢れる脂", "プチサイズ", "かぼちゃサイズ", "お化けサイズ", "マンモスサイズ", "巨人サイズ", "動きそう", "動く", "活きがいい", "ピチピチ", "生きている", "ほのかな香り", "いい匂い", "かぐわしい", "香り高い", "天上の香り", "少し珍しい", "珍しい", "レア", "スーパーレア", "ウルトラレア", "少しコシがある", "粘り強い", "もちもち", "伸びる", "どこまでも伸びる", "ほんのり甘い", "甘い", "はっきり甘い", "激甘", "砂糖爆弾", "少し気になる", "気になる", "綺麗", "かわいい", "きもかわいい", "独特の味", "クリーミー", "まろやか", "濃厚", "こくまろ", "ちょっとぎっしり", "ぎっしり", "みっちり", "パンパン", "超特濃縮", "おおざっぱ", "華奢", "繊細", "非常に繊細", "極めて繊細", "薄い色", "カラフル", "鮮やか", "鮮烈", "万色", "ビタミン微量", "ビタミン少量", "ビタミン中量", "ビタミン大量", "ビタミンの宝庫", "ポリポリ", "シャキシャキ", "サクサク", "ザクザク", "カリカリ", "やや刺激的", "刺激的", "スパイシー", "とてもスパイシー", "恐ろしくスパイシー", "僅かな光沢", "つるつる", "つやつや", "艶やか", "魅惑の光沢", "濃縮", "ビタミン豊富", "腐りにくい"];
var tealValues = ["Human Flesh", "Tainted","人肉","不浄"];
var tealValues = ["Human Flesh", "Tainted", "Rich Collagen", "Fatten Up", "Slim Down", "Never Decay", "Slightly Slow Decay", "Aphrodisiac Mix", "Bug Mix", "Adam", "Dangerous", "Hallucinogenic", "Cat", "Poison Mix", "人肉", "不浄", "コラーゲン豊富", "カチカチ", "太る", "痩せる", "腐らない", "気持ち腐りにくい", "危険", "幻覚作用", "毒物混入", "蟲混入", "媚薬混入", "猫", "アダム"];
    // Loop through each Food table cell in wikitable
// Loop through each Food table cell in wikitable
    $('.Food td').each(function () {
$('.Food td').each(function () {
        var cellText = $(this).text().trim();
var cellText = $(this).text().trim();


        // Check if cell text is exactly equal to any redValues
// Check if cell text is exactly equal to any redValues
        if (redValues.includes(cellText)) {
if (redValues.includes(cellText)) {
            $(this).css('color', 'red');
$(this).css('color', 'red');
        }
}


        // Check if cell text is exactly equal to any greenValues
// Check if cell text is exactly equal to any greenValues
        if (greenValues.includes(cellText)) {
if (greenValues.includes(cellText)) {
            $(this).css('color', 'green');
$(this).css('color', 'green');
        }
}
       
 
        // Check if cell text is exactly equal to any tealValues
// Check if cell text is exactly equal to any tealValues
        if (tealValues.includes(cellText)) {
if (tealValues.includes(cellText)) {
            $(this).css('color', 'steelblue');
$(this).css('color', 'steelblue');
        }
}
    });
});
});
});


// Script for auto coloration of text in equipment tables
// Script for auto coloration of text in equipment tables
 
$(document).ready(function () {
$(document).ready(function () {
    // Define the values for blue, red and green text
// Define the values for blue, red and green text
  var tealValues = ["can cut", "can mine", "can fish"];
var tealValues = ["can cut", "can mine", "can fish", "壁を掘ることができる。", "それは木を切ることができる。"];
  var blueValues = ["Faction","ファクション"];
var blueValues = ["Faction", "(ファクション)", "(ファクション)", "それは収穫のクミロミのものだ。", "それは地のオパートスのものだ。", "それは元素のイツパロトルのものだ。", "それは機械のマニのものだ。", "それは幸運のエヘカトルのものだ。", "それは癒しのジュアのものだ。", "それは風のルルウィのものだ。", "それは悪戯のキズアミのものだ。", "それは月影のホロメのものだ。", "それは戦禍のイーヴァンのものだ。"];
  var redValues = ["decreases", "sucks", "accelerates","呪わてる", ];
var redValues = ["decreases", "sucks", "accelerates", "curses", "を下げる。", "それは装備するたびに呪われる。", "それはエーテル病の進行を早める。"];
var greenValues = ["increases", "grants you", "float", "enhances", "better", "additional", "easier", "sustains", "slows the process of decay","inflicts massive","triggers","negates","reduces","prevents","see invisible","returns to your hand.","protects you from thieves.","digest rotten","absolute piercing","protects you from mutation.","strengthens","揚げる"];
var greenValues = ["increases", "grants you", "float", "enhances", "better", "additional", "easier", "sustains", "slows the process of decay", "inflicts massive", "triggers", "negates", "reduces", "prevents", "see invisible", "returns to your hand.", "protects you from thieves.", "digest rotten", "absolute piercing", "protects you from mutation.", "strengthens", "を可能にさせる。", "を可能にする。", "を容易にする。", "を無効にする。", "を防ぐ。", "腕をあげる。", "腕を上げる。", "を深める。", "上昇させる。", "耐性を授ける。", "を発動する。", "を強化する。", "を維持する。", "に対して絶大な威力を発揮する。", "属性の追加ダメージを与える。", "それはクリティカルヒットの機会を増やす。", "それは持ち主の手元に戻ってくる。", "それはあなたを浮遊させる。", "それはアイテムを盗まれなくする。", "それは理力によって振るわれる。", "それは「元素の傷跡」を発動する。", "それは振動している。", "それは対象の周囲にも被弾する。", "それは離れた相手を攻撃することができる。", "それは被弾した相手を突き抜ける。", "それはあなたの旅の進行を早くする。", "それは帯電している。", "それはあなたを浮遊させる。", "それはマナを吸収する。", "それは他者の信仰を明らかにする。", "それは腐ったものを難なく消化させる。", "それはあなたを変異から保護する。"];


    // Loop through each Equipment table cell in wikitable
// Loop through each Equipment wikitable cell
    $('.Equipment td').each(function () {
$('.Equipment td').each(function () {
        var cellText = $(this).text().trim();
var cellText = $(this).text().trim();


        // Check if cell text contains tealValues  
// Check if cell text contains tealValues  
        if (tealValues.some(function (value) {
if (tealValues.some(function (value) {
            return cellText.indexOf(value) !== -1;
return cellText.indexOf(value) !== -1;
        })) {
})) {
            $(this).css('color', 'steelblue');
$(this).css('color', 'steelblue');
        }
}
          // Check if cell text contains blueValues
// Check if cell text contains redValues  
        if (blueValues.some(function (value) {
if (redValues.some(function (value) {
            return cellText.indexOf(value) !== -1;
return cellText.indexOf(value) !== -1;
        })) {
})) {
            $(this).css('color', 'CornflowerBlue');
$(this).css('color', 'red');
        }
}
        // Check if cell text contains redValues  
        if (redValues.some(function (value) {
            return cellText.indexOf(value) !== -1;
        })) {
            $(this).css('color', 'red');
        }


        // Check if cell text contains greenValues  
// Check if cell text contains greenValues  
        if (greenValues.some(function (value) {
if (greenValues.some(function (value) {
            return cellText.indexOf(value) !== -1;
return cellText.indexOf(value) !== -1;
        })) {
})) {
            $(this).css('color', 'green');
$(this).css('color', 'green');
        }
}
    });
// Check if cell text contains blueValues
if (blueValues.some(function (value) {
return cellText.indexOf(value) !== -1;
})) {
$(this).css('color', 'Blue');
}
});
});
});

Latest revision as of 23:17, 10 November 2024

/* Any JavaScript here will be loaded for all users on every page load. */
importScript('MediaWiki:jquery.js');


$(document).ready(function () {
	// Define the values for red and green text
	var redValues = ["Dry", "Fairy-sized", "Dead", "Stinky", "Boring", "Lacks Firmness", "Crunchy", "Bitter", "Tarnished", "Bland", "Hollow", "Coarse", "Rustic", "Dull Color", "Harmful Substance", "Soggy", "Squishy", "Tasteless", "Sandy", "Ugly", "毒物混入", "パサパサ", "妖精サイズ", "死んでいる", "くさい", "つまらない", "コシがない", "苦い", "不格好", "淡白", "すかすか", "無骨", "曇った色", "有害物質", "ふにゃふにゃ", "	退屈", "ざらざら", "媚薬混入", "退屈"];
	var greenValues = ["Common Quality", "Fair Quality", "Fine Quality", "Premium Quality", "Royal Quality", "Slightly Moist", "Moist", "Fatty", "Juicy", "Bursting with Juice", "Bursting", "Pumpkin-sized", "Putit-sized", "Monster-sized", "Mammoth-sized", "Titan-sized", "Almost Moving", "Moving", "Lively", "Very Lively", "Alive", "Faint Aroma", "Pleasant Smell", "Fragrant", "Highly Fragrant", "Heavenly Scent", "Slightly Unusual", "Unusual", "Rare", "Super Rare", "Ultra Rare", "Slightly Firm", "Stretchy", "Chewy", "Infinitely Stretchy", "Resilient", "Slightly Sweet", "Sweet", "Clearly Sweet", "Extremely Sweet", "Sugar Bomb", "Concerning", "Eye-Catching", "Cute", "Beautiful", "Creepy Cute", "Creamy", "Mellow", "Thick", "Velvety", "Somewhat Dense", "Dense", "Very Dense", "Concentrated", "Ultra Concentrated", "Rich", "Slightly Rough", "Rough", "Delicate", "Extremely Delicate", "Utterly Delicate", "Pale Color", "Colorful", "Bright", "Vivid", "Trace Vitamins", "Small Vitamins", "Moderate Vitamins", "Large Vitamins", "Abundant Vitamins", "Treasure Trove Vitamins", "Flaky", "Crispy", "Very Crispy", "Snappy", "Somewhat Spicy", "Spicy", "Very Spicy", "Extremely Spicy", "Intensely Spicy", "Slightly Glossy", "Glossy", "Bright", "Shiny", "Lustrous", "Bewitchingly Shiny", "Rainbow Color", "普通の出来", "まあまあの出来", "良い出来", "高級品", "極上品", "しっとり", "てかてか", "脂たっぷり", "ジューシー", "じゅわっと溢れる脂", "プチサイズ", "かぼちゃサイズ", "お化けサイズ", "マンモスサイズ", "巨人サイズ", "動きそう", "動く", "活きがいい", "ピチピチ", "生きている", "ほのかな香り", "いい匂い", "かぐわしい", "香り高い", "天上の香り", "少し珍しい", "珍しい", "レア", "スーパーレア", "ウルトラレア", "少しコシがある", "粘り強い", "もちもち", "伸びる", "どこまでも伸びる", "ほんのり甘い", "甘い", "はっきり甘い", "激甘", "砂糖爆弾", "少し気になる", "気になる", "綺麗", "かわいい", "きもかわいい", "独特の味", "クリーミー", "まろやか", "濃厚", "こくまろ", "ちょっとぎっしり", "ぎっしり", "みっちり", "パンパン", "超特濃縮", "おおざっぱ", "華奢", "繊細", "非常に繊細", "極めて繊細", "薄い色", "カラフル", "鮮やか", "鮮烈", "万色", "ビタミン微量", "ビタミン少量", "ビタミン中量", "ビタミン大量", "ビタミンの宝庫", "ポリポリ", "シャキシャキ", "サクサク", "ザクザク", "カリカリ", "やや刺激的", "刺激的", "スパイシー", "とてもスパイシー", "恐ろしくスパイシー", "僅かな光沢", "つるつる", "つやつや", "艶やか", "魅惑の光沢", "濃縮", "ビタミン豊富", "腐りにくい"];
	var tealValues = ["Human Flesh", "Tainted", "Rich Collagen", "Fatten Up", "Slim Down", "Never Decay", "Slightly Slow Decay", "Aphrodisiac Mix", "Bug Mix", "Adam", "Dangerous", "Hallucinogenic", "Cat", "Poison Mix", "人肉", "不浄", "コラーゲン豊富", "カチカチ", "太る", "痩せる", "腐らない", "気持ち腐りにくい", "危険", "幻覚作用", "毒物混入", "蟲混入", "媚薬混入", "猫", "アダム"];
	// Loop through each Food table cell in wikitable
	$('.Food td').each(function () {
		var cellText = $(this).text().trim();

		// Check if cell text is exactly equal to any redValues
		if (redValues.includes(cellText)) {
			$(this).css('color', 'red');
		}

		// Check if cell text is exactly equal to any greenValues
		if (greenValues.includes(cellText)) {
			$(this).css('color', 'green');
		}

		// Check if cell text is exactly equal to any tealValues
		if (tealValues.includes(cellText)) {
			$(this).css('color', 'steelblue');
		}
	});
});

// Script for auto coloration of text in equipment tables

$(document).ready(function () {
	// Define the values for blue, red and green text
	var tealValues = ["can cut", "can mine", "can fish", "壁を掘ることができる。", "それは木を切ることができる。"];
	var blueValues = ["Faction", "(ファクション)", "(ファクション)", "それは収穫のクミロミのものだ。", "それは地のオパートスのものだ。", "それは元素のイツパロトルのものだ。", "それは機械のマニのものだ。", "それは幸運のエヘカトルのものだ。", "それは癒しのジュアのものだ。", "それは風のルルウィのものだ。", "それは悪戯のキズアミのものだ。", "それは月影のホロメのものだ。", "それは戦禍のイーヴァンのものだ。"];
	var redValues = ["decreases", "sucks", "accelerates", "curses", "を下げる。", "それは装備するたびに呪われる。", "それはエーテル病の進行を早める。"];
	var greenValues = ["increases", "grants you", "float", "enhances", "better", "additional", "easier", "sustains", "slows the process of decay", "inflicts massive", "triggers", "negates", "reduces", "prevents", "see invisible", "returns to your hand.", "protects you from thieves.", "digest rotten", "absolute piercing", "protects you from mutation.", "strengthens", "を可能にさせる。", "を可能にする。", "を容易にする。", "を無効にする。", "を防ぐ。", "腕をあげる。", "腕を上げる。", "を深める。", "上昇させる。", "耐性を授ける。", "を発動する。", "を強化する。", "を維持する。", "に対して絶大な威力を発揮する。", "属性の追加ダメージを与える。", "それはクリティカルヒットの機会を増やす。", "それは持ち主の手元に戻ってくる。", "それはあなたを浮遊させる。", "それはアイテムを盗まれなくする。", "それは理力によって振るわれる。", "それは「元素の傷跡」を発動する。", "それは振動している。", "それは対象の周囲にも被弾する。", "それは離れた相手を攻撃することができる。", "それは被弾した相手を突き抜ける。", "それはあなたの旅の進行を早くする。", "それは帯電している。", "それはあなたを浮遊させる。", "それはマナを吸収する。", "それは他者の信仰を明らかにする。", "それは腐ったものを難なく消化させる。", "それはあなたを変異から保護する。"];

	// Loop through each Equipment wikitable cell
	$('.Equipment td').each(function () {
		var cellText = $(this).text().trim();

		// Check if cell text contains tealValues 
		if (tealValues.some(function (value) {
			return cellText.indexOf(value) !== -1;
		})) {
			$(this).css('color', 'steelblue');
		}
		// Check if cell text contains redValues 
		if (redValues.some(function (value) {
			return cellText.indexOf(value) !== -1;
		})) {
			$(this).css('color', 'red');
		}

		// Check if cell text contains greenValues 
		if (greenValues.some(function (value) {
			return cellText.indexOf(value) !== -1;
		})) {
			$(this).css('color', 'green');
		}
		// Check if cell text contains blueValues 
		if (blueValues.some(function (value) {
			return cellText.indexOf(value) !== -1;
		})) {
			$(this).css('color', 'Blue');
		}
	});
});