[pLog-svn] r4386 - in plog/branches/lifetype-1.1.3/js/tinymce: . plugins/more

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Tue Dec 12 02:27:09 GMT 2006


Author: jondaley
Date: 2006-12-12 02:27:06 +0000 (Tue, 12 Dec 2006)
New Revision: 4386

Modified:
   plog/branches/lifetype-1.1.3/js/tinymce/plugins/more/editor_plugin.js
   plog/branches/lifetype-1.1.3/js/tinymce/tiny_mce-plog.js
Log:
fixed and enabled 'more' plugin.

Modified: plog/branches/lifetype-1.1.3/js/tinymce/plugins/more/editor_plugin.js
===================================================================
--- plog/branches/lifetype-1.1.3/js/tinymce/plugins/more/editor_plugin.js	2006-12-11 21:52:47 UTC (rev 4385)
+++ plog/branches/lifetype-1.1.3/js/tinymce/plugins/more/editor_plugin.js	2006-12-12 02:27:06 UTC (rev 4386)
@@ -5,7 +5,7 @@
 	getInfo : function() {
 		return {
 			longname : 'More',
-			author : 'Jon Daley (based on the WordPress plugin)',
+			author : 'Jon Daley (based on the WordPress plugin with the same name)',
 			authorurl : 'http://jon.limedaley.com',
 			infourl : 'N/A',
 			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
@@ -121,7 +121,7 @@
 
     cleanup : function(type, content) {
         switch (type) {
-	
+                // move from html editor to wysiwyg editor
             case "insert_to_editor":
 			var startPos = 0;
 			var altMore = tinyMCE.getLang('lang_more_more_alt');
@@ -129,7 +129,7 @@
                 // Parse all [@more@] tags and replace them with images
 			while ((startPos = content.indexOf('[@more@]', startPos)) != -1) {
                     // Insert image
-				var contentAfter = content.substring(startPos + 11);
+				var contentAfter = content.substring(startPos + 8);
 				content = content.substring(0, startPos);
 				content += '<img src="' + (tinyMCE.getParam("theme_href") + 
                                            "/images/spacer.gif") + '" ';
@@ -140,14 +140,11 @@
 
 				startPos++;
 			}
-
-                // It's supposed to be WYSIWYG, right?
-			content = content.replace(new RegExp('&', 'g'), '&amp;');
-
 			break;
 
+                // move from wysiwyg editor to html editor
             case "get_from_editor":
-                // Parse all img tags and replace them with [@more@]
+                // Parse all img tags and replace the "more" image with [@more@]
 			var startPos = -1;
 			while ((startPos = content.indexOf('<img', startPos+1)) != -1) {
 				var endPos = content.indexOf('/>', startPos);
@@ -165,32 +162,6 @@
 					content = chunkBefore + embedHTML + chunkAfter;
 				}
 			}
-
-                // If it says & in the WYSIWYG editor, 
-                // it should say &amp; in the html.
-			content = content.replace(new RegExp('&', 'g'), '&amp;');
-			content = content.replace(new RegExp('&amp;nbsp;', 'g'), '&nbsp;');
-
-                // Remove anonymous, empty paragraphs.
-			content = content.replace(new RegExp('<p>(\\s|&nbsp;)*</p>', 'mg'), '');
-
-                // Handle table badness.
-			content = content.replace(new RegExp('<(table( [^>]*)?)>.*?<((tr|thead)( [^>]*)?)>', 'mg'), '<$1><$3>');
-			content = content.replace(new RegExp('<(tr|thead|tfoot)>.*?<((td|th)( [^>]*)?)>', 'mg'), '<$1><$2>');
-			content = content.replace(new RegExp('</(td|th)>.*?<(td( [^>]*)?|th( [^>]*)?|/tr|/thead|/tfoot)>', 'mg'), '</$1><$2>');
-			content = content.replace(new RegExp('</tr>.*?<(tr|/table)>', 'mg'), '</tr><$1>');
-			content = content.replace(new RegExp('<(/?(table|tbody|tr|th|td)[^>]*)>(\\s*|(<br ?/?>)*)*', 'g'), '<$1>');
-
-                // Pretty it up for the source editor.
-			var blocklist = 'blockquote|ul|ol|li|table|thead|tr|th|td|div|h\\d|pre|p';
-			content = content.replace(new RegExp('\\s*</('+blocklist+')>\\s*', 'mg'), '</$1>\n');
-			content = content.replace(new RegExp('\\s*<(('+blocklist+')[^>]*)>\\s*', 'mg'), '\n<$1>');
-			content = content.replace(new RegExp('<((li|/?tr|/?thead|/?tfoot)( [^>]*)?)>', 'g'), '\t<$1>');
-			content = content.replace(new RegExp('<((td|th)( [^>]*)?)>', 'g'), '\t\t<$1>');
-			content = content.replace(new RegExp('\\s*<br ?/?>\\s*', 'mg'), '<br />\n');
-			content = content.replace(new RegExp('^\\s*', ''), '');
-			content = content.replace(new RegExp('\\s*$', ''), '');
-
 			break;
         }
 

Modified: plog/branches/lifetype-1.1.3/js/tinymce/tiny_mce-plog.js
===================================================================
--- plog/branches/lifetype-1.1.3/js/tinymce/tiny_mce-plog.js	2006-12-11 21:52:47 UTC (rev 4385)
+++ plog/branches/lifetype-1.1.3/js/tinymce/tiny_mce-plog.js	2006-12-12 02:27:06 UTC (rev 4386)
@@ -2,14 +2,14 @@
 	mode : "exact",
 	elements : "postText,postExtendedText",
 	theme : "advanced",
-	plugins : "fullscreen,table,inlinepopups,insertdatetime,emotions,insertresource,insertvideo",
+	plugins : "fullscreen,table,inlinepopups,insertdatetime,emotions,insertresource,insertvideo,more",
 	relative_urls : false,
     fix_list_elements : true,
 	remove_script_host : false,
 	force_p_newlines : true,
 	cleanup_on_startup : true,	
 	theme_advanced_buttons1 : "fontsizeselect,fontselect,forecolor,backcolor,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull",
-	theme_advanced_buttons2 : "bullist,numlist,indent,outdent,separator,link,unlink,image,insertresource,insertvideo,emotions,separator,hr,insertdate,inserttime,separator,fullscreen,separator,code",
+	theme_advanced_buttons2 : "bullist,numlist,indent,outdent,separator,link,unlink,image,insertresource,insertvideo,emotions,separator,hr,insertdate,inserttime,separator,fullscreen,separator,code,more",
 	theme_advanced_buttons3 : "",
 	fullscreen_settings : {
                 theme_advanced_buttons3 : "tablecontrols"



More information about the pLog-svn mailing list