upgrading tinymce to 2.0.5.1
This commit is contained in:
parent
cb2a8d025e
commit
00d46f6148
342 changed files with 13043 additions and 11487 deletions
|
|
@ -9,8 +9,6 @@
|
|||
theme : "advanced",
|
||||
mode : "exact",
|
||||
elements : "elm1,elm2",
|
||||
//insertlink_callback : "customInsertLink",
|
||||
//insertimage_callback : "customInsertImage",
|
||||
save_callback : "customSave",
|
||||
content_css : "example_advanced.css",
|
||||
extended_valid_elements : "a[href|target|name]",
|
||||
|
|
@ -18,46 +16,39 @@
|
|||
theme_advanced_buttons3_add_before : "tablecontrols,separator",
|
||||
//invalid_elements : "a",
|
||||
theme_advanced_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1", // Theme specific setting CSS classes
|
||||
//execcommand_callback : "myCustomExecCommandHandler",
|
||||
debug : false
|
||||
});
|
||||
|
||||
// Custom insert link callback, extends the link function
|
||||
function customInsertLink(href, target) {
|
||||
var result = new Array();
|
||||
// Custom event handler
|
||||
function myCustomExecCommandHandler(editor_id, elm, command, user_interface, value) {
|
||||
var linkElm, imageElm, inst;
|
||||
|
||||
alert("customInsertLink called href: " + href + " target: " + target);
|
||||
switch (command) {
|
||||
case "mceLink":
|
||||
inst = tinyMCE.getInstanceById(editor_id);
|
||||
linkElm = tinyMCE.getParentElement(inst.selection.getFocusElement(), "a");
|
||||
|
||||
result['href'] = "http://www.sourceforge.net";
|
||||
result['target'] = '_blank';
|
||||
if (linkElm)
|
||||
alert("Link dialog has been overriden. Found link href: " + tinyMCE.getAttrib(linkElm, "href"));
|
||||
else
|
||||
alert("Link dialog has been overriden.");
|
||||
|
||||
return result;
|
||||
}
|
||||
return true;
|
||||
|
||||
// Custom insert image callback, extends the image function
|
||||
function customInsertImage(src, alt, border, hspace, vspace, width, height, align) {
|
||||
var result = new Array();
|
||||
case "mceImage":
|
||||
inst = tinyMCE.getInstanceById(editor_id);
|
||||
imageElm = tinyMCE.getParentElement(inst.selection.getFocusElement(), "img");
|
||||
|
||||
var debug = "CustomInsertImage called:\n"
|
||||
debug += "src: " + src + "\n";
|
||||
debug += "alt: " + alt + "\n";
|
||||
debug += "border: " + border + "\n";
|
||||
debug += "hspace: " + hspace + "\n";
|
||||
debug += "vspace: " + vspace + "\n";
|
||||
debug += "width: " + width + "\n";
|
||||
debug += "height: " + height + "\n";
|
||||
debug += "align: " + align + "\n";
|
||||
alert(debug);
|
||||
if (imageElm)
|
||||
alert("Image dialog has been overriden. Found image src: " + tinyMCE.getAttrib(imageElm, "src"));
|
||||
else
|
||||
alert("Image dialog has been overriden.");
|
||||
|
||||
result['src'] = "logo.jpg";
|
||||
result['alt'] = "test description";
|
||||
result['border'] = "2";
|
||||
result['hspace'] = "5";
|
||||
result['vspace'] = "5";
|
||||
result['width'] = width;
|
||||
result['height'] = height;
|
||||
result['align'] = "right";
|
||||
return true;
|
||||
}
|
||||
|
||||
return result;
|
||||
return false; // Pass to next handler in chain
|
||||
}
|
||||
|
||||
// Custom save callback, gets called when the contents is to be submitted
|
||||
|
|
@ -100,9 +91,9 @@ Some custom actions:
|
|||
<a href="javascript:tinyMCE.execCommand('Bold');">[Bold]</a> |
|
||||
<a href="javascript:tinyMCE.execCommand('Italic');">[Italic]</a>
|
||||
<a href="javascript:void(0);" onclick="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');">[Insert some HTML]</a>
|
||||
<a href="javascript:void(0);" onclick="tinyMCE.execCommand('mceReplaceContent',false,'<!-- xxx --><b>{$selection}</b>');">[Replace selection]</a>
|
||||
<a href="javascript:void(0);" onclick="tinyMCE.execCommand('mceReplaceContent',false,'<!-- comment --><b>{$selection}</b>');">[Replace selection]</a>
|
||||
|
||||
<br />
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -7,28 +7,26 @@
|
|||
tinyMCE.init({
|
||||
mode : "textareas",
|
||||
theme : "advanced",
|
||||
plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,paste,directionality,fullscreen,noneditable,contextmenu",
|
||||
plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,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,zoom,separator,forecolor,backcolor,liststyle",
|
||||
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",
|
||||
theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,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_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_path_location : "bottom",
|
||||
content_css : "example_full.css",
|
||||
plugin_insertdate_dateFormat : "%Y-%m-%d",
|
||||
plugin_insertdate_timeFormat : "%H:%M:%S",
|
||||
extended_valid_elements : "hr[class|width|size|noshade]",
|
||||
extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
|
||||
external_link_list_url : "example_link_list.js",
|
||||
external_image_list_url : "example_image_list.js",
|
||||
flash_external_list_url : "example_flash_list.js",
|
||||
file_browser_callback : "fileBrowserCallBack",
|
||||
paste_use_dialog : false,
|
||||
theme_advanced_resizing : true,
|
||||
theme_advanced_resize_horizontal : false,
|
||||
theme_advanced_link_targets : "_something=My somthing;_something2=My somthing2;_something3=My somthing3;"
|
||||
theme_advanced_resizing : true
|
||||
});
|
||||
|
||||
function fileBrowserCallBack(field_name, url, type, win) {
|
||||
|
|
@ -62,4 +60,4 @@
|
|||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -29,13 +29,16 @@ element gets converted to a editor instance on page load. Notice how TinyMCE tri
|
|||
<img src="logo.jpg">
|
||||
</textarea>
|
||||
|
||||
<br /><br />
|
||||
<br />
|
||||
|
||||
<textarea id="elm2" name="elm2" rows="15" cols="32">
|
||||
Some <b>element</b>, this is to be editor 2.
|
||||
<p>Some paragraph. <a href="http://www.sourceforge.net">Some link</a></p>
|
||||
<img src="logo.jpg">
|
||||
</textarea>
|
||||
<br />
|
||||
<input type="submit" name="save" value="Submit" />
|
||||
<input type="reset" name="reset" value="Reset" />
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -39,23 +39,23 @@ pre {
|
|||
|
||||
/* Fix for MS Office style paragraphs (MsoNormal) */
|
||||
p {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Fix for MS Office unindeted lists */
|
||||
.unIndentedList {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
.unIndentedList li {
|
||||
padding: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Fix for MS Office UL lists */
|
||||
ul {
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
content_css : "example_word.css",
|
||||
plugi2n_insertdate_dateFormat : "%Y-%m-%d",
|
||||
plugi2n_insertdate_timeFormat : "%H:%M:%S",
|
||||
extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
|
||||
external_link_list_url : "example_link_list.js",
|
||||
external_image_list_url : "example_image_list.js",
|
||||
flash_external_list_url : "example_flash_list.js",
|
||||
|
|
@ -31,7 +30,9 @@
|
|||
theme_advanced_link_targets : "_something=My somthing;_something2=My somthing2;_something3=My somthing3;",
|
||||
paste_auto_cleanup_on_paste : true,
|
||||
paste_convert_headers_to_strong : false,
|
||||
paste_strip_class_attributes : "all"
|
||||
paste_strip_class_attributes : "all",
|
||||
paste_remove_spans : false,
|
||||
paste_remove_styles : false
|
||||
});
|
||||
|
||||
function fileBrowserCallBack(field_name, url, type, win) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue