From cfcbe27f411893532612a0fb53b559c13e88d22b Mon Sep 17 00:00:00 2001 From: juliotoscano Date: Thu, 24 Nov 2016 08:05:51 -0300 Subject: [PATCH] js works #362 --- amadeus/staticfiles/js/modal_exam.js | 43 ------------------------------------------- exam/static/js/Exam.js | 25 ------------------------- exam/templates/exam/create.html | 27 +++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 68 deletions(-) delete mode 100644 amadeus/staticfiles/js/modal_exam.js diff --git a/amadeus/staticfiles/js/modal_exam.js b/amadeus/staticfiles/js/modal_exam.js deleted file mode 100644 index 794f98d..0000000 --- a/amadeus/staticfiles/js/modal_exam.js +++ /dev/null @@ -1,43 +0,0 @@ -//controles do modal -$(window).ready(function() { // utilizado para abrir o modal quando tiver tido algum erro no preenchimento do formulario - if($('.not_submited').length){ - $('#exam').modal('show'); - } -}); -var Answer = { - init: function(url) { // utilizado para adicionar um novo campo de resposta - $.get(url, function(data){ - $("#form").append(data); - var cont = 1; - $("#form div div div input").each(function(){ - $(this).attr('name',cont++); - }); - }); - } -}; - -var Submite = { - post: function(url,dados){ - $('#exam').modal('hide'); - $.post(url,dados, function(data){ - }).fail(function(data){ - $("div.modal-backdrop.fade.in").remove(); - $("#modal_exam").empty(); - $("#modal_exam").append(data.responseText); - }); - }, - remove: function(url,dados, id_li_link){ - $('#exam').modal('hide'); - $.post(url,dados, function(data){ - $(id_li_link).remove(); - $("#modal_exam").empty(); - $("div.modal-backdrop.fade.in").remove(); - }).fail(function(){ - $("#modal_exam").empty(); - $("#modal_exam").append(data); - $('#exam').modal('show'); - }); - } -} - -alert("essfd"); diff --git a/exam/static/js/Exam.js b/exam/static/js/Exam.js index 96ea05b..577d3ca 100644 --- a/exam/static/js/Exam.js +++ b/exam/static/js/Exam.js @@ -1,28 +1,3 @@ -//Insert Create select with question type - var idQuestionType = 1; - $("#addQuestion").on("click", function(event){ - var element = - '
' + - '' + '
' + - '' + - '
' + - '
' + '
' - ; - if (idQuestionType == 1){ - $(element).insertAfter('#buttonAddQuestion'); - }else{ - var idhr = '#hr_'+(idQuestionType-1); - $(element).insertAfter(idhr); - } - idQuestionType++; - }) //Insert question choice function showDiv (elem, questionType_id) { diff --git a/exam/templates/exam/create.html b/exam/templates/exam/create.html index f999106..95d1b26 100644 --- a/exam/templates/exam/create.html +++ b/exam/templates/exam/create.html @@ -55,6 +55,33 @@ {% block javascript %} + -- libgit2 0.21.2