newhck / php-form-builder-class

Automatically exported from code.google.com/p/php-form-builder-class
GNU General Public License v3.0
0 stars 0 forks source link

use preventTinyMCEInitLoad to load external init for tinyMCE #62

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
add "preventTinyMCEInitLoad" => 1, to the form
load a javascript with the init for tinyMCE

What is the expected output? What do you see instead?
I was hoping this would result in my own config of tinyMCE to load.
But the toolbar is not loaded.  

What version of the product are you using? On what operating system?
r.268

The idea is to load a custom tinyMCE without having to touch the 
php-form-builder. 

Original issue reported on code.google.com by sven.lar...@gmail.com on 12 Jul 2010 at 3:22

GoogleCodeExporter commented 8 years ago
You should be able to add  "preventTinyMCEInitLoad" => 1 as you describe above 
and then add your own tinyMCE.init() section separate from class.form.php.  Is 
this what you have tried previously?

Original comment by ajporterfield@gmail.com on 13 Jul 2010 at 1:45

GoogleCodeExporter commented 8 years ago
yes, that was my idea also. 
But i could not get the tinymce to load. 

Original comment by sven.lar...@gmail.com on 13 Jul 2010 at 1:51

GoogleCodeExporter commented 8 years ago
Can you post your code, or provide a link for my to see your webpage? 

Original comment by ajporterfield@gmail.com on 13 Jul 2010 at 2:12

GoogleCodeExporter commented 8 years ago
I tried it on the web-editors.php file.
I added the following. 

<head>
...

<script type="text/javascript">
tinyMCE.init({
    mode: "textareas",
    theme: "advanced",
    plugins: "safari,table,paste,inlinepopups,preview",
    dialog_type: "modal",
    theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,|,forecolor,backcolor",
    theme_advanced_buttons2: "formatselect,fontselect,fontsizeselect,|,pastetext,pasteword,|,link,image",
    theme_advanced_buttons3: "tablecontrols,|,code,preview,|,undo,redo",
    theme_advanced_toolbar_location: "top",
    editor_selector: "tiny_mce",
    forced_root_block: false,
    force_br_newlines: true,
    force_p_newlines: false
});
tinyMCE.init({
    mode: "textareas",
    theme: "simple",
    editor_selector: "tiny_mce_simple",
    forced_root_block: false,
    force_br_newlines: true,
    force_p_newlines: false
});
            </script>
</head>
...
$form->setAttributes(array(...,"preventTinyMCEInitLoad" => 1));

Original comment by sven.lar...@gmail.com on 13 Jul 2010 at 2:45

GoogleCodeExporter commented 8 years ago
Your current code snippet is in the <head> section, which is chronologically 
before the textareas are available.  Move this javascript section to just 
before your closing <body> tag, or at least after the form->render() function 
and see if that remedies your problem.

Original comment by ajporterfield@gmail.com on 13 Jul 2010 at 5:32

GoogleCodeExporter commented 8 years ago
Ok..., I thought I already tried that combination.
Seems like I was doing something wrong. 

Thanks for the solution. 

Original comment by sven.lar...@gmail.com on 13 Jul 2010 at 6:27

GoogleCodeExporter commented 8 years ago

Original comment by ajporterfield@gmail.com on 14 Jul 2010 at 9:01