add MarkItUp editor for textareas with markup support
This commit is contained in:
parent
b11436b913
commit
7e7f9edff3
64 changed files with 1353 additions and 176 deletions
|
|
@ -99,6 +99,9 @@
|
|||
</p>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$("#text").markItUp(mySettings);
|
||||
});
|
||||
var listIndex = <?=count($choiceLists)?>;
|
||||
var choiceIndices = new Array(<?=count($choiceLists)?>);
|
||||
<?php foreach($choiceLists as $index => &$list) : ?>
|
||||
|
|
|
|||
|
|
@ -33,6 +33,11 @@
|
|||
<li id="question-<?=$questionIndex?>">
|
||||
<?=_('Question')?>:
|
||||
<textarea id="question-<?=$questionIndex?>-question" name="questions[<?=$questionIndex?>][question]"><?=$question['question']?></textarea>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#question-<?=$questionIndex?>-question").markItUp(mySettings);
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php if(!empty($validations) && array_key_exists($questionIndex, $validations) && !empty($validations[$questionIndex]) && $validations[$questionIndex]['answers'] !== true) : ?>
|
||||
<ul>
|
||||
|
|
@ -85,7 +90,7 @@
|
|||
<?php foreach($questions as $index => &$question) : ?>
|
||||
answerIndices[<?=$index?>] = <?=count($question['answers'])?>;
|
||||
<?php endforeach?>
|
||||
var questionElement = '<?=_('Question')?>: <textarea name="questions[QUESTIONINDEX][question]"></textarea>' +
|
||||
var questionElement = '<?=_('Question')?>: <textarea id="questions-QUESTIONINDEX-question" name="questions[QUESTIONINDEX][question]"></textarea>' +
|
||||
'<ul><li><button class="add-answer" type="button">+</button></li></ul>' +
|
||||
'<button class="remove-question" type="button"><?=_('Remove question')?></button>';
|
||||
var answerElement = '<input id="question-QUESTIONINDEX-answer-ANSWERINDEX-tick" type="checkbox" name="questions[QUESTIONINDEX][answers][ANSWERINDEX][tick]" />' +
|
||||
|
|
@ -109,6 +114,7 @@
|
|||
$("#question-"+questionIndex+" .remove-question").click(removeQuestion);
|
||||
$("#question-"+questionIndex+" .add-answer").click(addAnswer);
|
||||
$("#question-"+questionIndex+" .remove-answer").click(removeAnswer);
|
||||
$("#questions-"+questionIndex+"-question").markItUp(mySettings);
|
||||
|
||||
questionIndex++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@
|
|||
</p>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$("#text").markItUp(mySettings);
|
||||
});
|
||||
var index = <?=count($fields)?>;
|
||||
var selectElement = '<select name="fields[INDEX][size]">' +
|
||||
<?php foreach($fieldSizes as &$size) : ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue