
<script language="javascript" type="text/javascript" src="assets/plugins/tinymce3101/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
// Configuration detail check http://wiki.moxiecode.com/index.php/TinyMCE:Configuration
tinyMCE.init({
etc
etc
etc
2mcclausky
I’m using Tiny + FDM by inserting my Tiny JS code into fdmEform chunk.
be happy
Ok. can you show me your fdmEform chunk?
Yes, I did exactly that. It works just fine when the page loads. But if you forget a required field, and the page posts back, then TinyMCE just doesn’t load anymore.
<script language="javascript" type="text/javascript" src="/assets/plugins/tinymce3101/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "exact",
theme : "advanced",
elements : "content",
plugins : "safari,style,layer,table,advhr,advimage,advlink,iespell,insertdatetime,media,searchreplace,paste,fullscreen,visualchars,nonbreaking,pagebreak",
theme_advanced_buttons1_add_before : "newdocument,separator",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "pastetext,pasteword,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "iespell,media,advhr,separator,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,attribs,|,visualchars,nonbreaking,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
external_link_list_url : "/assets/plugins/tinymce3101/tinymce.linklist.php",
theme_advanced_resize_horizontal : false,
theme_advanced_resizing : true,
language : "ru",
height : "300",
width : "100%",
relative_urls : true,
document_base_url : "/",
convert_urls : false,
pagebreak_separator : "<!-- splitter -->",
file_browser_callback : "myFileBrowser",
apply_source_formatting : true
});
function myFileBrowser (field_name, url, type, win) {
var cmsURL = '/manager/media/browser/mcpuk/browser.php?Connector=/manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=/&editor=tinymce3&editorpath=/assets/plugins/tinymce3101';
switch (type) {
case "image":
type = 'images';
break;
case "media":
break;
case "flash":
break;
case "file":
type = 'files';
break;
default:
return false;
}
if (cmsURL.indexOf("?") < 0) {
//add the type as the only query parameter
cmsURL = cmsURL + "?type=" + type;
}
else {
//add the type as an additional query parameter
// (PHP session ID is now included if there is one at all)
cmsURL = cmsURL + "&type=" + type;
}
tinyMCE.activeEditor.windowManager.open({
file : cmsURL,
width : screen.width * 0.7, // Your dimensions may differ - toy around with them!
height : screen.height * 0.7,
resizable : "yes",
inline : "no", // This parameter only has an effect if you use the inlinepopups plugin!
close_previous : "no"
}, {
window : win,
input : field_name
});
return false;
}
</script>
[+validationmessage+]
<form method="post" action="[~[*id*]~]" id="fdmForm">
<input type="hidden" name="formid" value="fdmForm" />
<input type="hidden" name="fdmid" value="[+fdmid+]" eform="::0::" />
Pagetitle:<br />
<input name="pagetitle" id="pagetitle" value="[+pagetitle+]" type="text" size="80" class="inputs" eform="Pagetitle:string:1" /><br />
Content:<br />
<textarea name="content" id="content" rows="5" cols="61" class="inputs" eform="Content:html:1">[+content+]</textarea><br />
<input name="fdmsubmit" value="Send" type="submit" />
</form>[!FDM? &parent=`[*parent*]` &disableedit=`1` &disablepublish=`1` &disableunpublish=`1` &disabledelete=`1` &model=`149` &editorpageid=`137` &id=`137` &eform_tpl=`McfdmEform_Events` &canpost=`Web - Site Admins` &script=`loadTinymce` !]
[+validationmessage+]
<form method="post" action="[~[*id*]~]" id="fdmForm">
<input type="hidden" name="formid" value="fdmForm" />
<input type="hidden" name="fdmid" value="[+fdmid+]" eform="::0::" />
<h1>New Event</h1>
<br>
Event Name:<input name="pagetitle" type="text" id="pagetitle" value="[+pagetitle+]" size="35" eform="Name cannot be empty:string:1" />
<br>
Event Start Date:
<input name="tvEasyEvents_Start" id="tvEasyEvents_Start" value="[+tvEasyEvents_Start+]" type="text" readonly="readonly" eform="Start Date cannot be empty:string:1" />
<a href="#" onClick="javascript: displayCalendar('tvEasyEvents_Start');" title="Click to display calendar">
<img align="absmiddle" src="manager/media/calendar/img/cal.gif" width="16" height="16" border="0" alt="Click to display calendar" /></a>
<a href="#" onClick="document.forms['fdmForm'].elements['tvEasyEvents_Start'].value=''; return true;" >
<img align="absmiddle" src="manager/media/style/MODx/images/icons/event3.gif" width="16" height="16" border="0" alt="Click to erase date"></a>
<br>
Event End Date:
<input name="tvEasyEvents_End" id="tvEasyEvents_End" value="[+tvEasyEvents_End+]" type="text" readonly="readonly" />
<a href="#" onClick="javascript: displayCalendar('tvEasyEvents_End');" title="Click to display calendar">
<img align="absmiddle" src="manager/media/calendar/img/cal.gif" width="16" height="16" border="0" alt="Click to display calendar" /></a>
<a href="#" onClick="document.forms['fdmForm'].elements['tvEasyEvents_End'].value=''; return true;" >
<img align="absmiddle" src="manager/media/style/MODx/images/icons/event3.gif" width="16" height="16" border="0" alt="Click to erase date"></a>
<br>
<br>
Hide time:
<select name="tvEasyEvents_HideTime" id="tvEasyEvents_HideTime">
<option value="">NO</option>
<option value="Hide">YES</option>
</select>
<br>
CONTENT:
<textarea name="content" cols="55" rows="15" id="content" eform="Content cannot be empty:html:1">[+content+]</textarea>
<br>
<input name="fdmsubmit" value="Publish Event" type="submit" />
<a href="[~[*parent*]~]" tile="Cancel">Cancel</a>
</form>
<script language="JavaScript" src="manager/media/script/datefunctions.js"></script>
<script type="text/javascript">
function displayCalendar(fieldName)
{
var elm_txt = {}; // dummy
var pub = document.forms["fdmForm"].elements["" + fieldName + ""];
var nwpub_cal1 = new calendar1(pub,elm_txt);
nwpub_cal1.path="[(base_url)]manager/media/";
nwpub_cal1.year_scroll = true;
nwpub_cal1.time_comp = true;
nwpub_cal1.popup();
}
</script><script language="javascript" type="text/javascript" src="assets/plugins/tinymce3101/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
// Configuration detail check http://wiki.moxiecode.com/index.php/TinyMCE:Configuration
tinyMCE.init({
theme : "advanced",
mode : "exact", // textareas: Converts all textarea elements to editors when the page loads. exact: Converts elements of the specified names, as listed in the elements option.
// This option should contain a comma separated list of element id's to convert into editor instances. This option is only used if mode is set to "exact".
// ie: elements : "elm1,elm2"
elements : "content",
relative_urls : true,
external_link_list_url : "[(base_url)]assets/plugins/tinymce3101/tinymce.linklist.php",
file_browser_callback : "myFileBrowser",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
plugins : "style,advimage,advlink,searchreplace,print,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,visualchars,media,table",
theme_advanced_buttons1 : "undo,redo,selectall,separator,pastetext,pasteword,separator,search,replace,separator,nonbreaking,hr,charmap,separator,image,link,unlink,anchor,media,separator,cleanup,removeformat,separator,fullscreen,code",
theme_advanced_buttons2 : "bold,italic,underline,strikethrough,sub,sup,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,table,forecolor,backcolor,styleprops",
theme_advanced_buttons3 : "styleselect,formatselect,fontselect,fontsizeselect"
});
function myFileBrowser (field_name, url, type, win) {
var cmsURL = '/manager/media/browser/mcpuk/browser.php?Connector=/manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=/&editor=tinymce3&editorpath=/assets/plugins/tinymce3101';
switch (type) {
case "image":
type = 'images';
break;
case "media":
break;
case "flash":
break;
case "file":
type = 'files';
break;
default:
return false;
}
if (cmsURL.indexOf("?") < 0) {
//add the type as the only query parameter
cmsURL = cmsURL + "?type=" + type;
}
else {
//add the type as an additional query parameter
// (PHP session ID is now included if there is one at all)
cmsURL = cmsURL + "&type=" + type;
}
tinyMCE.activeEditor.windowManager.open({
file : cmsURL,
width : screen.width * 0.7, // Your dimensions may differ - toy around with them!
height : screen.height * 0.7,
resizable : "yes",
inline : "yes", // This parameter only has an effect if you use the inlinepopups plugin!
close_previous : "no"
}, {
window : win,
input : field_name
});
return false;
}
</script>I’m using Tiny + FDM by inserting my Tiny JS code into fdmEform chunk.Kill &script=`loadTinymce`
<script language="javascript" type="text/javascript" src="assets/plugins/tinymce3101/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
// Configuration detail check http://wiki.moxiecode.com/index.php/TinyMCE:Configuration
tinyMCE.init({
theme : "advanced",
mode : "exact", // textareas: Converts all textarea elements to editors when the page loads. exact: Converts elements of the specified names, as listed in the elements option.
// This option should contain a comma separated list of element id's to convert into editor instances. This option is only used if mode is set to "exact".
// ie: elements : "elm1,elm2"
elements : "content",
relative_urls : true,
external_link_list_url : "[(base_url)]assets/plugins/tinymce3101/tinymce.linklist.php",
file_browser_callback : "myFileBrowser",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
plugins : "style,advimage,advlink,searchreplace,print,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,visualchars,media,table",
theme_advanced_buttons1 : "undo,redo,selectall,separator,pastetext,pasteword,separator,search,replace,separator,nonbreaking,hr,charmap,separator,image,link,unlink,anchor,media,separator,cleanup,removeformat,separator,fullscreen,code",
theme_advanced_buttons2 : "bold,italic,underline,strikethrough,sub,sup,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,table,forecolor,backcolor,styleprops",
theme_advanced_buttons3 : "styleselect,formatselect,fontselect,fontsizeselect"
});
function myFileBrowser (field_name, url, type, win) {
var cmsURL = '/manager/media/browser/mcpuk/browser.php?Connector=/manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=/&editor=tinymce3&editorpath=/assets/plugins/tinymce3101';
switch (type) {
case "image":
type = 'images';
break;
case "media":
break;
case "flash":
break;
case "file":
type = 'files';
break;
default:
return false;
}
if (cmsURL.indexOf("?") < 0) {
//add the type as the only query parameter
cmsURL = cmsURL + "?type=" + type;
}
else {
//add the type as an additional query parameter
// (PHP session ID is now included if there is one at all)
cmsURL = cmsURL + "&type=" + type;
}
tinyMCE.activeEditor.windowManager.open({
file : cmsURL,
width : screen.width * 0.7, // Your dimensions may differ - toy around with them!
height : screen.height * 0.7,
resizable : "yes",
inline : "yes", // This parameter only has an effect if you use the inlinepopups plugin!
close_previous : "no"
}, {
window : win,
input : field_name
});
return false;
}
</script>
[+validationmessage+]
<form method="post" action="[~[*id*]~]" id="fdmForm">
<input type="hidden" name="formid" value="fdmForm" />
<input type="hidden" name="fdmid" value="[+fdmid+]" eform="::0::" />
<h1>New Event</h1>
<br>
Event Name:<input name="pagetitle" type="text" id="pagetitle" value="[+pagetitle+]" size="35" eform="Name cannot be empty:string:1" />
<br>
Event Start Date:
<input name="tvEasyEvents_Start" id="tvEasyEvents_Start" value="[+tvEasyEvents_Start+]" type="text" readonly="readonly" eform="Start Date cannot be empty:string:1" />
<a href="#" onClick="javascript: displayCalendar('tvEasyEvents_Start');" title="Click to display calendar">
<img align="absmiddle" src="manager/media/calendar/img/cal.gif" width="16" height="16" border="0" alt="Click to display calendar" /></a>
<a href="#" onClick="document.forms['fdmForm'].elements['tvEasyEvents_Start'].value=''; return true;" >
<img align="absmiddle" src="manager/media/style/MODx/images/icons/event3.gif" width="16" height="16" border="0" alt="Click to erase date"></a>
<br>
Event End Date:
<input name="tvEasyEvents_End" id="tvEasyEvents_End" value="[+tvEasyEvents_End+]" type="text" readonly="readonly" />
<a href="#" onClick="javascript: displayCalendar('tvEasyEvents_End');" title="Click to display calendar">
<img align="absmiddle" src="manager/media/calendar/img/cal.gif" width="16" height="16" border="0" alt="Click to display calendar" /></a>
<a href="#" onClick="document.forms['fdmForm'].elements['tvEasyEvents_End'].value=''; return true;" >
<img align="absmiddle" src="manager/media/style/MODx/images/icons/event3.gif" width="16" height="16" border="0" alt="Click to erase date"></a>
<br>
<br>
Hide time:
<select name="tvEasyEvents_HideTime" id="tvEasyEvents_HideTime">
<option value="">NO</option>
<option value="Hide">YES</option>
</select>
<br>
CONTENT:
<textarea name="content" cols="55" rows="15" id="content" eform="Content cannot be empty:html:1">[+content+]</textarea>
<br>
<input name="fdmsubmit" value="Publish Event" type="submit" />
<a href="[~[*parent*]~]" tile="Cancel">Cancel</a>
</form>
<script language="JavaScript" src="manager/media/script/datefunctions.js"></script>
<script type="text/javascript">
function displayCalendar(fieldName)
{
var elm_txt = {}; // dummy
var pub = document.forms["fdmForm"].elements["" + fieldName + ""];
var nwpub_cal1 = new calendar1(pub,elm_txt);
nwpub_cal1.path="[(base_url)]manager/media/";
nwpub_cal1.year_scroll = true;
nwpub_cal1.time_comp = true;
nwpub_cal1.popup();
}
</script>
And??
I wroteI’m using Tiny + FDM by inserting my Tiny JS code into fdmEform chunk.



I’m not sure what you mean by "I have the latest version of Chunkie", but there’s a conflict of Chunkie class when used with Jot.
OK got this working great now, One peoblem .. I am seeing @CODE nest to the button, I have the latest version of Chunkie .. can anyone help please? many thanks
Change all instances to the word "CChunkie" in /snippets/FDM/includes/fdm.class.inc.php and /snippets/FDM/includes/fdmchunkie.class.inc.php to "fdmCChunkie".