From 6471b7d21bf571b4f1da911a5440239d0f936574 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 28 Apr 2017 17:53:46 +0200 Subject: Inline javascript for emoticon and markdown replacement has been outsourced into the main.js file. --- template/admin/rsrc/main.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'template/admin/rsrc') 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 -- cgit v1.2.3