add MarkItUp editor for textareas with markup support

This commit is contained in:
oliver 2015-07-27 15:02:32 +02:00
parent b11436b913
commit 7e7f9edff3
64 changed files with 1353 additions and 176 deletions

View file

@ -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) : ?>

View file

@ -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++;
}

View file

@ -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) : ?>

View file

@ -89,3 +89,11 @@
</fieldset>
<input type="submit" name="edit" value="<?=_('edit')?>" />
</form>
<script>
$(function() {
$("#description").markItUp(mySettings);
$("#rules").markItUp(mySettings);
$("#wonText").markItUp(mySettings);
$("#lostText").markItUp(mySettings);
});
</script>

View file

@ -39,23 +39,23 @@
<section>
<h1><i class="fa fa-envelope fa-fw"></i><?=_('Description')?></h1>
<p><?=\hhu\z\Utils::t($quest['description'])?></p>
<p><?=$t->t($quest['description'])?></p>
<?php if(!empty($quest['rules'])) : ?>
<h1><i class="fa fa-exclamation-triangle fa-fw"></i><?=_('Rules')?></h1>
<p><?=\hhu\z\Utils::t($quest['rules'])?></p>
<p><?=$t->t($quest['rules'])?></p>
<?php endif ?>
</section>
<?php if(!empty($quest['won_text'])) : ?>
<section>
<h1><i class="fa fa-thumbs-up fa-fw"></i><?=_('Won Quest')?></h1>
<p><?=\hhu\z\Utils::t($quest['won_text'])?></p>
<p><?=$t->t($quest['won_text'])?></p>
</section>
<?php endif ?>
<?php if(!empty($quest['lost_text'])) : ?>
<section>
<h1><i class="fa fa-thumbs-down fa-fw"></i><?=_('Lost Quest')?></h1>
<p><?=\hhu\z\Utils::t($quest['lost_text'])?></p>
<p><?=$t->t($quest['lost_text'])?></p>
</section>
<?php endif ?>

View file

@ -3,10 +3,15 @@
<head>
<meta charset="utf-8" />
<title><?=(isset($title)) ? $title : \nre\configs\AppConfig::$app['name']?></title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="description" content="">
<meta name="robots" content="noindex,follow">
<title><?=(isset($title)) ? $title : \nre\configs\AppConfig::$app['name']?></title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('markitup','skins','markitup','style.css'))?>" media="all" />
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('markitup','sets','textile','style.css'))?>" media="all" />
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('css','desktop.css'))?>" media="all" />
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('css','ol.css'))?>" media="all" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
@ -37,12 +42,9 @@
<script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
<![endif]-->
<script type="text/javascript" src="<?=$linker->link(array('js','misc.js'))?>"></script>
<script type="text/javascript" src="<?=$linker->link(array('js','notification.js'))?>"></script>
<script type="text/javascript" src="<?=$linker->link(array('js','dnd.js'))?>"></script>
<meta name="description" content="">
<meta name="robots" content="noindex,follow">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<script type="text/javascript" src="<?=$linker->link(array('markitup','jquery.markitup.js'))?>"></script>
<script type="text/javascript" src="<?=$linker->link(array('markitup','sets','textile','set.js'))?>"></script>
<script type="text/javascript" src="<?=$linker->link(array('js','scripts.js'))?>"></script>
</head>
<body>

View file

@ -13,15 +13,25 @@
<ul class="admnql">
<?php foreach($questgrouptexts as &$text) : ?>
<li class="cf">
<textarea name="questgrouptexts[<?=$text['id']?>]"><?=$text['text']?></textarea><br />
<textarea id="questgrouptexts-<?=$text['id']?>" name="questgrouptexts[<?=$text['id']?>]"><?=$text['text']?></textarea><br />
<input id="deletes[<?=$text['id']?>]" type="checkbox" name="deletes[<?=$text['id']?>]" />
<label for="deletes[<?=$text['id']?>]"><?=_('delete')?></label>
<script>
$(function() {
$("#questgrouptexts-<?=$text['id']?>").markItUp(mySettings);
});
</script>
</li>
<?php endforeach ?>
<li class="cf">
<textarea name="questgrouptexts[]" placeholder="<?=_('New Questgroup text')?>"></textarea>
<textarea id="questgrouptexts-new" name="questgrouptexts[]" placeholder="<?=_('New Questgroup text')?>"></textarea>
</li>
</ul>
</fieldset>
<input type="submit" name="edit" value="<?=_('edit')?>" />
</form>
<script>
$(function() {
$("#questgrouptexts-new").markItUp(mySettings);
});
</script>

View file

@ -28,7 +28,7 @@
<?php if(count($texts) > 0): ?>
<div class="qtextbox">
<?php foreach($texts as &$text) : ?>
<p class="qtext"><?=\hhu\z\Utils::t($text['text'])?></p>
<p class="qtext"><?=$t->t($text['text'])?></p>
<?php endforeach ?>
</div>
<?php endif ?>

View file

@ -1,6 +1,6 @@
<?php if(!is_null($questgroup['picture'])) : ?>
<div class="moodpic">
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$questgroup['picture']['url']))?>" />
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$questgroup['picture']['url']))?>" />
</div>
<?php else : ?>
<?=$moodpic?>
@ -10,108 +10,115 @@
<h1><?=_('Edit Quest')?></h1>
<?php if($validation !== true && !empty($validation)) : ?>
<ul class="validation">
<?php foreach($validation as $field => &$settings) : ?>
<li>
<ul>
<?php foreach($settings as $setting => $value) : ?>
<li>
<?php switch($field) {
case 'media':
switch($setting) {
case 'error': printf(_('Error during picture upload: %s'), $value);
break;
case 'mimetype': printf(_('Picture has wrong type “%s”'), $value);
break;
case 'size': echo _('Picture exceeds size maximum');
break;
default: echo _('Picture invalid');
}
break;
case 'title':
switch($setting) {
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
break;
case 'regex': echo _('Title contains illegal characters');
break;
case 'exist': echo _('Title already exists');
break;
default: echo _('Title invalid');
}
break;
case 'xps':
switch($setting) {
case 'minlength': printf(_('XPs not set'), $value);
break;
case 'regex': echo _('XPs contain illegal characters');
break;
default: echo _('XPs invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
<?php foreach($validation as $field => &$settings) : ?>
<li>
<ul>
<?php foreach($settings as $setting => $value) : ?>
<li>
<?php switch($field) {
case 'media':
switch($setting) {
case 'error': printf(_('Error during picture upload: %s'), $value);
break;
case 'mimetype': printf(_('Picture has wrong type “%s”'), $value);
break;
case 'size': echo _('Picture exceeds size maximum');
break;
default: echo _('Picture invalid');
}
break;
case 'title':
switch($setting) {
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
break;
case 'regex': echo _('Title contains illegal characters');
break;
case 'exist': echo _('Title already exists');
break;
default: echo _('Title invalid');
}
break;
case 'xps':
switch($setting) {
case 'minlength': printf(_('XPs not set'), $value);
break;
case 'regex': echo _('XPs contain illegal characters');
break;
default: echo _('XPs invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" enctype="multipart/form-data">
<fieldset>
<?php if(!is_null($media)) : ?>
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>"><img style="width:10em; display:block;" src="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>" /></a>
<?php endif ?>
<legend><?=_('Picture')?></legend>
<input type="file" name="media" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" />
<p><?=_('Allowed file types')?>:</p>
<ul>
<?php foreach($mimetypes as &$mimetype) : ?>
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?>MiB)<?php endif ?></li>
<?php endforeach ?>
</ul>
</fieldset>
<fieldset>
<label for="title"><?=_('Title')?>:</label>
<input id="title" type="text" name="title" value="<?=$title?>" placeholder="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="xps"><?=_('XPs')?>:</label>
<input id="xps" type="number" name="xps" placeholder="<?=_('XPs')?>" title="<?=_('XPs')?>" pattern="<?=substr($validationSettings['xps']['regex'],1,strrpos($validationSettings['xps']['regex'],$validationSettings['xps']['regex'][0])-1)?>" value="<?=$xps?>" <?=(array_key_exists('xps', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="questtype"><?=('Questtype')?>:</label>
<select id="questtype" name="questtype">
<?php foreach($questtypes as &$questtype) : ?>
<option value="<?=$questtype['url']?>" <?php if($questtype['selected']) : ?>selected="selected"<?php endif ?>>
<?php switch($questtype['classname']) {
case null: echo _('Questtype Empty');
break;
case 'bossfight': echo _('Questtype bossfight');
break;
case 'choiceinput': echo _('Questtype choiceinput');
break;
case 'crossword': echo _('Questtype crossword');
break;
case 'dragndrop': echo _('Questtype dragndrop');
break;
case 'multiplechoice': echo _('Questtype multiplechoice');
break;
case 'submit': echo _('Questtype submit');
break;
case 'textinput': echo _('Questtype textinput');
break;
} ?>
</option>
<?php endforeach ?>
</select>
</fieldset>
<fieldset>
<label for="entrytext"><?=('Entry text')?>:</label><br />
<textarea name="entrytext" placeholder="<?=_('Entry text')?>" style="width:100%; height:10em;"><?=$entryText?></textarea><br />
<label for="task"><?=_('Task')?>:</label><br />
<textarea name="task" placeholder="<?=('Task')?>" style="width:100%; height:10em;"><?=$task?></textarea><br />
<label for="wrongtext"><?=('Wrong text')?>:</label><br />
<textarea name="wrongtext" placeholder="<?=_('Wrong text')?>" style="width:100%; height:10em;"><?=$wrongText?></textarea><br />
</fieldset>
<?php if(!is_null($quest['type']['classname'])) : ?>
<input type="submit" name="edit-task" value="<?=_('edit task')?>" />
<?php endif ?>
<input type="submit" name="edit" value="<?=_('save')?>" />
<fieldset>
<?php if(!is_null($media)) : ?>
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>"><img style="width:10em; display:block;" src="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>" /></a>
<?php endif ?>
<legend><?=_('Picture')?></legend>
<input type="file" name="media" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" />
<p><?=_('Allowed file types')?>:</p>
<ul>
<?php foreach($mimetypes as &$mimetype) : ?>
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?>MiB)<?php endif ?></li>
<?php endforeach ?>
</ul>
</fieldset>
<fieldset>
<label for="title"><?=_('Title')?>:</label>
<input id="title" type="text" name="title" value="<?=$title?>" placeholder="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="xps"><?=_('XPs')?>:</label>
<input id="xps" type="number" name="xps" placeholder="<?=_('XPs')?>" title="<?=_('XPs')?>" pattern="<?=substr($validationSettings['xps']['regex'],1,strrpos($validationSettings['xps']['regex'],$validationSettings['xps']['regex'][0])-1)?>" value="<?=$xps?>" <?=(array_key_exists('xps', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="questtype"><?=('Questtype')?>:</label>
<select id="questtype" name="questtype">
<?php foreach($questtypes as &$questtype) : ?>
<option value="<?=$questtype['url']?>" <?php if($questtype['selected']) : ?>selected="selected"<?php endif ?>>
<?php switch($questtype['classname']) {
case null: echo _('Questtype Empty');
break;
case 'bossfight': echo _('Questtype bossfight');
break;
case 'choiceinput': echo _('Questtype choiceinput');
break;
case 'crossword': echo _('Questtype crossword');
break;
case 'dragndrop': echo _('Questtype dragndrop');
break;
case 'multiplechoice': echo _('Questtype multiplechoice');
break;
case 'submit': echo _('Questtype submit');
break;
case 'textinput': echo _('Questtype textinput');
break;
} ?>
</option>
<?php endforeach ?>
</select>
</fieldset>
<fieldset>
<label for="entrytext"><?=('Entry text')?>:</label><br />
<textarea id="entrytext" name="entrytext" placeholder="<?=_('Entry text')?>"><?=$entryText?></textarea><br />
<label for="task"><?=_('Task')?>:</label><br />
<textarea id="task" name="task" placeholder="<?=('Task')?>"><?=$task?></textarea><br />
<label for="wrongtext"><?=('Wrong text')?>:</label><br />
<textarea id="wrongtext" name="wrongtext" placeholder="<?=_('Wrong text')?>"><?=$wrongText?></textarea><br />
</fieldset>
<?php if(!is_null($quest['type']['classname'])) : ?>
<input type="submit" name="edit-task" value="<?=_('edit task')?>" />
<?php endif ?>
<input type="submit" name="edit" value="<?=_('save')?>" />
</form>
<script>
$(function() {
$("#entrytext").markItUp(mySettings);
$("#task").markItUp(mySettings);
$("#wrongtext").markItUp(mySettings);
});
</script>

View file

@ -1,6 +1,6 @@
<?php if(!is_null($questgroup['picture'])) : ?>
<div class="moodpic">
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$questgroup['picture']['url']))?>" />
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$questgroup['picture']['url']))?>" />
</div>
<?php else : ?>
<?=$moodpic?>
@ -9,58 +9,71 @@
<h1><?=_('Edit Quest texts')?></h1>
<form method="post" enctype="multipart/form-data">
<?php foreach($questtexttypes as &$type) : ?>
<fieldset>
<legend><?=$type['type']?></legend>
<?php if(array_key_exists($type['url'], $validations)) : ?>
<ul class="validation">
<?php foreach($validations[$type['url']] as $textId => &$validation) : ?>
<?php if($validation !== true) : ?>
<?php foreach($validation as $field => &$settings) : ?>
<li>
<ul>
<?php foreach($settings as $setting => $value) : ?>
<li>
<?php switch($field) {
case 'media':
switch($setting) {
case 'error': printf(_('Error during picture upload: %s'), $value);
break;
case 'mimetype': printf(_('Picture has wrong type “%s”'), $value);
break;
case 'size': echo _('Picture exceeds size maximum');
break;
default: echo _('Picture invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
<?php endif ?>
<?php endforeach ?>
</ul>
<?php endif ?>
<ul class="admnql">
<?php foreach($type['texts'] as &$text) : ?>
<li class="cf">
<?php if(array_key_exists('media', $text)) : ?>
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$text['media']['url']))?>"><img src="<?=$linker->link(array('media','seminary',$seminary['url'],$text['media']['url']))?>" /></a><br />
<?php endif ?>
<input type="file" name="media[<?=$type['url']?>][<?=$text['id']?>]" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" /><br />
<textarea name="questtexts[<?=$type['url']?>][<?=$text['id']?>]"><?=$text['text']?></textarea><br />
<input id="deletes[<?=$type['url']?>][<?=$text['id']?>]" type="checkbox" name="deletes[<?=$type['url']?>][<?=$text['id']?>]" />
<label for="deletes[<?=$type['url']?>][<?=$text['id']?>]"><?=_('delete')?></label>
</li>
<?php endforeach ?>
<li class="cf">
<input type="file" name="media[<?=$type['url']?>][new]" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" /><br />
<textarea name="questtexts[<?=$type['url']?>][new]" placeholder="<?=_('New Questgroup text')?>"></textarea>
</li>
</ul>
</fieldset>
<?php endforeach ?>
<input type="submit" name="edit" value="<?=_('edit')?>" />
<?php foreach($questtexttypes as &$type) : ?>
<fieldset>
<legend><?=$type['type']?></legend>
<?php if(array_key_exists($type['url'], $validations) && $validations[$type['url']] !== true) : ?>
<ul class="validation">
<?php foreach($validations[$type['url']] as $textId => &$validation) : ?>
<?php if($validation !== true) : ?>
<?php foreach($validation as $field => &$settings) : ?>
<li>
<ul>
<?php foreach($settings as $setting => $value) : ?>
<li>
<?php switch($field) {
case 'media':
switch($setting) {
case 'error': printf(_('Error during picture upload: %s'), $value);
break;
case 'mimetype': printf(_('Picture has wrong type “%s”'), $value);
break;
case 'size': echo _('Picture exceeds size maximum');
break;
default: echo _('Picture invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
<?php endif ?>
<?php endforeach ?>
</ul>
<?php endif ?>
<ul class="admnql">
<?php foreach($type['texts'] as &$text) : ?>
<li class="cf">
<?php if(array_key_exists('media', $text)) : ?>
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$text['media']['url']))?>"><img src="<?=$linker->link(array('media','seminary',$seminary['url'],$text['media']['url']))?>" /></a><br />
<?php else : ?>
<i class="placeholder fa fa-picture-o fa-4x"></i><br />
<?php endif ?>
<input type="file" name="media[<?=$type['url']?>][<?=$text['id']?>]" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" />
<textarea id="questtexts-<?=$type['url']?>-<?=$text['id']?>" name="questtexts[<?=$type['url']?>][<?=$text['id']?>]"><?=$text['text']?></textarea><br />
<input id="deletes[<?=$type['url']?>][<?=$text['id']?>]" type="checkbox" name="deletes[<?=$type['url']?>][<?=$text['id']?>]" />
<label for="deletes[<?=$type['url']?>][<?=$text['id']?>]"><?=_('delete text')?></label>
<script>
$(function() {
$("#questtexts-<?=$type['url']?>-<?=$text['id']?>").markItUp(mySettings);
});
</script>
</li>
<?php endforeach ?>
<li class="cf">
<i class="placeholder fa fa-picture-o fa-4x"></i><br />
<input type="file" name="media[<?=$type['url']?>][new]" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" /><br />
<textarea id="questtexts-<?=$type['url']?>-new" name="questtexts[<?=$type['url']?>][new]" placeholder="<?=_('New Questgroup text')?>"></textarea>
<script>
$(function() {
$("#questtexts-<?=$type['url']?>-new").markItUp(mySettings);
});
</script>
</li>
</ul>
</fieldset>
<?php endforeach ?>
<input type="submit" name="edit" value="<?=_('save')?>" />
</form>

View file

@ -30,7 +30,7 @@
<?php $mediaShown = true; ?>
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>"><img src="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>" /></a>
<?php endif ?>
<?=\hhu\z\Utils::t($questtext['text'])?>
<?=$t->t($questtext['text'])?>
</p>
<?php if(count($questtext['relatedQuestsgroups']) > 0 || !empty($questtext['abort_text'])) : ?>
<ul>
@ -59,7 +59,7 @@
<?php elseif($queststatus == 'unsolved') : ?>
<div class="error">
<p class="fwb"><i class="fa fa-times-circle fa-fw"></i><?=_('unsolved')?></p>
<p><small><?=\hhu\z\Utils::t($quest['wrong_text'])?></small></p>
<p><small><?=$t->t($quest['wrong_text'])?></small></p>
</div>
<?php endif ?>
<?php endif ?>
@ -93,7 +93,7 @@
<?php if(array_key_exists('media', $questtext)) : ?>
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$questtext['media']['url']))?>"><img src="<?=$linker->link(array('media','seminary',$seminary['url'],$questtext['media']['url']))?>" /></a>
<?php endif ?>
<?=\hhu\z\Utils::t($questtext['text'])?>
<?=$t->t($questtext['text'])?>
</p>
<?php if(count($questtext['relatedQuestsgroups']) > 0 || !empty($questtext['abort_text'])) : ?>
<ul>

View file

@ -61,6 +61,8 @@ a:hover{color:#62c5cd}
.fa{padding:0 10px 0 0}
.fwb{font-weight:700}
.placeholder{float:left}
header{background:#0f373c;margin-bottom:19px;position:fixed;width:100%;z-index:99}
header nav{z-index:99;margin:0 5%}
@ -149,12 +151,12 @@ input[type="submit"][disabled]{text-shadow:1px 2px #d48c4e;background:#f9ac69;bo
.admnql .chrflds:after{content:", "}
.admnql .chrflds:last-child:after{content: ""}
.admnql input{float:left;margin:6px 10px 0 0}
.admnql input[type="file"]{float:none;margin:0}
.admnqf label{margin:10px 0 5px}
.admnqf select{font-size:0.875em}
.task img{max-width:100%}
.task strong{font-style:italic;font-weight:400}
.task table{max-width:800px}
.task td{background:#fff;padding:1px 5px;border:1px solid #d7d4cf}
.task table option{font-size:0.675em}
@ -333,6 +335,8 @@ input[type="submit"][disabled]{text-shadow:1px 2px #d48c4e;background:#f9ac69;bo
.mchoice li{margin:0 0 10px 0}
.mchoice input[type=checkbox]{display:inline-block;margin:-19px 10px 0 24px;vertical-align:top}
.mchoice label{width:90%;display:inline-block;margin:-25px 0 0 0;vertical-align:top}
#questions{list-style-type:numeric}
#questions > li{margin-left:15px}
.submit{padding:15px;background:#eae8e4;border-radius:3px;margin-bottom:15px}
.submit p{margin:15px 0 0 0;font-weight:bold}
@ -367,6 +371,15 @@ input[type="submit"][disabled]{text-shadow:1px 2px #d48c4e;background:#f9ac69;bo
#drags > li{list-style-type:initial;margin:10px 0 10px 30px}
/** MarkItUp **/
.markItUp{width:100%;border:none}
.markItUp textarea{width:100%;height:150px;box-sizing:border-box}
.markItUpHeader li{padding:0;margin:0}
.markItUpContainer{border:none;background:white}
.markItUpEditor{padding-left:5px;border:none;background-position:-25px 0}
/** Media Queries **/
@media only screen and (min-width:480px){
@ -457,6 +470,8 @@ article{background:#f7f5f2;float:left}
.moodpic{width:880px;height:230px}
.moodpic img{width:100%}
.breadcrumbs{margin-top:0}
.logreg textarea{height:250px}
.markItUp textarea{height:250px}
}
@media only screen and (min-width:1600px){

View file

@ -0,0 +1,665 @@
// ----------------------------------------------------------------------------
// markItUp! Universal MarkUp Engine, JQuery plugin
// v 1.1.x
// Dual licensed under the MIT and GPL licenses.
// ----------------------------------------------------------------------------
// Copyright (C) 2007-2012 Jay Salvat
// http://markitup.jaysalvat.com/
// ----------------------------------------------------------------------------
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ----------------------------------------------------------------------------
(function($) {
$.fn.markItUp = function(settings, extraSettings) {
var method, params, options, ctrlKey, shiftKey, altKey; ctrlKey = shiftKey = altKey = false;
if (typeof settings == 'string') {
method = settings;
params = extraSettings;
}
options = { id: '',
nameSpace: '',
root: '',
previewHandler: false,
previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes'
previewInElement: '',
previewAutoRefresh: true,
previewPosition: 'after',
previewTemplatePath: '~/templates/preview.html',
previewParser: false,
previewParserPath: '',
previewParserVar: 'data',
resizeHandle: true,
beforeInsert: '',
afterInsert: '',
onEnter: {},
onShiftEnter: {},
onCtrlEnter: {},
onTab: {},
markupSet: [ { /* set */ } ]
};
$.extend(options, settings, extraSettings);
// compute markItUp! path
if (!options.root) {
$('script').each(function(a, tag) {
miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/);
if (miuScript !== null) {
options.root = miuScript[1];
}
});
}
// Quick patch to keep compatibility with jQuery 1.9
var uaMatch = function(ua) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];
return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
var matched = uaMatch( navigator.userAgent );
var browser = {};
if (matched.browser) {
browser[matched.browser] = true;
browser.version = matched.version;
}
if (browser.chrome) {
browser.webkit = true;
} else if (browser.webkit) {
browser.safari = true;
}
return this.each(function() {
var $$, textarea, levels, scrollPosition, caretPosition, caretOffset,
clicked, hash, header, footer, previewWindow, template, iFrame, abort;
$$ = $(this);
textarea = this;
levels = [];
abort = false;
scrollPosition = caretPosition = 0;
caretOffset = -1;
options.previewParserPath = localize(options.previewParserPath);
options.previewTemplatePath = localize(options.previewTemplatePath);
if (method) {
switch(method) {
case 'remove':
remove();
break;
case 'insert':
markup(params);
break;
default:
$.error('Method ' + method + ' does not exist on jQuery.markItUp');
}
return;
}
// apply the computed path to ~/
function localize(data, inText) {
if (inText) {
return data.replace(/("|')~\//g, "$1"+options.root);
}
return data.replace(/^~\//, options.root);
}
// init and build editor
function init() {
id = ''; nameSpace = '';
if (options.id) {
id = 'id="'+options.id+'"';
} else if ($$.attr("id")) {
id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"';
}
if (options.nameSpace) {
nameSpace = 'class="'+options.nameSpace+'"';
}
$$.wrap('<div '+nameSpace+'></div>');
$$.wrap('<div '+id+' class="markItUp"></div>');
$$.wrap('<div class="markItUpContainer"></div>');
$$.addClass("markItUpEditor");
// add the header before the textarea
header = $('<div class="markItUpHeader"></div>').insertBefore($$);
$(dropMenus(options.markupSet)).appendTo(header);
// add the footer after the textarea
footer = $('<div class="markItUpFooter"></div>').insertAfter($$);
// add the resize handle after textarea
if (options.resizeHandle === true && browser.safari !== true) {
resizeHandle = $('<div class="markItUpResizeHandle"></div>')
.insertAfter($$)
.bind("mousedown.markItUp", function(e) {
var h = $$.height(), y = e.clientY, mouseMove, mouseUp;
mouseMove = function(e) {
$$.css("height", Math.max(20, e.clientY+h-y)+"px");
return false;
};
mouseUp = function(e) {
$("html").unbind("mousemove.markItUp", mouseMove).unbind("mouseup.markItUp", mouseUp);
return false;
};
$("html").bind("mousemove.markItUp", mouseMove).bind("mouseup.markItUp", mouseUp);
});
footer.append(resizeHandle);
}
// listen key events
$$.bind('keydown.markItUp', keyPressed).bind('keyup', keyPressed);
// bind an event to catch external calls
$$.bind("insertion.markItUp", function(e, settings) {
if (settings.target !== false) {
get();
}
if (textarea === $.markItUp.focused) {
markup(settings);
}
});
// remember the last focus
$$.bind('focus.markItUp', function() {
$.markItUp.focused = this;
});
if (options.previewInElement) {
refreshPreview();
}
}
// recursively build header with dropMenus from markupset
function dropMenus(markupSet) {
var ul = $('<ul></ul>'), i = 0;
$('li:hover > ul', ul).css('display', 'block');
$.each(markupSet, function() {
var button = this, t = '', title, li, j;
title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||'');
key = (button.key) ? 'accesskey="'+button.key+'"' : '';
if (button.separator) {
li = $('<li class="markItUpSeparator">'+(button.separator||'')+'</li>').appendTo(ul);
} else {
i++;
for (j = levels.length -1; j >= 0; j--) {
t += levels[j]+"-";
}
li = $('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>')
.bind("contextmenu.markItUp", function() { // prevent contextmenu on mac and allow ctrl+click
return false;
}).bind('click.markItUp', function(e) {
e.preventDefault();
}).bind("focusin.markItUp", function(){
$$.focus();
}).bind('mouseup', function() {
if (button.call) {
eval(button.call)();
}
setTimeout(function() { markup(button) },1);
return false;
}).bind('mouseenter.markItUp', function() {
$('> ul', this).show();
$(document).one('click', function() { // close dropmenu if click outside
$('ul ul', header).hide();
}
);
}).bind('mouseleave.markItUp', function() {
$('> ul', this).hide();
}).appendTo(ul);
if (button.dropMenu) {
levels.push(i);
$(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu));
}
}
});
levels.pop();
return ul;
}
// markItUp! markups
function magicMarkups(string) {
if (string) {
string = string.toString();
string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g,
function(x, a) {
var b = a.split('|!|');
if (altKey === true) {
return (b[1] !== undefined) ? b[1] : b[0];
} else {
return (b[1] === undefined) ? "" : b[0];
}
}
);
// [![prompt]!], [![prompt:!:value]!]
string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g,
function(x, a) {
var b = a.split(':!:');
if (abort === true) {
return false;
}
value = prompt(b[0], (b[1]) ? b[1] : '');
if (value === null) {
abort = true;
}
return value;
}
);
return string;
}
return "";
}
// prepare action
function prepare(action) {
if ($.isFunction(action)) {
action = action(hash);
}
return magicMarkups(action);
}
// build block to insert
function build(string) {
var openWith = prepare(clicked.openWith);
var placeHolder = prepare(clicked.placeHolder);
var replaceWith = prepare(clicked.replaceWith);
var closeWith = prepare(clicked.closeWith);
var openBlockWith = prepare(clicked.openBlockWith);
var closeBlockWith = prepare(clicked.closeBlockWith);
var multiline = clicked.multiline;
if (replaceWith !== "") {
block = openWith + replaceWith + closeWith;
} else if (selection === '' && placeHolder !== '') {
block = openWith + placeHolder + closeWith;
} else {
string = string || selection;
var lines = [string], blocks = [];
if (multiline === true) {
lines = string.split(/\r?\n/);
}
for (var l = 0; l < lines.length; l++) {
line = lines[l];
var trailingSpaces;
if (trailingSpaces = line.match(/ *$/)) {
blocks.push(openWith + line.replace(/ *$/g, '') + closeWith + trailingSpaces);
} else {
blocks.push(openWith + line + closeWith);
}
}
block = blocks.join("\n");
}
block = openBlockWith + block + closeBlockWith;
return { block:block,
openBlockWith:openBlockWith,
openWith:openWith,
replaceWith:replaceWith,
placeHolder:placeHolder,
closeWith:closeWith,
closeBlockWith:closeBlockWith
};
}
// define markup to insert
function markup(button) {
var len, j, n, i;
hash = clicked = button;
get();
$.extend(hash, { line:"",
root:options.root,
textarea:textarea,
selection:(selection||''),
caretPosition:caretPosition,
ctrlKey:ctrlKey,
shiftKey:shiftKey,
altKey:altKey
}
);
// callbacks before insertion
prepare(options.beforeInsert);
prepare(clicked.beforeInsert);
if ((ctrlKey === true && shiftKey === true) || button.multiline === true) {
prepare(clicked.beforeMultiInsert);
}
$.extend(hash, { line:1 });
if ((ctrlKey === true && shiftKey === true)) {
lines = selection.split(/\r?\n/);
for (j = 0, n = lines.length, i = 0; i < n; i++) {
if ($.trim(lines[i]) !== '') {
$.extend(hash, { line:++j, selection:lines[i] } );
lines[i] = build(lines[i]).block;
} else {
lines[i] = "";
}
}
string = { block:lines.join('\n')};
start = caretPosition;
len = string.block.length + ((browser.opera) ? n-1 : 0);
} else if (ctrlKey === true) {
string = build(selection);
start = caretPosition + string.openWith.length;
len = string.block.length - string.openWith.length - string.closeWith.length;
len = len - (string.block.match(/ $/) ? 1 : 0);
len -= fixIeBug(string.block);
} else if (shiftKey === true) {
string = build(selection);
start = caretPosition;
len = string.block.length;
len -= fixIeBug(string.block);
} else {
string = build(selection);
start = caretPosition + string.block.length ;
len = 0;
start -= fixIeBug(string.block);
}
if ((selection === '' && string.replaceWith === '')) {
caretOffset += fixOperaBug(string.block);
start = caretPosition + string.openBlockWith.length + string.openWith.length;
len = string.block.length - string.openBlockWith.length - string.openWith.length - string.closeWith.length - string.closeBlockWith.length;
caretOffset = $$.val().substring(caretPosition, $$.val().length).length;
caretOffset -= fixOperaBug($$.val().substring(0, caretPosition));
}
$.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } );
if (string.block !== selection && abort === false) {
insert(string.block);
set(start, len);
} else {
caretOffset = -1;
}
get();
$.extend(hash, { line:'', selection:selection });
// callbacks after insertion
if ((ctrlKey === true && shiftKey === true) || button.multiline === true) {
prepare(clicked.afterMultiInsert);
}
prepare(clicked.afterInsert);
prepare(options.afterInsert);
// refresh preview if opened
if (previewWindow && options.previewAutoRefresh) {
refreshPreview();
}
// reinit keyevent
shiftKey = altKey = ctrlKey = abort = false;
}
// Substract linefeed in Opera
function fixOperaBug(string) {
if (browser.opera) {
return string.length - string.replace(/\n*/g, '').length;
}
return 0;
}
// Substract linefeed in IE
function fixIeBug(string) {
if (browser.msie) {
return string.length - string.replace(/\r*/g, '').length;
}
return 0;
}
// add markup
function insert(block) {
if (document.selection) {
var newSelection = document.selection.createRange();
newSelection.text = block;
} else {
textarea.value = textarea.value.substring(0, caretPosition) + block + textarea.value.substring(caretPosition + selection.length, textarea.value.length);
}
}
// set a selection
function set(start, len) {
if (textarea.createTextRange){
// quick fix to make it work on Opera 9.5
if (browser.opera && browser.version >= 9.5 && len == 0) {
return false;
}
range = textarea.createTextRange();
range.collapse(true);
range.moveStart('character', start);
range.moveEnd('character', len);
range.select();
} else if (textarea.setSelectionRange ){
textarea.setSelectionRange(start, start + len);
}
textarea.scrollTop = scrollPosition;
textarea.focus();
}
// get the selection
function get() {
textarea.focus();
scrollPosition = textarea.scrollTop;
if (document.selection) {
selection = document.selection.createRange().text;
if (browser.msie) { // ie
var range = document.selection.createRange(), rangeCopy = range.duplicate();
rangeCopy.moveToElementText(textarea);
caretPosition = -1;
while(rangeCopy.inRange(range)) {
rangeCopy.moveStart('character');
caretPosition ++;
}
} else { // opera
caretPosition = textarea.selectionStart;
}
} else { // gecko & webkit
caretPosition = textarea.selectionStart;
selection = textarea.value.substring(caretPosition, textarea.selectionEnd);
}
return selection;
}
// open preview window
function preview() {
if (typeof options.previewHandler === 'function') {
previewWindow = true;
} else if (options.previewInElement) {
previewWindow = $(options.previewInElement);
} else if (!previewWindow || previewWindow.closed) {
if (options.previewInWindow) {
previewWindow = window.open('', 'preview', options.previewInWindow);
$(window).unload(function() {
previewWindow.close();
});
} else {
iFrame = $('<iframe class="markItUpPreviewFrame"></iframe>');
if (options.previewPosition == 'after') {
iFrame.insertAfter(footer);
} else {
iFrame.insertBefore(header);
}
previewWindow = iFrame[iFrame.length - 1].contentWindow || frame[iFrame.length - 1];
}
} else if (altKey === true) {
if (iFrame) {
iFrame.remove();
} else {
previewWindow.close();
}
previewWindow = iFrame = false;
}
if (!options.previewAutoRefresh) {
refreshPreview();
}
if (options.previewInWindow) {
previewWindow.focus();
}
}
// refresh Preview window
function refreshPreview() {
renderPreview();
}
function renderPreview() {
var phtml;
if (options.previewHandler && typeof options.previewHandler === 'function') {
options.previewHandler( $$.val() );
} else if (options.previewParser && typeof options.previewParser === 'function') {
var data = options.previewParser( $$.val() );
writeInPreview(localize(data, 1) );
} else if (options.previewParserPath !== '') {
$.ajax({
type: 'POST',
dataType: 'text',
global: false,
url: options.previewParserPath,
data: options.previewParserVar+'='+encodeURIComponent($$.val()),
success: function(data) {
writeInPreview( localize(data, 1) );
}
});
} else {
if (!template) {
$.ajax({
url: options.previewTemplatePath,
dataType: 'text',
global: false,
success: function(data) {
writeInPreview( localize(data, 1).replace(/<!-- content -->/g, $$.val()) );
}
});
}
}
return false;
}
function writeInPreview(data) {
if (options.previewInElement) {
$(options.previewInElement).html(data);
} else if (previewWindow && previewWindow.document) {
try {
sp = previewWindow.document.documentElement.scrollTop
} catch(e) {
sp = 0;
}
previewWindow.document.open();
previewWindow.document.write(data);
previewWindow.document.close();
previewWindow.document.documentElement.scrollTop = sp;
}
}
// set keys pressed
function keyPressed(e) {
shiftKey = e.shiftKey;
altKey = e.altKey;
ctrlKey = (!(e.altKey && e.ctrlKey)) ? (e.ctrlKey || e.metaKey) : false;
if (e.type === 'keydown') {
if (ctrlKey === true) {
li = $('a[accesskey="'+((e.keyCode == 13) ? '\\n' : String.fromCharCode(e.keyCode))+'"]', header).parent('li');
if (li.length !== 0) {
ctrlKey = false;
setTimeout(function() {
li.triggerHandler('mouseup');
},1);
return false;
}
}
if (e.keyCode === 13 || e.keyCode === 10) { // Enter key
if (ctrlKey === true) { // Enter + Ctrl
ctrlKey = false;
markup(options.onCtrlEnter);
return options.onCtrlEnter.keepDefault;
} else if (shiftKey === true) { // Enter + Shift
shiftKey = false;
markup(options.onShiftEnter);
return options.onShiftEnter.keepDefault;
} else { // only Enter
markup(options.onEnter);
return options.onEnter.keepDefault;
}
}
if (e.keyCode === 9) { // Tab key
if (shiftKey == true || ctrlKey == true || altKey == true) {
return false;
}
if (caretOffset !== -1) {
get();
caretOffset = $$.val().length - caretOffset;
set(caretOffset, 0);
caretOffset = -1;
return false;
} else {
markup(options.onTab);
return options.onTab.keepDefault;
}
}
}
}
function remove() {
$$.unbind(".markItUp").removeClass('markItUpEditor');
$$.parent('div').parent('div.markItUp').parent('div').replaceWith($$);
$$.data('markItUp', null);
}
init();
});
};
$.fn.markItUpRemove = function() {
return this.each(function() {
$(this).markItUp('remove');
}
);
};
$.markItUp = function(settings) {
var options = { target:false };
$.extend(options, settings);
if (options.target) {
return $(options.target).each(function() {
$(this).focus();
$(this).trigger('insertion', [options]);
});
} else {
$('textarea').trigger('insertion', [options]);
}
};
})(jQuery);

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

View file

@ -0,0 +1,30 @@
// ----------------------------------------------------------------------------
// markItUp!
// ----------------------------------------------------------------------------
// Copyright (C) 2011 Jay Salvat
// http://markitup.jaysalvat.com/
// ----------------------------------------------------------------------------
// Html tags
// http://en.wikipedia.org/wiki/html
// ----------------------------------------------------------------------------
// Basic set. Feel free to add more tags
// ----------------------------------------------------------------------------
var mySettings = {
onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'},
onCtrlEnter: {keepDefault:false, openWith:'\n<p>', closeWith:'</p>'},
onTab: {keepDefault:false, replaceWith:' '},
markupSet: [
{name:'Bold', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
{name:'Italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
{name:'Stroke through', key:'S', openWith:'<del>', closeWith:'</del>' },
{separator:'---------------' },
{name:'Bulleted List', openWith:' <li>', closeWith:'</li>', multiline:true, openBlockWith:'<ul>\n', closeBlockWith:'\n</ul>'},
{name:'Numeric List', openWith:' <li>', closeWith:'</li>', multiline:true, openBlockWith:'<ol>\n', closeBlockWith:'\n</ol>'},
{separator:'---------------' },
{name:'Picture', key:'P', replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' },
{name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
{separator:'---------------' },
{name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
{name:'Preview', className:'preview', call:'preview'}
]
}

View file

@ -0,0 +1,34 @@
/* -------------------------------------------------------------------
// markItUp!
// By Jay Salvat - http://markitup.jaysalvat.com/
// ------------------------------------------------------------------*/
.markItUp .markItUpButton1 a {
background-image:url(images/bold.png);
}
.markItUp .markItUpButton2 a {
background-image:url(images/italic.png);
}
.markItUp .markItUpButton3 a {
background-image:url(images/stroke.png);
}
.markItUp .markItUpButton4 a {
background-image:url(images/list-bullet.png);
}
.markItUp .markItUpButton5 a {
background-image:url(images/list-numeric.png);
}
.markItUp .markItUpButton6 a {
background-image:url(images/picture.png);
}
.markItUp .markItUpButton7 a {
background-image:url(images/link.png);
}
.markItUp .markItUpButton8 a {
background-image:url(images/clean.png);
}
.markItUp .preview a {
background-image:url(images/preview.png);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

View file

@ -0,0 +1,40 @@
// -------------------------------------------------------------------
// markItUp!
// -------------------------------------------------------------------
// Copyright (C) 2008 Jay Salvat
// http://markitup.jaysalvat.com/
// -------------------------------------------------------------------
// Textile tags example
// http://en.wikipedia.org/wiki/Textile_(markup_language)
// http://www.textism.com/
// -------------------------------------------------------------------
// Feel free to add more tags
// -------------------------------------------------------------------
mySettings = {
previewParserPath: '', // path to your Textile parser
onShiftEnter: {keepDefault:false, replaceWith:'\n\n'},
markupSet: [
{name:'Heading 1', key:'1', openWith:'h1(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
{name:'Heading 2', key:'2', openWith:'h2(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
{name:'Heading 3', key:'3', openWith:'h3(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
{name:'Heading 4', key:'4', openWith:'h4(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
{name:'Heading 5', key:'5', openWith:'h5(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
{name:'Heading 6', key:'6', openWith:'h6(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
{name:'Paragraph', key:'P', openWith:'p(!(([![Class]!]))!). '},
{separator:'---------------' },
{name:'Bold', key:'B', closeWith:'*', openWith:'*'},
{name:'Italic', key:'I', closeWith:'_', openWith:'_'},
{name:'Stroke through', key:'S', closeWith:'-', openWith:'-'},
{separator:'---------------' },
{name:'Bulleted list', openWith:'(!(* |!|*)!)'},
{name:'Numeric list', openWith:'(!(# |!|#)!)'},
{separator:'---------------' },
{name:'Picture', replaceWith:'![![Source:!:http://]!]([![Alternative text]!])!'},
{name:'Link', openWith:'"', closeWith:'([![Title]!])":[![Link:!:http://]!]', placeHolder:'Your text to link here...' },
{separator:'---------------' },
{name:'Quotes', openWith:'bq(!(([![Class]!]))!). '},
{name:'Code', openWith:'@', closeWith:'@'}/*,
{separator:'---------------' },
{name:'Preview', call:'preview', className:'preview'}*/
]
}

View file

@ -0,0 +1,60 @@
/* -------------------------------------------------------------------
// markItUp!
// By Jay Salvat - http://markitup.jaysalvat.com/
// ------------------------------------------------------------------*/
.markItUp .markItUpButton1 a {
background-image:url(images/h1.png);
}
.markItUp .markItUpButton2 a {
background-image:url(images/h2.png);
}
.markItUp .markItUpButton3 a {
background-image:url(images/h3.png);
}
.markItUp .markItUpButton4 a {
background-image:url(images/h4.png);
}
.markItUp .markItUpButton5 a {
background-image:url(images/h5.png);
}
.markItUp .markItUpButton6 a {
background-image:url(images/h6.png);
}
.markItUp .markItUpButton7 a {
background-image:url(images/paragraph.png);
}
.markItUp .markItUpButton8 a {
background-image:url(images/bold.png);
}
.markItUp .markItUpButton9 a {
background-image:url(images/italic.png);
}
.markItUp .markItUpButton10 a {
background-image:url(images/stroke.png);
}
.markItUp .markItUpButton11 a {
background-image:url(images/list-bullet.png);
}
.markItUp .markItUpButton12 a {
background-image:url(images/list-numeric.png);
}
.markItUp .markItUpButton13 a {
background-image:url(images/picture.png);
}
.markItUp .markItUpButton14 a {
background-image:url(images/link.png);
}
.markItUp .markItUpButton15 a {
background-image:url(images/quotes.png);
}
.markItUp .markItUpButton16 a {
background-image:url(images/code.png);
}
.markItUp .preview a {
background-image:url(images/preview.png);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

View file

@ -0,0 +1,147 @@
/* -------------------------------------------------------------------
// markItUp! Universal MarkUp Engine, JQuery plugin
// By Jay Salvat - http://markitup.jaysalvat.com/
// ------------------------------------------------------------------*/
.markItUp * {
margin:0px; padding:0px;
outline:none;
}
.markItUp a:link,
.markItUp a:visited {
color:#000;
text-decoration:none;
}
.markItUp {
width:700px;
margin:5px 0 5px 0;
border:5px solid #F5F5F5;
}
.markItUpContainer {
border:1px solid #3C769D;
background:#FFF url(images/bg-container.png) repeat-x top left;
padding:5px 5px 2px 5px;
font:11px Verdana, Arial, Helvetica, sans-serif;
}
.markItUpEditor {
font:12px 'Courier New', Courier, monospace;
padding:5px 5px 5px 35px;
border:3px solid #3C769D;
width:643px;
height:320px;
background:#FFF url(images/bg-editor.png) no-repeat;
clear:both;
line-height:18px;
overflow:auto;
}
.markItUpPreviewFrame {
overflow:auto;
background-color:#FFFFFF;
border:1px solid #3C769D;
width:99.9%;
height:300px;
margin:5px 0;
}
.markItUpFooter {
width:100%;
cursor:n-resize;
}
.markItUpResizeHandle {
overflow:hidden;
width:22px; height:5px;
margin-left:auto;
margin-right:auto;
background-image:url(images/handle.png);
cursor:n-resize;
}
/***************************************************************************************/
/* first row of buttons */
.markItUpHeader ul li {
list-style:none;
float:left;
position:relative;
}
.markItUpHeader ul li ul{
display:none;
}
.markItUpHeader ul li:hover > ul{
display:block;
}
.markItUpHeader ul .markItUpDropMenu {
background:transparent url(images/menu.png) no-repeat 115% 50%;
margin-right:5px;
}
.markItUpHeader ul .markItUpDropMenu li {
margin-right:0px;
}
.markItUpHeader ul .markItUpSeparator {
margin:0 10px;
width:1px;
height:16px;
overflow:hidden;
background-color:#CCC;
}
.markItUpHeader ul ul .markItUpSeparator {
width:auto; height:1px;
margin:0px;
}
/* next rows of buttons */
.markItUpHeader ul ul {
display:none;
position:absolute;
top:18px; left:0px;
background:#F5F5F5;
border:1px solid #3C769D;
height:inherit;
}
.markItUpHeader ul ul li {
float:none;
border-bottom:1px solid #3C769D;
}
.markItUpHeader ul ul .markItUpDropMenu {
background:#F5F5F5 url(images/submenu.png) no-repeat 100% 50%;
}
/* next rows of buttons */
.markItUpHeader ul ul ul {
position:absolute;
top:-1px; left:150px;
}
.markItUpHeader ul ul ul li {
float:none;
}
.markItUpHeader ul a {
display:block;
width:16px; height:16px;
text-indent:-10000px;
background-repeat:no-repeat;
padding:3px;
margin:0px;
}
.markItUpHeader ul ul a {
display:block;
padding-left:0px;
text-indent:0;
width:120px;
padding:5px 5px 5px 25px;
background-position:2px 50%;
}
.markItUpHeader ul ul a:hover {
color:#FFF;
background-color:#3C769D;
}
/***************************************************************************************/
.html .markItUpEditor {
background-image:url(images/bg-editor-html.png);
}
.markdown .markItUpEditor {
background-image:url(images/bg-editor-markdown.png);
}
.textile .markItUpEditor {
background-image:url(images/bg-editor-textile.png);
}
.bbcode .markItUpEditor {
background-image:url(images/bg-editor-bbcode.png);
}
.wiki .markItUpEditor,
.dotclear .markItUpEditor {
background-image:url(images/bg-editor-wiki.png);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

View file

@ -0,0 +1,118 @@
/* -------------------------------------------------------------------
// markItUp! Universal MarkUp Engine, JQuery plugin
// By Jay Salvat - http://markitup.jaysalvat.com/
// ------------------------------------------------------------------*/
.markItUp * {
margin:0px; padding:0px;
outline:none;
}
.markItUp a:link,
.markItUp a:visited {
color:#000;
text-decoration:none;
}
.markItUp {
width:700px;
margin:5px 0 5px 0;
}
.markItUpContainer {
font:11px Verdana, Arial, Helvetica, sans-serif;
}
.markItUpEditor {
font:12px 'Courier New', Courier, monospace;
padding:5px;
width:690px;
height:320px;
clear:both;
line-height:18px;
overflow:auto;
}
.markItUpPreviewFrame {
overflow:auto;
background-color:#FFF;
width:99.9%;
height:300px;
margin:5px 0;
}
.markItUpFooter {
width:100%;
}
.markItUpResizeHandle {
overflow:hidden;
width:22px; height:5px;
margin-left:auto;
margin-right:auto;
background-image:url(images/handle.png);
cursor:n-resize;
}
/***************************************************************************************/
/* first row of buttons */
.markItUpHeader ul li {
list-style:none;
float:left;
position:relative;
}
.markItUpHeader ul li:hover > ul{
display:block;
}
.markItUpHeader ul .markItUpDropMenu {
background:transparent url(images/menu.png) no-repeat 115% 50%;
margin-right:5px;
}
.markItUpHeader ul .markItUpDropMenu li {
margin-right:0px;
}
/* next rows of buttons */
.markItUpHeader ul ul {
display:none;
position:absolute;
top:18px; left:0px;
background:#FFF;
border:1px solid #000;
}
.markItUpHeader ul ul li {
float:none;
border-bottom:1px solid #000;
}
.markItUpHeader ul ul .markItUpDropMenu {
background:#FFF url(images/submenu.png) no-repeat 100% 50%;
}
.markItUpHeader ul .markItUpSeparator {
margin:0 10px;
width:1px;
height:16px;
overflow:hidden;
background-color:#CCC;
}
.markItUpHeader ul ul .markItUpSeparator {
width:auto; height:1px;
margin:0px;
}
/* next rows of buttons */
.markItUpHeader ul ul ul {
position:absolute;
top:-1px; left:150px;
}
.markItUpHeader ul ul ul li {
float:none;
}
.markItUpHeader ul a {
display:block;
width:16px; height:16px;
text-indent:-10000px;
background-repeat:no-repeat;
padding:3px;
margin:0px;
}
.markItUpHeader ul ul a {
display:block;
padding-left:0px;
text-indent:0;
width:120px;
padding:5px 5px 5px 25px;
background-position:2px 50%;
}
.markItUpHeader ul ul a:hover {
color:#FFF;
background-color:#000;
}

View file

@ -0,0 +1,5 @@
/* preview style examples */
body {
background-color:#EFEFEF;
font:70% Verdana, Arial, Helvetica, sans-serif;
}

View file

@ -0,0 +1,11 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>markItUp! preview template</title>
<link rel="stylesheet" type="text/css" href="~/templates/preview.css" />
</head>
<body>
<!-- content -->
</body>
</html>