summaryrefslogtreecommitdiffstats
path: root/template/admin/rsrc/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'template/admin/rsrc/main.js')
-rw-r--r--template/admin/rsrc/main.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/template/admin/rsrc/main.js b/template/admin/rsrc/main.js
index 5405b29..a93b8be 100644
--- a/template/admin/rsrc/main.js
+++ b/template/admin/rsrc/main.js
@@ -118,4 +118,36 @@ addEventListener("DOMContentLoaded", function() {
return confirm(e.target.getAttribute('data-text'));
};
}
+}, false);
+
+//==============================================================================
+// Emoticon listener
+//==============================================================================
+addEventListener("DOMContentLoaded", function() {
+ if(document.getElementById("emoticon-list")) {
+ var list = document.getElementById("emoticon-list");
+ var items = list.getElementsByTagName("li");
+
+ for(var i = 0; i < items.length; ++i) {
+ items[i].onmousedown = function(e) {
+ emoticonReplace(e.target.getAttribute('data-emoticon'));
+ };
+ }
+ }
+}, false);
+
+//==============================================================================
+// Markdown listener
+//==============================================================================
+addEventListener("DOMContentLoaded", function() {
+ if(document.getElementById("markdown-list")) {
+ var list = document.getElementById("markdown-list");
+ var items = list.getElementsByTagName("li");
+
+ for(var i = 0; i < items.length; ++i) {
+ items[i].onmousedown = function(e) {
+ markdownReplace(e.target.getAttribute('data-markdown'));
+ };
+ }
+ }
}, false); \ No newline at end of file