Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ((words, smile, size = 32) => {
- const img = `<img src='${smile}' width="${size}" height="${size}" />`
- const res = [
- [],
- [],
- [],
- [],
- []
- ]
- let text = ""
- const map = {
- " ": [
- [0],
- [0],
- [0],
- [0],
- [0]
- ],
- a: [
- [1, 1, 1],
- [1, 0, 1],
- [1, 1, 1],
- [1, 0, 1],
- [1, 0, 1]
- ],
- b: [
- [1, 1, 0],
- [1, 0, 1],
- [1, 1, 0],
- [1, 0, 1],
- [1, 1, 0]
- ],
- c: [
- [1, 1, 1],
- [1, 0, 0],
- [1, 0, 0],
- [1, 0, 0],
- [1, 1, 1]
- ],
- d: [
- [0, 0, 1],
- [0, 0, 1],
- [1, 1, 1],
- [1, 0, 1],
- [1, 1, 1]
- ],
- e: [
- [1, 1, 1],
- [1, 0, 0],
- [1, 1, 1],
- [1, 0, 0],
- [1, 1, 1]
- ],
- f: [
- [1, 1, 1],
- [1, 0, 0],
- [1, 1, 1],
- [1, 0, 0],
- [1, 0, 0]
- ],
- g: [
- [0, 1, 1, 1],
- [1, 0, 0, 0],
- [1, 0, 1, 1],
- [1, 0, 0, 1],
- [0, 1, 1, 0]
- ],
- h: [
- [1, 0, 0, 1],
- [1, 0, 0, 1],
- [1, 1, 1, 1],
- [1, 0, 0, 1],
- [1, 0, 0, 1]
- ],
- i: [
- [0, 1, 0],
- [0, 0, 0],
- [0, 1, 0],
- [0, 1, 0],
- [0, 1, 0]
- ],
- j: [
- [0, 0, 1],
- [0, 0, 1],
- [0, 0, 1],
- [1, 0, 1],
- [0, 1, 0]
- ],
- k: [
- [1, 0, 0, 1],
- [1, 0, 1, 0],
- [1, 1, 0, 0],
- [1, 0, 1, 0],
- [1, 0, 0, 1]
- ],
- l: [
- [1, 0, 0],
- [1, 0, 0],
- [1, 0, 0],
- [1, 0, 0],
- [1, 1, 1]
- ],
- m: [
- [1, 0, 1],
- [1, 1, 1],
- [1, 0, 1],
- [1, 0, 1],
- [1, 0, 1]
- ],
- n: [
- [1, 0, 0, 1],
- [1, 1, 0, 1],
- [1, 0, 1, 1],
- [1, 0, 0, 1],
- [1, 0, 0, 1]
- ],
- o: [
- [1, 1, 1],
- [1, 0, 1],
- [1, 0, 1],
- [1, 0, 1],
- [1, 1, 1]
- ],
- p: [
- [1, 1, 0],
- [1, 0, 1],
- [1, 1, 0],
- [1, 0, 0],
- [1, 0, 0]
- ],
- q: [
- [0, 1,],
- [1, 0, 1],
- [1, 0, 1],
- [0, 1, 1],
- [0, 0, 1]
- ],
- r: [
- [1, 1, 1, 0],
- [1, 0, 0, 1],
- [1, 1, 1, 0],
- [1, 0, 1, 0],
- [1, 0, 0, 1]
- ],
- s: [
- [1, 1, 1],
- [1, 0, 0],
- [1, 1, 1],
- [0, 0, 1],
- [1, 1, 1]
- ],
- t: [
- [1, 1, 1],
- [0, 1, 0],
- [0, 1, 0],
- [0, 1, 0],
- [0, 1, 0]
- ],
- u: [
- [1, 0, 0, 1],
- [1, 0, 0, 1],
- [1, 0, 0, 1],
- [1, 0, 0, 1],
- [0, 1, 1, 0]
- ],
- v: [
- [1, 0, 0, 0, 1],
- [1, 0, 0, 0, 1],
- [0, 1, 0, 1, 0],
- [0, 1, 0, 1, 0],
- [0, 0, 1, 0, 0]
- ],
- w: [
- [1, 0, 1, 0, 1],
- [1, 0, 1, 0, 1],
- [1, 0, 1, 0, 1],
- [0, 1, 1, 1, 0],
- [0, 0, 1, 0, 0]
- ],
- x: [
- [1, 0, 0, 0, 1],
- [0, 1, 0, 1, 0],
- [0, 0, 1, 0, 0],
- [0, 1, 0, 1, 0],
- [1, 0, 0, 0, 1]
- ],
- y: [
- [1, 0, 1],
- [0, 1, 0],
- [0, 1, 0],
- [0, 1, 0],
- [0, 1, 0]
- ],
- z: [
- [1, 1, 1, 1, 1],
- [0, 0, 0, 1, 0],
- [0, 0, 1, 0, 0],
- [0, 1, 0, 0, 0],
- [1, 1, 1, 0, 0]
- ]
- }
- for (const e of words.toLowerCase().split("")) {
- for (let i = 0; i < 5; i++) {
- for (const j of map[e][i]) {
- res[i].push(j)
- }
- }
- for (let i = 0; i < 5; i++) {
- res[i].push(0)
- }
- }
- for (const e of res) {
- text += "<p>"
- for (const j of e) {
- if (j === 1) {
- text += img
- } else {
- text += `<img width="${size}" height="${size}" src="https://i.ibb.co/Zd54Q5y/1x1-ffffff05.png"/>`
- }
- }
- text += `</p>`
- }
- tinymce.activeEditor.setContent(text)
- })("string", "/img/forum/emoticons/WispD.png", "25")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement