From 7b8a354160b01ebc9c4ca56c728905f6149e7fe9 Mon Sep 17 00:00:00 2001 From: pete Date: Fri, 5 Mar 2010 12:13:27 +0000 Subject: Updated tinymce to new interface git-svn-id: http://code.elgg.org/elgg/trunk@5287 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/tinymce/graphics/ed-bg.gif | Bin 0 -> 190 bytes mod/tinymce/graphics/example.gif | Bin 0 -> 87 bytes mod/tinymce/graphics/more.gif | Bin 0 -> 108 bytes mod/tinymce/manifest.xml | 2 +- mod/tinymce/views/default/input/longtext.php | 29 +++++++++++++- mod/tinymce/views/default/tinymce/css.php | 56 ++++++++++++++++++++------- 6 files changed, 71 insertions(+), 16 deletions(-) create mode 100644 mod/tinymce/graphics/ed-bg.gif create mode 100644 mod/tinymce/graphics/example.gif create mode 100644 mod/tinymce/graphics/more.gif (limited to 'mod') diff --git a/mod/tinymce/graphics/ed-bg.gif b/mod/tinymce/graphics/ed-bg.gif new file mode 100644 index 000000000..a00467c29 Binary files /dev/null and b/mod/tinymce/graphics/ed-bg.gif differ diff --git a/mod/tinymce/graphics/example.gif b/mod/tinymce/graphics/example.gif new file mode 100644 index 000000000..1ab5da446 Binary files /dev/null and b/mod/tinymce/graphics/example.gif differ diff --git a/mod/tinymce/graphics/more.gif b/mod/tinymce/graphics/more.gif new file mode 100644 index 000000000..4ff564d58 Binary files /dev/null and b/mod/tinymce/graphics/more.gif differ diff --git a/mod/tinymce/manifest.xml b/mod/tinymce/manifest.xml index db4f21d2f..139d5b7a4 100644 --- a/mod/tinymce/manifest.xml +++ b/mod/tinymce/manifest.xml @@ -1,7 +1,7 @@ - + diff --git a/mod/tinymce/views/default/input/longtext.php b/mod/tinymce/views/default/input/longtext.php index e49c6190e..be6bceacd 100644 --- a/mod/tinymce/views/default/input/longtext.php +++ b/mod/tinymce/views/default/input/longtext.php @@ -32,15 +32,40 @@ tinyMCE.init({ mode : "textareas", theme : "advanced", + plugins : "safari,spellchecker,autosave,fullscreen,preview,paste", relative_urls : false, - theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,bullist,numlist,undo,redo,link,unlink,image,blockquote,code", + theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,bullist,numlist,undo,redo,link,unlink,image,blockquote,code,pastetext,pasteword,more,fullscreen,", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, - extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|style],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]" + theme_advanced_path : true, + extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|style],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", + setup : function(ed) { + // Add a custom button + //ed.addButton('more', { + // title : 'more', + // image : 'mod/tinymce/graphics/more.gif', + // onclick : function() { + // ed.selection.setContent('{{more}}'); + // } + //}); + + //show the number of words + ed.onLoadContent.add(function(ed, o) { + var strip = (tinyMCE.activeEditor.getContent()).replace(/(<([^>]+)>)/ig,""); + var text = " Word count:" + strip.split(' ').length; + tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + '_path_row'), text); + }); + + ed.onKeyUp.add(function(ed, e) { + var strip = (tinyMCE.activeEditor.getContent()).replace(/(<([^>]+)>)/ig,""); + var text = " Word count:" + strip.split(' ').length; + tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + '_path_row'), text); + }); + } }); function toggleEditor(id) { if (!tinyMCE.get(id)) diff --git a/mod/tinymce/views/default/tinymce/css.php b/mod/tinymce/views/default/tinymce/css.php index 121c24440..b524040e5 100644 --- a/mod/tinymce/views/default/tinymce/css.php +++ b/mod/tinymce/views/default/tinymce/css.php @@ -1,17 +1,47 @@ -blockquote { - margin:10px; - border:1px solid #efefef; - padding:4px; +#elgg_page_contents .mceButton { +background-color: #e9e8e8; + border-color: #B2B2B2; + margin:4px; + padding:2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; } - -strong { - font-weight:bold; +#elgg_page_contents a.mceButtonEnabled:hover, +#elgg_page_contents a.mceButtonActive, +#elgg_page_contents a.mceButtonSelected { + background-color: #d5d5d5; + border-color: #777 !important; } - -ul { - list-style: disc; +#elgg_page_contents .mceFocus .mceTop .mceLeft { + background: #444444; + border-left: 1px solid #999; + border-top: 1px solid #999; + -moz-border-radius: 4px 0 0 0; + -webkit-border-top-left-radius: 4px; + -khtml-border-top-left-radius: 4px; + border-top-left-radius: 4px; } - -ol { - list-style: decimal; +#elgg_page_contents .mceFocus .mceTop .mceRight { + background: #444444; + border-right: 1px solid #999; + border-top: 1px solid #999; + border-top-right-radius: 4px; + -khtml-border-top-right-radius: 4px; + -webkit-border-top-right-radius: 4px; + -moz-border-radius: 0 4px 0 0; +} +#elgg_page_contents .mceLayout{ +border: 1px solid #CCC; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; +} +#elgg_page_contents table.mceLayout tr.mceFirst td {border-top:0px solid #CCC} +#elgg_page_contents table.mceLayout tr.mceLast td {border-bottom:0px solid #CCC} +#elgg_page_contents #blogbody_toolbar1{} +#elgg_page_contents .mceToolbar{} +#elgg_page_contents #blogbody_ifr{height:400px !important;} /* blogs */ +#pagesForm #description_ifr {height:400px !important;} /* pages */ +#elgg_page_contents .mceIframeContainer{} +.wp_themeSkin .mceButtonDisabled { + border-color: #ccc !important; } \ No newline at end of file -- cgit v1.2.3