aboutsummaryrefslogtreecommitdiffstats
path: root/template/admin/rsrc
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-04-28 17:53:46 +0200
committerThomas Lange <code@nerdmind.de>2017-04-28 17:53:46 +0200
commit6471b7d21bf571b4f1da911a5440239d0f936574 (patch)
treed298ef87cee35bc34a36169afe3b49f4363167b8 /template/admin/rsrc
parent6c4f2a26233f7bef03ddf7ee9f59c95e88e1a601 (diff)
downloadblog-6471b7d21bf571b4f1da911a5440239d0f936574.tar.gz
blog-6471b7d21bf571b4f1da911a5440239d0f936574.tar.xz
blog-6471b7d21bf571b4f1da911a5440239d0f936574.zip
Inline javascript for emoticon and markdown replacement has been outsourced into the main.js file.
Diffstat (limited to 'template/admin/rsrc')
-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