Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-4 of 4 total  RSS 

handling/configuring event when tinymce editor initializes

Initialize the editor the traditional way

   1  
   2  tinyMCE.init({
   3     ...
   4     setup : function(ed) {
   5        ed.onInit.add(window.testfunc);
   6        
   7     }
   8  });
   9  
  10  function testfunc()
  11  {
  12     alert('Editor initialized');
  13  
  14     //set content for editor 
  15     var ed = tinyMCE.get('editor');
  16     ed.setContent(hfContent.value);//setting value from hidden field	
  17  }

setting tinymce editor content via javascript

setting tinymce editor content via javascript

   1  
   2  <script type="text/javascript">
   3      tinyMCE.get(mceId).execCommand('mceSetContent',false, '<p>some text<table></table></p>' );
   4  </script>     

set tinymce to use relative links

If installed under Mambo, edit:
   1  mambots/editors/tinymce_exp.php

Lines 157-158:
   1  
   2    relative_urls : true,
   3    remove_script_host : true,

fix tinymce link editor default of target:_new

When installed in Mambo, edit
   1  mambos/editors/tinymce_exp/jscripts/tiny_mce/plugins/advlink/link.php
lines 253-258:
   1  
   2  <select name="target" id="target">
   3            <option value="_self" selected>_self&nbsp;(<?php echo _insert_link_target_same ?>)</option>
   4            <option value="_blank">_blank&nbsp;(<?php echo _insert_link_target_blank ?>)</option>
   5            <!--<option value="_parent">_parent&nbsp;(<?php echo _insert_link_target_parent ?>)</option>
   6            <option value="_top">_top&nbsp;(<?php echo _insert_link_target_top ?>)</option>-->
   7  </select>
« Newer Snippets
Older Snippets »
Showing 1-4 of 4 total  RSS