-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
36 lines (33 loc) · 1.48 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<html>
<meta charset='utf-8'>
<title>Emoji string splitter: javascript library to split emoji string</title>
<script src='jquery.min.js'></script>
<script src='emojisplit.js'></script>
<body>
<p>Make emoji string here: <a target='_blank' href='https://www.emojionline.org'>https://www.emojionline.org</a></p>
<input type='text' id='txt' style='font-size:20px;padding:2px;width:100%;'><br>
<input type='button' id='btsplit' value='Split' onclick='btSplitClicked()' style='padding:5px 20px;margin-top:10px;'>
<hr>
<div id='result' style='line-height:35px;'></div>
<script>
var m = new EmojiSpliter().create();
var result = m.splitBySymbol('I ❤ you 💏');
var str = '';
str += 'I ❤ you 💏'+' ==> '+result;
str += '<br>';
result = m.splitBySymbol('This 🎄🎅🏼, my 👨👩👧👦 will go to 🗽', '//');
str += 'This 🎄🎅🏼, my 👨👩👧👦 will go to 🗽'+' ==> '+result;
str += '<br>';
result = m.splitBySymbol('👨🏾🎓👷🏿👸🏻👢👨👨👦👩👩👦💑🤦🏼🙋');
str += '👨🏾🎓👷🏿👸🏻👢👨👨👦👩👩👦💑🤦🏼🙋'+' ==> '+result;
str += '<br>';
document.getElementById('result').innerHTML = str;
function btSplitClicked(){
result = m.splitBySymbol($('#txt').val());
str += $('#txt').val()+' ==> '+result;
str += '<br>';
document.getElementById('result').innerHTML = str;
}
</script>
</body>
</html>