CLU Posted December 15, 2011 Report Share Posted December 15, 2011 HI Guys, Just wondering if anyone got this issue that I have been having, sometimes when i paste content directly into tinymce and try to input more content after the part pasted prior it does not update the database. Even if i safely paste the content in by pressing the paste button, I still get this issue. It doesn't happen all the time, just every so often... Checked the entire cms and cannot spot any errors. the code for Tiny MCE within the v_edit file is the following <!-- jQuery Block Start--> <!-- jQuery is used to catch the forms submit process --> <script type="text/javascript"> jQuery(document).ready(function($){ $('#edit').submit(function(e){ //Disable the default browser refresh e.preventDefault(); //Ajax to process the form var id = "<?php echo $this->getData('block_id')?>"; var type = $('#type').val(); //This is for TinyMCE Ajax <?php if($this->getData('block_type') == 'wysiwyg') {?> tinyMCE.triggerSave(); <?php }?> var content = $('#field').val(); //Passing the values onto Ajax var dataString = 'id=' + id + '&field=' + content + '&type=' +type; //Call ajax $.ajax({ type: "POST", url: "<?php echo SITE_PATH; ?>app/cms/edit.php", data: dataString, cache: false, success: function(html) { $('#cboxLoadedContent').html(html); } }); }); //jQuery to close the box $('#fs_cancel').live('click', function(e){ //This is addressing the issue with open close then reopen issue if(tinyMCE.getInstanceById('field')) { tinyMCE.execCommand('mceFocus', false, 'field'); tinyMCE.execCommand('mceRemoveControl', false, 'field'); } }); }); </script> <?php if($this->getData('block_type') == 'wysiwyg') { ?> <script type="text/javascript"> tinyMCE.init({ // General options mode : "none", skin : "thebigreason", theme : "advanced", plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,\n\ preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,\n\ visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,vimeo,jbimages", // Theme options theme_advanced_buttons1 : "fontsizeselect,bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,\n\ justifyfull,link,unlink,paste,pasteword,pastetext,fullscreen,undo,redo,forecolor,backcolor,\n\ code,vimeo,jbimages", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "sub,sup,|,charmap,iespell,advhr,", theme_advanced_buttons4 : "", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "center", height:"300", width:"700" }); //once again below is to load the editor addressing open close issue setTimeout(function() {tinyMCE.execCommand('mceAddControl', false, 'field');}, 0); </script> <? }?> <!-- jQuery Block End--> <div id="fs_wrapper"> <form action="" method="post" id="edit"> <div class="row"> <h1>Edit Content <?php // echo $this->getData('block_id'); ?></h1> <p>Click and edit below</p> </div> <div class="row"> <?php echo $this->getData('cms_field');?> <input type="hidden" id="type" value="<?php $this->getData('block_type');?>"> </div> <br/> <input type="submit" name="submit" class="green_button" value="Submit"> <br/><br/> <a href="#" id="fs_cancel">Cancel</a> </form> If anyone could help that would be great. Kind Regards Quote Link to comment Share on other sites More sharing options...
CLU Posted December 15, 2011 Author Report Share Posted December 15, 2011 It seems to be trying to input any content after I have pasted and updated prior, that it does not update the database... so odd. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted December 15, 2011 Report Share Posted December 15, 2011 I'd suggest taking a look at the last few posts in this topic: http://www.killersites.com/community/index.php?/topic/5878-cms-tutorial-having-issues/page__p__26818__hl__cms__fromsearch__1#entry26818 Quote Link to comment Share on other sites More sharing options...
CLU Posted December 15, 2011 Author Report Share Posted December 15, 2011 The post was very helpful, this should prevent the issue that I have been having. Do you think this could be the reason as to why the Vimeo Video was plugin was not working? as this also seemed to break it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.