Last active
December 10, 2019 08:05
-
-
Save huntrax11/2ffa03f04e4e29e37387cdcbb043a70a to your computer and use it in GitHub Desktop.
whooing-hide-fiugre.user.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 후잉 hide figures | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description 후잉 숫자를 가려드립니다. | |
// @author Robert Park | |
// @match https://whooing.com/ | |
// @match https://new.whooing.com/ | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Your code here... | |
$.noConflict(); | |
jQuery( document ).ready(function( $ ) { | |
setInterval(function(){ | |
function do_mask(idx, elem){ | |
const regex = /[ ]*([0-9]{1,3}[,.경조억만천]?)+[kmg%]?[ ]*$/ig; | |
const text = $(elem).text(); | |
var matches = text.matchAll(regex); | |
var subt_text = ""; | |
for (const match of matches) { | |
subt_text += text.substr(subt_text.length, match.index); | |
subt_text += match[0].replace(/[0-9]/g, '#'); | |
} | |
if (subt_text.length > 0) { | |
subt_text += text.substr(subt_text.length); | |
$(elem).text(subt_text); | |
} | |
}; | |
$('*:not(:has(*))').each(do_mask); | |
$('*').each(do_mask); | |
}, 10); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment