summaryrefslogtreecommitdiff
path: root/yaksh/static
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/static')
-rw-r--r--yaksh/static/yaksh/js/course.js31
-rw-r--r--yaksh/static/yaksh/js/requesthandler.js8
-rw-r--r--yaksh/static/yaksh/js/show_question.js14
3 files changed, 49 insertions, 4 deletions
diff --git a/yaksh/static/yaksh/js/course.js b/yaksh/static/yaksh/js/course.js
index 5b79e68..8fb2773 100644
--- a/yaksh/static/yaksh/js/course.js
+++ b/yaksh/static/yaksh/js/course.js
@@ -35,4 +35,35 @@ $(".reject").change( function(){
});
}
});
+
+$(function() {
+ $('textarea#email_body').froalaEditor({
+ heightMin: 200,
+ heightMax: 200
+ })
+ });
+
+$("#send_mail").click(function(){
+ var subject = $("#subject").val();
+ var body = $('#email_body').val();
+ var status = false;
+ var selected = [];
+ $('#reject input:checked').each(function() {
+ selected.push($(this).attr('value'));
+ });
+
+ if (subject == '' || body == ''){
+ $("#error_msg").html("Please enter mail details");
+ $("#dialog").dialog();
+ }
+ else if (selected.length == 0){
+ $("#error_msg").html("Please select atleast one user");
+ $("#dialog").dialog();
+ }
+ else {
+ status = true;
+ }
+ return status;
+});
+
});
diff --git a/yaksh/static/yaksh/js/requesthandler.js b/yaksh/static/yaksh/js/requesthandler.js
index c5629ab..9890b54 100644
--- a/yaksh/static/yaksh/js/requesthandler.js
+++ b/yaksh/static/yaksh/js/requesthandler.js
@@ -53,13 +53,13 @@ function get_result(uid){
dataType: "html", // Your server can response html, json, xml format.
success: function(data, status, xhr) {
content_type = xhr.getResponseHeader("content-type");
- if(content_type.includes("text/html")) {
+ if(content_type.indexOf("text/html") !== -1) {
clearInterval(checker);
unlock_screen();
document.open();
document.write(data);
document.close();
- } else if(content_type.includes("application/json")) {
+ } else if(content_type.indexOf("application/json") !== -1) {
res = JSON.parse(data);
request_status = res.status;
check_state(request_status, uid);
@@ -125,7 +125,7 @@ $(document).ready(function(){
dataType: "html", // Your server can response html, json, xml format.
success: function(data, status, xhr) {
content_type = xhr.getResponseHeader("content-type");
- if(content_type.includes("text/html")) {
+ if(content_type.indexOf("text/html") !== -1) {
request_status = "initial"
count = 0;
clearInterval(checker);
@@ -133,7 +133,7 @@ $(document).ready(function(){
document.open();
document.write(data);
document.close();
- } else if(content_type.includes("application/json")) {
+ } else if(content_type.indexOf("application/json") !== -1) {
res = JSON.parse(data);
var uid = res.uid;
request_status = res.state;
diff --git a/yaksh/static/yaksh/js/show_question.js b/yaksh/static/yaksh/js/show_question.js
index e3ed1cc..e6825a0 100644
--- a/yaksh/static/yaksh/js/show_question.js
+++ b/yaksh/static/yaksh/js/show_question.js
@@ -37,3 +37,17 @@ function confirm_edit(frm)
else
return true;
}
+
+function append_tag(tag){
+ var tag_name = document.getElementById("question_tags");
+ if (tag_name.value != null){
+ tag_name.value = tag.value+", "+tag_name.value;
+ }
+ else{
+ tag_name.value = tag.value;
+ }
+}
+$(document).ready(function()
+ {
+ $("#questions-table").tablesorter({sortList: [[0,0], [4,0]]});
+ });