includes/clientside/tinymce/plugins/fullpage/editor_plugin_src.js
changeset 543 dffcbfbc4e59
parent 459 31c23016ab62
child 778 57ce13805b6f
--- a/includes/clientside/tinymce/plugins/fullpage/editor_plugin_src.js	Mon May 05 20:06:37 2008 -0400
+++ b/includes/clientside/tinymce/plugins/fullpage/editor_plugin_src.js	Mon May 05 20:08:44 2008 -0400
@@ -1,5 +1,5 @@
 /**
- * $Id: editor_plugin_src.js 593 2008-02-13 13:00:12Z spocke $
+ * $Id: editor_plugin_src.js 827 2008-04-29 15:02:42Z spocke $
  *
  * @author Moxiecode
  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
@@ -78,7 +78,7 @@
 		},
 
 		_setContent : function(ed, o) {
-			var t = this, sp, ep, c = o.content;
+			var t = this, sp, ep, c = o.content, v, st = '';
 
 			// Parse out head, body and footer
 			c = c.replace(/<(\/?)BODY/gi, '<$1body');
@@ -104,8 +104,26 @@
 				t.head = low(t.head);
 				t.foot = low(t.foot);
 			} else {
-				t.head = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
-				t.head += '\n<html>\n<head>\n<title>Untitled document</title>\n</head>\n<body>\n';
+				t.head = '';
+				if (ed.getParam('fullpage_default_xml_pi'))
+					t.head += '<?xml version="1.0" encoding="' + ed.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
+
+				t.head += ed.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
+				t.head += '\n<html>\n<head>\n<title>' + ed.getParam('fullpage_default_title', 'Untitled document') + '</title>\n';
+
+				if (v = ed.getParam('fullpage_default_encoding'))
+					t.head += '<meta http-equiv="Content-Type" content="' + v + '" />\n';
+
+				if (v = ed.getParam('fullpage_default_font_family'))
+					st += 'font-family: ' + v + ';';
+
+				if (v = ed.getParam('fullpage_default_font_size'))
+					st += 'font-size: ' + v + ';';
+
+				if (v = ed.getParam('fullpage_default_text_color'))
+					st += 'color: ' + v + ';';
+
+				t.head += '</head>\n<body' + (st ? ' style="' + st + '"' : '') + '>\n';
 				t.foot = '\n</body>\n</html>';
 			}
 		},