From d6fe6e10d13631998135c825e1f0cba3f3ffeb61 Mon Sep 17 00:00:00 2001
From: CruiseDevice
Date: Fri, 25 Sep 2020 00:26:39 +0530
Subject: Add TinyMCE, fix minor progressbar issues
---
yaksh/static/yaksh/js/add_course.js | 16 ++++++++
yaksh/static/yaksh/js/add_grades.js | 14 +++++++
yaksh/static/yaksh/js/add_quiz.js | 13 +++++-
yaksh/static/yaksh/js/lesson.js | 14 +++++++
yaksh/templates/yaksh/add_course.html | 2 +
yaksh/templates/yaksh/add_lesson.html | 4 +-
yaksh/templates/yaksh/add_module.html | 20 ++++-----
yaksh/templates/yaksh/add_quiz.html | 1 +
yaksh/templates/yaksh/user_status.html | 75 +++++++++++++++++++++++++++-------
9 files changed, 131 insertions(+), 28 deletions(-)
create mode 100644 yaksh/static/yaksh/js/add_course.js
create mode 100644 yaksh/static/yaksh/js/add_grades.js
(limited to 'yaksh')
diff --git a/yaksh/static/yaksh/js/add_course.js b/yaksh/static/yaksh/js/add_course.js
new file mode 100644
index 0000000..0fba2e9
--- /dev/null
+++ b/yaksh/static/yaksh/js/add_course.js
@@ -0,0 +1,16 @@
+$(document).ready(function () {
+ $(function() {
+ tinymce.init({
+ selector: 'textarea#id_instructions',
+ setup : function(ed) {
+ ed.on('change', function(e) {
+ tinymce.triggerSave();
+ });
+ },
+ max_height: 400,
+ height: 400,
+ plugins: "image code link",
+ convert_urls: false
+ });
+ });
+});
diff --git a/yaksh/static/yaksh/js/add_grades.js b/yaksh/static/yaksh/js/add_grades.js
new file mode 100644
index 0000000..151fef1
--- /dev/null
+++ b/yaksh/static/yaksh/js/add_grades.js
@@ -0,0 +1,14 @@
+$(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
+ });
+ });
diff --git a/yaksh/static/yaksh/js/add_quiz.js b/yaksh/static/yaksh/js/add_quiz.js
index dab5a3d..38a9dc8 100644
--- a/yaksh/static/yaksh/js/add_quiz.js
+++ b/yaksh/static/yaksh/js/add_quiz.js
@@ -1,6 +1,5 @@
function test()
{
-
document.getElementById('id_duration').setAttribute('class','mini-text form-control');
document.getElementById('id_pass_criteria').setAttribute('class','mini-text form-control');
if (document.getElementById("id_description").value != "")
@@ -13,6 +12,18 @@ function test()
document.getElementById('rendered_text').innerHTML = document.getElementById('id_instructions').value ;
});
document.getElementById('rendered_text').innerHTML = document.getElementById('id_instructions').value ;
+ tinymce.init({
+ selector: 'textarea#id_instructions',
+ setup : function(ed) {
+ ed.on('change', function(e) {
+ tinymce.triggerSave();
+ });
+ },
+ max_height: 400,
+ height: 400,
+ plugins: "image code link",
+ convert_urls: false
+ });
}
String.prototype.beginsWith = function (string) {
diff --git a/yaksh/static/yaksh/js/lesson.js b/yaksh/static/yaksh/js/lesson.js
index 6eaf6c6..23446dc 100644
--- a/yaksh/static/yaksh/js/lesson.js
+++ b/yaksh/static/yaksh/js/lesson.js
@@ -90,4 +90,18 @@ $(document).ready(function(){
}
$(this).next('.custom-file-label').html(files.join(', '));
});
+ $(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
+ });
+ });
});
diff --git a/yaksh/templates/yaksh/add_course.html b/yaksh/templates/yaksh/add_course.html
index 0072a95..07ac81b 100644
--- a/yaksh/templates/yaksh/add_course.html
+++ b/yaksh/templates/yaksh/add_course.html
@@ -6,8 +6,10 @@
{% endblock %}
{% block script %}
+
+
{% endblock %}
{% block title %} Add Course {% endblock %}
{% block pagetitle %} Add Course {% endblock %}
diff --git a/yaksh/templates/yaksh/add_lesson.html b/yaksh/templates/yaksh/add_lesson.html
index 4211b1b..49675f2 100644
--- a/yaksh/templates/yaksh/add_lesson.html
+++ b/yaksh/templates/yaksh/add_lesson.html
@@ -9,8 +9,10 @@
+
+
{% endblock %}
{% block css %}
@@ -155,4 +157,4 @@
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/yaksh/templates/yaksh/add_module.html b/yaksh/templates/yaksh/add_module.html
index 7112485..a4d1d35 100644
--- a/yaksh/templates/yaksh/add_module.html
+++ b/yaksh/templates/yaksh/add_module.html
@@ -1,18 +1,16 @@
{% extends "manage.html" %}
{% load static %}
-{% block title %}Create/Edit Learning Module{% endblock %}
+{% block title %}
+ Create/Edit Learning Module
+{% endblock %}
{% block script %}
-
-
-
-
-
+
+
+
+
+
+
{% endblock %}
{% block css %}
diff --git a/yaksh/templates/yaksh/add_quiz.html b/yaksh/templates/yaksh/add_quiz.html
index 9b80e0d..7918858 100644
--- a/yaksh/templates/yaksh/add_quiz.html
+++ b/yaksh/templates/yaksh/add_quiz.html
@@ -12,6 +12,7 @@
{% block script %}
+