Seblor

Script Glyphs This has not gone well

Sep 6th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Glyphs This has not gone well
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  try to take over the world!
  6. // @author       Seblor
  7. // @match        https://www.reddit.com/r/HFY/*oh_this_has_not_gone_well*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.     'use strict';
  13.  
  14.     var obj = { "ᛜ": "Sight", "ᛝ": "Hearing", "ᛃ": "Taste", "ᚲ": "Scent", "ᛟ": "Touch", "ᛖ": "Air", "ᛥ": "Earth", "ᛞ": "Fire", "ᚻ": "Water", "ᛋ": "Mind", "ᛊ": "Body", "ᛪ": "Spirit", "ᚠ": "Creation", "ᚵ": "Destruction", "ᚡ": "Transform", "ᚴ": "Weaken", "ᚶ": "Strengthen", "ᛉ": "Life", "ᛣ": "Death", "ᛘ": "Heal", "ᛯ": "Necromancy", "ᛦ": "Harm", "ᚩ": "Quicken", "ᚫ": "Slow", "ᛐ": "Light", "ᛑ": "Darkness", "ᛚ": "Sound", "ᛛ": "Silence", "ᚽ": "Illusion", "᛭": "Join", "᛬": "Separate", "ᛌ": "Move", "ᛍ": "Gate", "᛫": "Anchor", "ᚷ": "The Known/Knowledge", "ᚸ": "The Unknown", "ᛤ": "The Unknowable/The Void", "ᛩ": "Plant", "ᚹ": "Animal", "ᚱ": "Person", "ᛇ": "Food", "ᛢ": "Poison", "ᛎ": "End", "ᛨ": "Infinity/Eternity", "ᛏ": "Begin", "ᛄ": "Fate", "ᚼ": "Luck", "ᚢ": "Large", "ᚤ": "Small", "ᚥ": "Grow", "ᚣ": "Shrink", "ᚦ": "Sun", "ᚧ": "Stars", "ᛰ": "Moon", "ᛗ": "Heat", "ᚺ": "Cold", "ᛀ": "Control", "ᚾ": "Freedom", "ᛠ": "Communication", "ᛔ": "Magic" };
  15.  
  16.     var txt = document.querySelector(".self").innerHTML;
  17.  
  18.     var res = txt.replace(/\S*(ᛜ|ᛝ|ᛃ|ᚲ|ᛟ|ᛖ|ᛥ|ᛞ|ᚻ|ᛋ|ᛊ|ᛪ|ᚠ|ᚵ|ᚡ|ᚴ|ᚶ|ᛉ|ᛣ|ᛘ|ᛯ|ᛦ|ᚩ|ᚫ|ᛐ|ᛑ|ᛚ|ᛛ|ᚽ|᛭|᛬|ᛌ|ᛍ|᛫|ᚷ|ᚸ|ᛤ|ᛩ|ᚹ|ᚱ|ᛇ|ᛢ|ᛎ|ᛨ|ᛏ|ᛄ|ᚼ|ᚢ|ᚤ|ᚥ|ᚣ|ᚦ|ᚧ|ᛰ|ᛗ|ᚺ|ᛀ|ᚾ|ᛠ|ᛔ)+\S*/g, function (glyphs) {
  19.         var result = [];
  20.         glyphs.replace(/./g, function (s, key) {
  21.             if (obj[s] !== undefined) {
  22.                 result.push(obj[s]);
  23.             }
  24.             return obj[s] || s;
  25.         });
  26.         return glyphs + ((result.length === 0) ? ("") : (" (" + result.join(", ") + ")"));
  27.     });
  28.  
  29.     document.querySelector(".self").innerHTML = res;
  30. })();
Add Comment
Please, Sign In to add comment