From 78eb6dc42e73551c2bb9972e53a2d7dd3b81e7d7 Mon Sep 17 00:00:00 2001 From: CruiseDevice Date: Thu, 1 Oct 2020 14:59:18 +0530 Subject: Add tinymce to forum --- yaksh/static/yaksh/js/show_toc.js | 18 ++++++++++++++++++ yaksh/templates/yaksh/course_forum.html | 15 +++++++++++++++ yaksh/templates/yaksh/post_comments.html | 23 +++++++++++++++++++++-- yaksh/templates/yaksh/show_video.html | 3 ++- 4 files changed, 56 insertions(+), 3 deletions(-) (limited to 'yaksh') diff --git a/yaksh/static/yaksh/js/show_toc.js b/yaksh/static/yaksh/js/show_toc.js index b628eaa..7d9b68e 100644 --- a/yaksh/static/yaksh/js/show_toc.js +++ b/yaksh/static/yaksh/js/show_toc.js @@ -2,6 +2,24 @@ $(document).ready(function() { $('#sidebarCollapse').on('click', function () { $('#sidebar').toggleClass('active'); }); + + $(document).ready(() => { + $(function() { + tinymce.init({ + selector: 'textarea#id_description', + setup : function(ed) { + ed.on('change', function(e) { + tinymce.triggerSave(); + }); + }, + max_height: 400, + height: 400, + plugins: "image code link", + convert_urls: false + }); + }); + }); + player = new Plyr('#player'); var totalSeconds; store_video_time(contents_by_time); diff --git a/yaksh/templates/yaksh/course_forum.html b/yaksh/templates/yaksh/course_forum.html index fce58fe..acd6861 100644 --- a/yaksh/templates/yaksh/course_forum.html +++ b/yaksh/templates/yaksh/course_forum.html @@ -149,9 +149,24 @@ {% block script %} + {% endblock script %} \ No newline at end of file diff --git a/yaksh/templates/yaksh/post_comments.html b/yaksh/templates/yaksh/post_comments.html index 1480264..bc452e0 100644 --- a/yaksh/templates/yaksh/post_comments.html +++ b/yaksh/templates/yaksh/post_comments.html @@ -43,7 +43,7 @@
-

{{post.description}}

+

{{post.description|safe}}

{% if post.image %}
@@ -80,7 +80,7 @@ {{comment.created_at}} {% if user == course.creator %}
{% endif %}
-

{{comment.description}}

+

{{comment.description|safe}}

{% if comment.image %} @@ -97,4 +97,23 @@ {% endblock content %} {% block script %} + + {% endblock script %} \ No newline at end of file diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html index 0e16e37..6e3cabb 100644 --- a/yaksh/templates/yaksh/show_video.html +++ b/yaksh/templates/yaksh/show_video.html @@ -16,6 +16,7 @@ + {% endblock %} {% block css %} @@ -258,7 +259,7 @@ {{comment.created_at}} {% if user.profile.is_moderator %} {% endif %}
-

{{comment.description}}

+

{{comment.description|safe}}

{% if comment.image %} -- cgit