Created
April 2, 2011 00:08
-
-
Save DHager/899081 to your computer and use it in GitHub Desktop.
Reddit anti-mold
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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | |
<style> | |
textarea{ | |
width:500px; | |
height:150px; | |
clear:both; | |
} | |
</style> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> | |
<script> | |
$(document).ready(function () { | |
var reps = { | |
"e":"е", | |
"E":"Е", | |
"d":"ⅾ", | |
"D":"Ⅾ", | |
"":"" | |
}; | |
var src = $("textarea[name='original']"); | |
var dst = $("textarea[name='demolded']"); | |
var translate = function(){ | |
var txt = src.val(); | |
$.each(reps,function(from,to){ | |
txt = txt.replace(new RegExp(from, 'g'),to); | |
}); | |
dst.val(txt); | |
}; | |
//src.keyup(setTimeout("translate();",100)); | |
$("#manual").click(translate); | |
}); | |
</script> | |
</head> | |
<body> | |
<h1>Reddit Anti-Mold</h1> | |
<h3>Source</h3> | |
<textarea name="original"></textarea><button id="manual">Demold</button> | |
<br/> | |
<h3>Demolded</h3> | |
<textarea name="demolded" readonly="readonly"></textarea> | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment