includes/clientside/tinymce/plugins/fullpage/editor_plugin_src.js
changeset 543 dffcbfbc4e59
parent 459 31c23016ab62
child 778 57ce13805b6f
equal deleted inserted replaced
542:5841df0ab575 543:dffcbfbc4e59
     1 /**
     1 /**
     2  * $Id: editor_plugin_src.js 593 2008-02-13 13:00:12Z spocke $
     2  * $Id: editor_plugin_src.js 827 2008-04-29 15:02:42Z spocke $
     3  *
     3  *
     4  * @author Moxiecode
     4  * @author Moxiecode
     5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
     5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
     6  */
     6  */
     7 
     7 
    76 				apply_source_formatting : true
    76 				apply_source_formatting : true
    77 			});
    77 			});
    78 		},
    78 		},
    79 
    79 
    80 		_setContent : function(ed, o) {
    80 		_setContent : function(ed, o) {
    81 			var t = this, sp, ep, c = o.content;
    81 			var t = this, sp, ep, c = o.content, v, st = '';
    82 
    82 
    83 			// Parse out head, body and footer
    83 			// Parse out head, body and footer
    84 			c = c.replace(/<(\/?)BODY/gi, '<$1body');
    84 			c = c.replace(/<(\/?)BODY/gi, '<$1body');
    85 			sp = c.indexOf('<body');
    85 			sp = c.indexOf('<body');
    86 
    86 
   102 				};
   102 				};
   103 
   103 
   104 				t.head = low(t.head);
   104 				t.head = low(t.head);
   105 				t.foot = low(t.foot);
   105 				t.foot = low(t.foot);
   106 			} else {
   106 			} else {
   107 				t.head = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
   107 				t.head = '';
   108 				t.head += '\n<html>\n<head>\n<title>Untitled document</title>\n</head>\n<body>\n';
   108 				if (ed.getParam('fullpage_default_xml_pi'))
       
   109 					t.head += '<?xml version="1.0" encoding="' + ed.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
       
   110 
       
   111 				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">');
       
   112 				t.head += '\n<html>\n<head>\n<title>' + ed.getParam('fullpage_default_title', 'Untitled document') + '</title>\n';
       
   113 
       
   114 				if (v = ed.getParam('fullpage_default_encoding'))
       
   115 					t.head += '<meta http-equiv="Content-Type" content="' + v + '" />\n';
       
   116 
       
   117 				if (v = ed.getParam('fullpage_default_font_family'))
       
   118 					st += 'font-family: ' + v + ';';
       
   119 
       
   120 				if (v = ed.getParam('fullpage_default_font_size'))
       
   121 					st += 'font-size: ' + v + ';';
       
   122 
       
   123 				if (v = ed.getParam('fullpage_default_text_color'))
       
   124 					st += 'color: ' + v + ';';
       
   125 
       
   126 				t.head += '</head>\n<body' + (st ? ' style="' + st + '"' : '') + '>\n';
   109 				t.foot = '\n</body>\n</html>';
   127 				t.foot = '\n</body>\n</html>';
   110 			}
   128 			}
   111 		},
   129 		},
   112 
   130 
   113 		_getContent : function(ed, o) {
   131 		_getContent : function(ed, o) {