From e86d1782993742890a4bc7e6ead5127a67f547fc Mon Sep 17 00:00:00 2001 From: pavelbraginskiy Date: Sun, 17 Sep 2017 21:03:00 -0700 Subject: [PATCH 1/5] Fix /o_o bug --- chatcommands.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatcommands.user.js b/chatcommands.user.js index 9cb72ea..0d338aa 100644 --- a/chatcommands.user.js +++ b/chatcommands.user.js @@ -54,7 +54,7 @@ setInterval(function() { for (var code in codes) { var x = document.getElementById("input"); - x.value = x.value.replace(new RegExp("(?:\\s|^)/" + code), codes[code]); + x.value = x.value.replace(new RegExp("(?<=\\s|^)/" + code), codes[code]); } }, 300); })(); From ea4f87a1ab18fb6a6f93a5b192f0d452d89b71c3 Mon Sep 17 00:00:00 2001 From: pavelbraginskiy Date: Mon, 18 Dec 2017 17:55:02 -0800 Subject: [PATCH 2/5] Make actually functional. --- chatcommands.user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chatcommands.user.js b/chatcommands.user.js index 0d338aa..f7bf42f 100644 --- a/chatcommands.user.js +++ b/chatcommands.user.js @@ -22,6 +22,7 @@ shrug: "¯\\\\_(ツ)_/¯", tableflip: "(ノ°Д°)ノ︵ ┻━┻", "o_+o": function(m) { + m.replace(/^\s+/, '') return "ಠ"+"_".repeat(m.length-3)+"ಠ"; }, disapprove: "ಠ_ಠ", @@ -54,7 +55,7 @@ setInterval(function() { for (var code in codes) { var x = document.getElementById("input"); - x.value = x.value.replace(new RegExp("(?<=\\s|^)/" + code), codes[code]); + x.value = x.value.replace(new RegExp("(?:\\s|^)/" + code), codes[code]); } }, 300); })(); From 025face3adcf381428c0cf08c105f09c2eddd8fe Mon Sep 17 00:00:00 2001 From: pavelbraginskiy Date: Mon, 18 Dec 2017 17:56:20 -0800 Subject: [PATCH 3/5] For real this time --- chatcommands.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatcommands.user.js b/chatcommands.user.js index f7bf42f..ca0e872 100644 --- a/chatcommands.user.js +++ b/chatcommands.user.js @@ -22,7 +22,7 @@ shrug: "¯\\\\_(ツ)_/¯", tableflip: "(ノ°Д°)ノ︵ ┻━┻", "o_+o": function(m) { - m.replace(/^\s+/, '') + m = m.replace(/^\s+/, '') return "ಠ"+"_".repeat(m.length-3)+"ಠ"; }, disapprove: "ಠ_ಠ", From edd6c0388fb86bdadd8cfb5c235e6f751824eed9 Mon Sep 17 00:00:00 2001 From: pavelbraginskiy Date: Mon, 18 Dec 2017 17:59:59 -0800 Subject: [PATCH 4/5] Add semicolon because why not --- chatcommands.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatcommands.user.js b/chatcommands.user.js index ca0e872..2168c8f 100644 --- a/chatcommands.user.js +++ b/chatcommands.user.js @@ -22,7 +22,7 @@ shrug: "¯\\\\_(ツ)_/¯", tableflip: "(ノ°Д°)ノ︵ ┻━┻", "o_+o": function(m) { - m = m.replace(/^\s+/, '') + m = m.replace(/^\s+/, ''); return "ಠ"+"_".repeat(m.length-3)+"ಠ"; }, disapprove: "ಠ_ಠ", From 19af20ea34d5714734f0459efe74eaa4018b9765 Mon Sep 17 00:00:00 2001 From: pavelbraginskiy Date: Mon, 18 Dec 2017 18:05:59 -0800 Subject: [PATCH 5/5] It actually works this time. Like I've tested and everything. --- chatcommands.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chatcommands.user.js b/chatcommands.user.js index 2168c8f..be123de 100644 --- a/chatcommands.user.js +++ b/chatcommands.user.js @@ -22,8 +22,8 @@ shrug: "¯\\\\_(ツ)_/¯", tableflip: "(ノ°Д°)ノ︵ ┻━┻", "o_+o": function(m) { - m = m.replace(/^\s+/, ''); - return "ಠ"+"_".repeat(m.length-3)+"ಠ"; + var head = /\s+/.exec(m) || ''; + return head + "ಠ" + "_".repeat(m.length-3-head.length) + "ಠ"; }, disapprove: "ಠ_ಠ", like: "(•◡•)/",