tinymce/3rdparty/plugins/fullpage/js/fullpage.js
author Dan Fuhry <dan@enanocms.org>
Thu, 02 Jun 2011 06:24:03 -0400
changeset 0 c78d206bf01c
permissions -rw-r--r--
First commit... it works I guess
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     1
tinyMCEPopup.requireLangPack();
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     2
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     3
var doc;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     4
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     5
var defaultDocTypes = 
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     6
	'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     7
	'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     8
	'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     9
	'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    10
	'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    11
	'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    12
	'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    13
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    14
var defaultEncodings = 
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    15
	'Western european (iso-8859-1)=iso-8859-1,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    16
	'Central European (iso-8859-2)=iso-8859-2,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    17
	'Unicode (UTF-8)=utf-8,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    18
	'Chinese traditional (Big5)=big5,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    19
	'Cyrillic (iso-8859-5)=iso-8859-5,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    20
	'Japanese (iso-2022-jp)=iso-2022-jp,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    21
	'Greek (iso-8859-7)=iso-8859-7,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    22
	'Korean (iso-2022-kr)=iso-2022-kr,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    23
	'ASCII (us-ascii)=us-ascii';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    24
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    25
var defaultMediaTypes = 
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    26
	'all=all,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    27
	'screen=screen,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    28
	'print=print,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    29
	'tty=tty,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    30
	'tv=tv,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    31
	'projection=projection,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    32
	'handheld=handheld,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    33
	'braille=braille,' +
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    34
	'aural=aural';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    35
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    36
var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    37
var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    38
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    39
function init() {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    40
	var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    41
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    42
	// Setup doctype select box
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    43
	doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(',');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    44
	for (i=0; i<doctypes.length; i++) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    45
		p = doctypes[i].split('=');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    46
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    47
		if (p.length > 1)
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    48
			addSelectValue(f, 'doctypes', p[0], p[1]);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    49
	}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    50
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    51
	// Setup fonts select box
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    52
	fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    53
	for (i=0; i<fonts.length; i++) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    54
		p = fonts[i].split('=');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    55
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    56
		if (p.length > 1)
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    57
			addSelectValue(f, 'fontface', p[0], p[1]);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    58
	}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    59
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    60
	// Setup fontsize select box
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    61
	fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(',');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    62
	for (i=0; i<fonts.length; i++)
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    63
		addSelectValue(f, 'fontsize', fonts[i], fonts[i]);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    64
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    65
	// Setup mediatype select boxs
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    66
	mediaTypes = ed.getParam("fullpage_media_types", defaultMediaTypes).split(',');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    67
	for (i=0; i<mediaTypes.length; i++) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    68
		p = mediaTypes[i].split('=');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    69
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    70
		if (p.length > 1) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    71
			addSelectValue(f, 'element_style_media', p[0], p[1]);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    72
			addSelectValue(f, 'element_link_media', p[0], p[1]);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    73
		}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    74
	}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    75
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    76
	// Setup encodings select box
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    77
	encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(',');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    78
	for (i=0; i<encodings.length; i++) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    79
		p = encodings[i].split('=');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    80
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    81
		if (p.length > 1) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    82
			addSelectValue(f, 'docencoding', p[0], p[1]);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    83
			addSelectValue(f, 'element_script_charset', p[0], p[1]);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    84
			addSelectValue(f, 'element_link_charset', p[0], p[1]);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    85
		}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    86
	}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    87
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    88
	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    89
	document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    90
	//document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    91
	document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    92
	document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    93
	document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    94
	document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    95
	document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    96
	document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    97
	document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    98
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    99
	// Resize some elements
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   100
	if (isVisible('stylesheetbrowser'))
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   101
		document.getElementById('stylesheet').style.width = '220px';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   102
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   103
	if (isVisible('link_href_browser'))
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   104
		document.getElementById('element_link_href').style.width = '230px';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   105
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   106
	if (isVisible('bgimage_browser'))
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   107
		document.getElementById('bgimage').style.width = '210px';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   108
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   109
	// Add iframe
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   110
	dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}});
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   111
	doc = dom.get('documentIframe').contentWindow.document;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   112
	h = tinyMCEPopup.getWindowArg('head_html');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   113
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   114
	// Preprocess the HTML disable scripts and urls
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   115
	h = h.replace(/<script>/gi, '<script type="text/javascript">');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   116
	h = h.replace(/type=([\"\'])?/gi, 'type=$1-mce-');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   117
	h = h.replace(/(src=|href=)/g, 'mce_$1');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   118
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   119
	// Write in the content in the iframe
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   120
	doc.write(h + '</body></html>');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   121
	doc.close();
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   122
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   123
	// Parse xml and doctype
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   124
	xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   125
	xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   126
	docType = getReItem(/<\!DOCTYPE.*?>/gi, h.replace(/\n/g, ''), 0).replace(/ +/g, ' ');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   127
	f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   128
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   129
	// Parse title
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   130
	if (e = doc.getElementsByTagName('title')[0])
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   131
		el.metatitle.value = e.textContent || e.text;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   132
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   133
	// Parse meta
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   134
	tinymce.each(doc.getElementsByTagName('meta'), function(n) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   135
		var na = (n.getAttribute('name', 2) || '').toLowerCase(), va = n.getAttribute('content', 2), eq = n.getAttribute('httpEquiv', 2) || '';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   136
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   137
		e = el['meta' + na];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   138
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   139
		if (na == 'robots') {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   140
			selectByValue(f, 'metarobots', tinymce.trim(va), true, true);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   141
			return;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   142
		}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   143
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   144
		switch (eq.toLowerCase()) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   145
			case "content-type":
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   146
				tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, va, 1);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   147
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   148
				// Override XML encoding
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   149
				if (tmp != "")
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   150
					xmlEnc = tmp;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   151
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   152
				return;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   153
		}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   154
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   155
		if (e)
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   156
			e.value = va;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   157
	});
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   158
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   159
	selectByValue(f, 'doctypes', docType, true, true);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   160
	selectByValue(f, 'docencoding', xmlEnc, true, true);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   161
	selectByValue(f, 'langdir', doc.body.getAttribute('dir', 2) || '', true, true);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   162
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   163
	if (xmlVer != '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   164
		el.xml_pi.checked = true;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   165
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   166
	// Parse appearance
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   167
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   168
	// Parse primary stylesheet
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   169
	tinymce.each(doc.getElementsByTagName("link"), function(l) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   170
		var m = l.getAttribute('media', 2) || '', t = l.getAttribute('type', 2) || '';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   171
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   172
		if (t == "-mce-text/css" && (m == "" || m == "screen" || m == "all") && (l.getAttribute('rel', 2) || '') == "stylesheet") {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   173
			f.stylesheet.value = l.getAttribute('mce_href', 2) || '';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   174
			return false;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   175
		}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   176
	});
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   177
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   178
	// Get from style elements
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   179
	tinymce.each(doc.getElementsByTagName("style"), function(st) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   180
		var tmp = parseStyleElement(st);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   181
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   182
		for (x=0; x<tmp.length; x++) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   183
			if (tmp[x].rule.indexOf('a:visited') != -1 && tmp[x].data['color'])
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   184
				f.visited_color.value = tmp[x].data['color'];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   185
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   186
			if (tmp[x].rule.indexOf('a:link') != -1 && tmp[x].data['color'])
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   187
				f.link_color.value = tmp[x].data['color'];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   188
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   189
			if (tmp[x].rule.indexOf('a:active') != -1 && tmp[x].data['color'])
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   190
				f.active_color.value = tmp[x].data['color'];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   191
		}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   192
	});
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   193
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   194
	f.textcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "text");
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   195
	f.active_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "alink");
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   196
	f.link_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "link");
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   197
	f.visited_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "vlink");
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   198
	f.bgcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "bgcolor");
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   199
	f.bgimage.value = tinyMCEPopup.dom.getAttrib(doc.body, "background");
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   200
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   201
	// Get from style info
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   202
	style = tinyMCEPopup.dom.parseStyle(tinyMCEPopup.dom.getAttrib(doc.body, 'style'));
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   203
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   204
	if (style['font-family'])
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   205
		selectByValue(f, 'fontface', style['font-family'], true, true);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   206
	else
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   207
		selectByValue(f, 'fontface', ed.getParam("fullpage_default_fontface", ""), true, true);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   208
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   209
	if (style['font-size'])
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   210
		selectByValue(f, 'fontsize', style['font-size'], true, true);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   211
	else
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   212
		selectByValue(f, 'fontsize', ed.getParam("fullpage_default_fontsize", ""), true, true);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   213
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   214
	if (style['color'])
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   215
		f.textcolor.value = convertRGBToHex(style['color']);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   216
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   217
	if (style['background-image'])
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   218
		f.bgimage.value = style['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   219
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   220
	if (style['background-color'])
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   221
		f.bgcolor.value = style['background-color'];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   222
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   223
	if (style['margin']) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   224
		tmp = style['margin'].replace(/[^0-9 ]/g, '');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   225
		tmp = tmp.split(/ +/);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   226
		f.topmargin.value = tmp.length > 0 ? tmp[0] : '';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   227
		f.rightmargin.value = tmp.length > 1 ? tmp[1] : tmp[0];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   228
		f.bottommargin.value = tmp.length > 2 ? tmp[2] : tmp[0];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   229
		f.leftmargin.value = tmp.length > 3 ? tmp[3] : tmp[0];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   230
	}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   231
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   232
	if (style['margin-left'])
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   233
		f.leftmargin.value = style['margin-left'].replace(/[^0-9]/g, '');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   234
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   235
	if (style['margin-right'])
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   236
		f.rightmargin.value = style['margin-right'].replace(/[^0-9]/g, '');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   237
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   238
	if (style['margin-top'])
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   239
		f.topmargin.value = style['margin-top'].replace(/[^0-9]/g, '');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   240
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   241
	if (style['margin-bottom'])
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   242
		f.bottommargin.value = style['margin-bottom'].replace(/[^0-9]/g, '');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   243
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   244
	f.style.value = tinyMCEPopup.dom.serializeStyle(style);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   245
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   246
	// Update colors
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   247
	updateColor('textcolor_pick', 'textcolor');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   248
	updateColor('bgcolor_pick', 'bgcolor');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   249
	updateColor('visited_color_pick', 'visited_color');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   250
	updateColor('active_color_pick', 'active_color');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   251
	updateColor('link_color_pick', 'link_color');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   252
}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   253
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   254
function getReItem(r, s, i) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   255
	var c = r.exec(s);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   256
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   257
	if (c && c.length > i)
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   258
		return c[i];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   259
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   260
	return '';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   261
}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   262
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   263
function updateAction() {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   264
	var f = document.forms[0], nl, i, h, v, s, head, html, l, tmp, addlink = true, ser;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   265
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   266
	head = doc.getElementsByTagName('head')[0];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   267
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   268
	// Fix scripts without a type
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   269
	nl = doc.getElementsByTagName('script');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   270
	for (i=0; i<nl.length; i++) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   271
		if (tinyMCEPopup.dom.getAttrib(nl[i], 'mce_type') == '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   272
			nl[i].setAttribute('mce_type', 'text/javascript');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   273
	}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   274
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   275
	// Get primary stylesheet
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   276
	nl = doc.getElementsByTagName("link");
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   277
	for (i=0; i<nl.length; i++) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   278
		l = nl[i];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   279
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   280
		tmp = tinyMCEPopup.dom.getAttrib(l, 'media');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   281
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   282
		if (tinyMCEPopup.dom.getAttrib(l, 'mce_type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   283
			addlink = false;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   284
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   285
			if (f.stylesheet.value == '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   286
				l.parentNode.removeChild(l);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   287
			else
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   288
				l.setAttribute('mce_href', f.stylesheet.value);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   289
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   290
			break;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   291
		}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   292
	}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   293
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   294
	// Add new link
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   295
	if (f.stylesheet.value != '') {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   296
		l = doc.createElement('link');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   297
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   298
		l.setAttribute('type', 'text/css');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   299
		l.setAttribute('mce_href', f.stylesheet.value);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   300
		l.setAttribute('rel', 'stylesheet');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   301
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   302
		head.appendChild(l);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   303
	}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   304
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   305
	setMeta(head, 'keywords', f.metakeywords.value);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   306
	setMeta(head, 'description', f.metadescription.value);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   307
	setMeta(head, 'author', f.metaauthor.value);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   308
	setMeta(head, 'copyright', f.metacopyright.value);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   309
	setMeta(head, 'robots', getSelectValue(f, 'metarobots'));
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   310
	setMeta(head, 'Content-Type', getSelectValue(f, 'docencoding'));
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   311
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   312
	doc.body.dir = getSelectValue(f, 'langdir');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   313
	doc.body.style.cssText = f.style.value;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   314
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   315
	doc.body.setAttribute('vLink', f.visited_color.value);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   316
	doc.body.setAttribute('link', f.link_color.value);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   317
	doc.body.setAttribute('text', f.textcolor.value);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   318
	doc.body.setAttribute('aLink', f.active_color.value);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   319
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   320
	doc.body.style.fontFamily = getSelectValue(f, 'fontface');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   321
	doc.body.style.fontSize = getSelectValue(f, 'fontsize');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   322
	doc.body.style.backgroundColor = f.bgcolor.value;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   323
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   324
	if (f.leftmargin.value != '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   325
		doc.body.style.marginLeft = f.leftmargin.value + 'px';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   326
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   327
	if (f.rightmargin.value != '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   328
		doc.body.style.marginRight = f.rightmargin.value + 'px';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   329
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   330
	if (f.bottommargin.value != '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   331
		doc.body.style.marginBottom = f.bottommargin.value + 'px';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   332
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   333
	if (f.topmargin.value != '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   334
		doc.body.style.marginTop = f.topmargin.value + 'px';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   335
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   336
	html = doc.getElementsByTagName('html')[0];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   337
	html.setAttribute('lang', f.langcode.value);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   338
	html.setAttribute('xml:lang', f.langcode.value);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   339
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   340
	if (f.bgimage.value != '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   341
		doc.body.style.backgroundImage = "url('" + f.bgimage.value + "')";
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   342
	else
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   343
		doc.body.style.backgroundImage = '';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   344
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   345
	ser = tinyMCEPopup.editor.plugins.fullpage._createSerializer();
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   346
	ser.setRules('-title,meta[http-equiv|name|content],base[href|target],link[href|rel|type|title|media],style[type],script[type|language|src],html[lang|xml::lang|xmlns],body[style|dir|vlink|link|text|alink],head');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   347
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   348
	h = ser.serialize(doc.documentElement);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   349
	h = h.substring(0, h.lastIndexOf('</body>'));
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   350
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   351
	if (h.indexOf('<title>') == -1)
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   352
		h = h.replace(/<head.*?>/, '$&\n' + '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   353
	else
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   354
		h = h.replace(/<title>(.*?)<\/title>/, '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   355
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   356
	if ((v = getSelectValue(f, 'doctypes')) != '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   357
		h = v + '\n' + h;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   358
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   359
	if (f.xml_pi.checked) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   360
		s = '<?xml version="1.0"';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   361
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   362
		if ((v = getSelectValue(f, 'docencoding')) != '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   363
			s += ' encoding="' + v + '"';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   364
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   365
		s += '?>\n';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   366
		h = s + h;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   367
	}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   368
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   369
	h = h.replace(/type=\"\-mce\-/gi, 'type="');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   370
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   371
	tinyMCEPopup.editor.plugins.fullpage.head = h;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   372
	tinyMCEPopup.editor.plugins.fullpage._setBodyAttribs(tinyMCEPopup.editor, {});
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   373
	tinyMCEPopup.close();
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   374
}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   375
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   376
function changedStyleField(field) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   377
}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   378
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   379
function setMeta(he, k, v) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   380
	var nl, i, m;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   381
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   382
	nl = he.getElementsByTagName('meta');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   383
	for (i=0; i<nl.length; i++) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   384
		if (k == 'Content-Type' && tinyMCEPopup.dom.getAttrib(nl[i], 'http-equiv') == k) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   385
			if (v == '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   386
				nl[i].parentNode.removeChild(nl[i]);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   387
			else
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   388
				nl[i].setAttribute('content', "text/html; charset=" + v);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   389
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   390
			return;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   391
		}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   392
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   393
		if (tinyMCEPopup.dom.getAttrib(nl[i], 'name') == k) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   394
			if (v == '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   395
				nl[i].parentNode.removeChild(nl[i]);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   396
			else
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   397
				nl[i].setAttribute('content', v);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   398
			return;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   399
		}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   400
	}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   401
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   402
	if (v == '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   403
		return;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   404
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   405
	m = doc.createElement('meta');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   406
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   407
	if (k == 'Content-Type')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   408
		m.httpEquiv = k;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   409
	else
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   410
		m.setAttribute('name', k);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   411
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   412
	m.setAttribute('content', v);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   413
	he.appendChild(m);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   414
}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   415
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   416
function parseStyleElement(e) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   417
	var v = e.innerHTML;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   418
	var p, i, r;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   419
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   420
	v = v.replace(/<!--/gi, '');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   421
	v = v.replace(/-->/gi, '');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   422
	v = v.replace(/[\n\r]/gi, '');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   423
	v = v.replace(/\s+/gi, ' ');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   424
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   425
	r = [];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   426
	p = v.split(/{|}/);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   427
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   428
	for (i=0; i<p.length; i+=2) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   429
		if (p[i] != "")
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   430
			r[r.length] = {rule : tinymce.trim(p[i]), data : tinyMCEPopup.dom.parseStyle(p[i+1])};
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   431
	}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   432
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   433
	return r;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   434
}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   435
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   436
function serializeStyleElement(d) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   437
	var i, s, st;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   438
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   439
	s = '<!--\n';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   440
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   441
	for (i=0; i<d.length; i++) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   442
		s += d[i].rule + ' {\n';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   443
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   444
		st = tinyMCE.serializeStyle(d[i].data);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   445
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   446
		if (st != '')
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   447
			st += ';';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   448
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   449
		s += st.replace(/;/g, ';\n');
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   450
		s += '}\n';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   451
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   452
		if (i != d.length - 1)
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   453
			s += '\n';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   454
	}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   455
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   456
	s += '\n-->';
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   457
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   458
	return s;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   459
}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   460
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
   461
tinyMCEPopup.onInit.add(init);