Bravado
Coding Team

Posts: 1,078
"I can learn to resist anything but temptation..."
|
 |
« on: Jun 26, 2006, 03:58 PM » |
|
This is an auto-generated support/comment thread for TinyMCE. Use this forum to post any comments about this addition or any questions you have regarding its use. Brief Description: Adds the TinyMCE richtext editor to MODx.
|
|
|
|
« Last Edit: Jul 03, 2006, 05:58 PM by garryn »
|
Logged
|
Jeff Whitfield
"When someone asks you, A penny for your thoughts, and you put your two cents in, what happens to the other penny?"
-George Carlin
|
|
|
Duane
Member
 
Posts: 51
|
 |
« Reply #1 on: Jul 10, 2006, 11:23 AM » |
|
I have a series of product pages where the product is shown as a thumbnail and uses lightbox-plus to open a larger view.
Whenever I do any editing on this page, the lightbox effect disappears, and after some experimenting I have determined it's because MCE is stripping the rel="lightbox" call out of the <a> tag.
If I try to re-insert the rel="lightbox" in the HTML code view of MCE, it doesn't save it. In fact, the only way I can get the rel="lightbox" back into the <a> tag is to manually insert it into the database with PHP MyAdmin.
Why is this happening? Is there some setting that strips tag properties not generated by the image insertion function?
I can't find anything about this at MoxieCode, so I was hoping someone here would know.
Thanks, Duane
|
|
|
|
|
Logged
|
|
|
|
doze
Coding Team

Posts: 3,237
....Boom!
|
 |
« Reply #2 on: Jul 11, 2006, 07:09 AM » |
|
Maybe need to edit the valid_elemets configuration setting to allow rel attribute in link tags. But I'm sure you can save the rel attribute from manager if you just disable the editor for that document (in the "page settings" tab, "rich text" checkbox).
|
|
|
|
|
Logged
|
|
|
|
Bravado
Coding Team

Posts: 1,078
"I can learn to resist anything but temptation..."
|
 |
« Reply #3 on: Jul 11, 2006, 10:35 AM » |
|
Doze, you pretty much have it right on the money. However, rather than using the valid_elements config setting, I think the extended_valid_elements config setting should be used instead. If you look at the plugin code, you'll see a line like this: extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", It's pretty easy to figure out what's what on this line. To add support for the "rel" attribute for "a" tags, you could simply add in the "rel" attribute to the the part of the line dealing with anchor tags (a[name|href|target|title|onclick|rel]). Just modify the code like that and you should be set. Probably what I'll do for the next revision is add in the valid_elements config setting to where just about every valid element in the XHTML specification is covered. That way we won't have a bunch of elements constantly being replaced on users. More to come.... Jeff
|
|
|
|
|
Logged
|
Jeff Whitfield
"When someone asks you, A penny for your thoughts, and you put your two cents in, what happens to the other penny?"
-George Carlin
|
|
|
Duane
Member
 
Posts: 51
|
 |
« Reply #4 on: Jul 11, 2006, 01:44 PM » |
|
Doze, you pretty much have it right on the money. However, rather than using the valid_elements config setting, I think the extended_valid_elements config setting should be used instead. If you look at the plugin code, you'll see a line like this: extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", It's pretty easy to figure out what's what on this line. To add support for the "rel" attribute for "a" tags, you could simply add in the "rel" attribute to the the part of the line dealing with anchor tags (a[name|href|target|title|onclick|rel]). Just modify the code like that and you should be set. Probably what I'll do for the next revision is add in the valid_elements config setting to where just about every valid element in the XHTML specification is covered. That way we won't have a bunch of elements constantly being replaced on users. More to come.... Jeff This worked perfectly! Thank you. Duane
|
|
|
|
|
Logged
|
|
|
|
|
|
Bravado
Coding Team

Posts: 1,078
"I can learn to resist anything but temptation..."
|
 |
« Reply #6 on: Jul 13, 2006, 08:59 AM » |
|
One step ahead of ya, Yama! I've added the Japanese language file. I just need to test it right quick and update the current version in the repository. 
|
|
|
|
|
Logged
|
Jeff Whitfield
"When someone asks you, A penny for your thoughts, and you put your two cents in, what happens to the other penny?"
-George Carlin
|
|
|
|
Marschant
|
 |
« Reply #7 on: Jul 13, 2006, 03:45 PM » |
|
Last night I upgraded to tinymce 2.0.6.1 from 2.0.4 and now the element path is no longer working, here's my init call: $fullScript = <<<FULL_SCRIPT <script language="javascript" type="text/javascript" src="{$base_url}assets/plugins/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script language="javascript" type="text/javascript"> tinyMCE.init({ theme : "advanced", mode : "exact", relative_urls : {$relative_urls}, {$document_base_url} remove_script_host : {$remove_script_host}, language : "{$tinymce_language}", nowrap : false, object_resizing : false, fix_content_duplication : true, force_p_newlines : false, force_br_newlines : false, remove_linebreaks : false, apply_source_formatting : false, fix_list_elements : true, $elmList $webWidth $webHeight plugins : "style,layer,table,advhr,advimage,advlink,insertdatetime,preview,flash,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable", theme_advanced_buttons1_add_before : "separator,save,newdocument,separator", theme_advanced_buttons1_add : "", theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor", theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator,pastetext,pasteword,selectall,separator", theme_advanced_buttons3_add_before: "tablecontrols,separator", theme_advanced_buttons3_add : "iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops", theme_advanced_toolbar_location : "bottom", theme_advanced_toolbar_align : "left", theme_advanced_path_location : "top", theme_advanced_source_editor_width : "768", theme_advanced_source_editor_height : "576", theme_advanced_source_editor_wrap : true, plugin_insertdate_dateFormat : "%Y-%m-%d", plugin_insertdate_timeFormat : "%H:%M:%S", extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", $cssPath $cssSelector onchange_callback : "tvOnTinyMCEChangeCallBack", resource_browser_path : "{$base_url}manager/media/browser/mcpuk/browser.html?Connector={$base_url}manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath={$base_url}", $fileBrowserCallback }); Anybody else experienced this or know of a way to correct this?
|
|
|
|
|
Logged
|
|
|
|
Bravado
Coding Team

Posts: 1,078
"I can learn to resist anything but temptation..."
|
 |
« Reply #8 on: Jul 14, 2006, 08:29 AM » |
|
Element path? I'm not sure what you mean. Could you post the HTML code from an instance of TinyMCE after rendering? The code might look like this: <script language="javascript" type="text/javascript" src="/assets/plugins/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script language="javascript" type="text/javascript"> tinyMCE.init({ theme : "advanced", mode : "exact", relative_urls : true, document_base_url : "/", remove_script_host : true, language : "en", elements : "ta,tvhi_sidebar", plugins : "style,layer,table,advhr,advimage,advlink,emotions,insertdatetime,preview,flash,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable", theme_advanced_buttons1_add_before : "save,newdocument,separator", theme_advanced_buttons1_add : "fontselect,fontsizeselect", theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor", theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator,pastetext,pasteword,selectall,separator", theme_advanced_buttons3_add_before: "tablecontrols,separator", theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_path_location : "bottom", plugin_insertdate_dateFormat : "%Y-%m-%d", plugin_insertdate_timeFormat : "%H:%M:%S", extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", preformatted : true, onchange_callback : "tvOnTinyMCEChangeCallBack", resource_browser_path : "/manager/media/browser/mcpuk/browser.html?Connector=/manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=/", file_browser_callback : "fileBrowserCallBack" }); function fileBrowserCallBack(field_name, url, type, win) { // This is where you insert your custom filebrowser logic var win=tinyMCE.getWindowArg("window"); win.BrowseServer(field_name); }
function tvOnTinyMCEChangeCallBack(i){ i.oldTargetElement.onchange(); } </script> This will help me get a better idea how it's being parsed on your end. Thanks! 
|
|
|
|
|
Logged
|
Jeff Whitfield
"When someone asks you, A penny for your thoughts, and you put your two cents in, what happens to the other penny?"
-George Carlin
|
|
|
|
Marschant
|
 |
« Reply #9 on: Jul 14, 2006, 08:44 AM » |
|
Basically it's the block the display the html structure of the content i.e. path block shows div > p when you have a paragraph within a div selected. I disabled the new layer plugin as well as some others that I didn't need and all of a sudden the path displayed correctly. Very weird....
|
|
|
|
|
Logged
|
|
|
|
Bravado
Coding Team

Posts: 1,078
"I can learn to resist anything but temptation..."
|
 |
« Reply #10 on: Jul 14, 2006, 11:30 AM » |
|
Hmm...that is strange. Let me know which plugin(s) you disabled and I'll change the code a bit. I'm thinking that perhaps I need to add a few options that allows a user to select which plugins they want to utilize. If the layer plugin isn't working right...well...might as well make it an optional thing. 
|
|
|
|
|
Logged
|
Jeff Whitfield
"When someone asks you, A penny for your thoughts, and you put your two cents in, what happens to the other penny?"
-George Carlin
|
|
|
yama
Moderators

Posts: 539
MODx研究中
|
 |
« Reply #11 on: Jul 14, 2006, 08:16 PM » |
|
Please rewrite a part of the code of the treatment of Japanese LangFiles. plugin.tinymce.tpl, line51. case "japanese-utf8": $returnlang = "ja"; break; rewrite this. case "japanese-utf8": $returnlang = "ja_utf-8"; break;
case "japanese-euc": $returnlang = "ja_euc-jp"; break;  Thanks
|
|
|
|
Logged
|
|
|
|
Bravado
Coding Team

Posts: 1,078
"I can learn to resist anything but temptation..."
|
 |
« Reply #12 on: Jul 15, 2006, 09:42 AM » |
|
Consider it done, Yama!  I reuploaded the zip file and updated the comments on the repository. Didn't feel it was necessary creating a whole new version for this particular change. But, it's up there! Have fun! 
|
|
|
|
|
Logged
|
Jeff Whitfield
"When someone asks you, A penny for your thoughts, and you put your two cents in, what happens to the other penny?"
-George Carlin
|
|
|
Dimmy
Testers

Posts: 1,824
Я не говорю по-русски 私は日本語を話さない
|
 |
« Reply #13 on: Jul 17, 2006, 01:36 PM » |
|
I get the foloing error when loading the settings screen: TinyMCE - OnInterfaceSettingsRender An error occurred while loading. Please see the event log for more information. 
--------------------------------------------------------------------------------
then this is in the events list: Undefined index: fe_editor_lang

I updated to the latest version. Dimmy
|
|
|
|
|
Logged
|
|
|
|
Bravado
Coding Team

Posts: 1,078
"I can learn to resist anything but temptation..."
|
 |
« Reply #14 on: Jul 17, 2006, 04:04 PM » |
|
Thanks, Dimmy. I'll double-check the code and update it. Looks like I need to add a check for a MODx setting that doesn't exist yet for backwards compatibility with the current version of MODx. Funny...doesn't produce an error on my install. I'm uploading a fix for it anyways though.
|
|
|
|
|
Logged
|
Jeff Whitfield
"When someone asks you, A penny for your thoughts, and you put your two cents in, what happens to the other penny?"
-George Carlin
|
|
|
|