html5 editor

This commit is contained in:
Martin Müller 2014-04-23 22:08:43 +02:00
parent aa89a19d47
commit 31605002ca
3 changed files with 9 additions and 5 deletions

View File

@ -337,6 +337,7 @@ class UserController extends AppController {
}
if(!empty($page) and count($page)> 0){
if($this->request->is('post')){
var_dump($this->request);
$this->request->data['DreamjobPageInh']['user_id']=$profil['AppUser']['id'];
if($image){
$this->request->data['DreamjobPageInh']['id']=$page['DreamjobPageInh']['id'];

View File

@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<?php
echo $this->Html->charset();
echo $this->Html->css(array('bootstrap.min','dreamjob'));
echo $this->Html->css(array('bootstrap.min','bootstrap-wysihtml5','dreamjob'));
echo $this->Html->meta('icon', $this->Html->url('/favicon.ico'));
?>
</head>
@ -125,7 +125,7 @@
</div>
<!-- java script -->
<?php
echo $this->Html->script(array('jquery.min', 'bootstrap.min', 'jquery-ui', 'dreamjob'));
echo $this->Html->script(array('jquery.min', 'bootstrap.min', 'jquery-ui','bootstrap-wysihtml5', 'dreamjob'));
?>
<!-- extraScript -->
<?php

View File

@ -22,11 +22,11 @@
$(where+' img').each(function(){ $(this).attr('src',$(this).attr('src')+ '?' + (new Date()).getTime()); });
$("#alert .alert").alert();
$(where+' textarea').wysihtml5();
$(where+' .dropdown-toggle').dropdown();
$(where+" a").each(function(that){
if($(this).attr("rel")!=="external" && $(this).attr("ref")!=="eventOff")
if($(this).attr("rel")!=="external" && $(this).attr("ref")!=="eventOff" && !$(this).parents('ul').hasClass("wysihtml5-toolbar"))
$(this).click(function(e){
load($(this).attr('href'),{},($(this).attr('rel')=="tab"));
return false;
@ -35,6 +35,7 @@
$(where+" form").submit(function(e){
if(!$(this).hasClass("hide-form") && $(this).attr('enctype')!='multipart/form-data' ){
$(":input[ name *= '_wysihtml5_mod' ]",this).remove();
e.stopPropagation();
//e.preventDefault();
if($(this).attr("back"))
@ -50,6 +51,7 @@
if (!$('#fileUpload').length)
$('body').append('<iframe id="fileUpload" name="fileUpload" style="display:none" />');
$(this).attr('target','fileUpload');
$(":input[ name *= '_wysihtml5_mod' ]",this).remove();
$(this).submit(function(){
frame = $('#fileUpload').load(function(){
setContent(frame.contents().find('body').html());
@ -111,6 +113,7 @@
evet();
function saveForm(){
i = 0;
$(":input[ name *= '_wysihtml5_mod' ]",$(that).parents('form')).remove();
$("tbody tr.new",$(that).parents('form')).remove();
$("tbody tr",$(that).parents('form')).each(function(){
$(":input",this).each(function(){