includes/clientside/tinymce/tiny_mce_src.js
author Dan Fuhry <dan@enanocms.org>
Tue, 16 Nov 2010 12:55:06 -0500
changeset 1321 db77b3bbcb93
parent 1193 e3b94bd055dc
permissions -rw-r--r--
Tagged 1.1.8 as current-unstable
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
     1
var tinymce = {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
     2
	majorVersion : '3',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
     3
	minorVersion : '2.7',
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
     4
	releaseDate : '2009-09-22',
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
     5
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
     6
	_init : function() {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
     7
		var t = this, d = document, w = window, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
     8
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
     9
		t.isOpera = w.opera && opera.buildNumber;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
    10
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    11
		t.isWebKit = /WebKit/.test(ua);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
    12
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
    13
		t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
    14
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    15
		t.isIE6 = t.isIE && /MSIE [56]/.test(ua);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
    16
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    17
		t.isGecko = !t.isWebKit && /Gecko/.test(ua);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
    18
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    19
		t.isMac = ua.indexOf('Mac') != -1;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
    20
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
    21
		t.isAir = /adobeair/i.test(ua);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    22
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    23
		// TinyMCE .NET webcontrol might be setting the values for TinyMCE
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
    24
		if (w.tinyMCEPreInit) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    25
			t.suffix = tinyMCEPreInit.suffix;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    26
			t.baseURL = tinyMCEPreInit.base;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
    27
			t.query = tinyMCEPreInit.query;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
    28
			return;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    29
		}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    30
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    31
		// Get suffix and base
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    32
		t.suffix = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    33
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    34
		// If base element found, add that infront of baseURL
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
    35
		nl = d.getElementsByTagName('base');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    36
		for (i=0; i<nl.length; i++) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
    37
			if (v = nl[i].href) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
    38
				// Host only value like http://site.com or http://site.com:8008
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
    39
				if (/^https?:\/\/[^\/]+$/.test(v))
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
    40
					v += '/';
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
    41
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
    42
				base = v ? v.match(/.*\//)[0] : ''; // Get only directory
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
    43
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    44
		}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    45
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    46
		function getBase(n) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
    47
			if (n.src && /tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(n.src)) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    48
				if (/_(src|dev)\.js/g.test(n.src))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    49
					t.suffix = '_src';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    50
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
    51
				if ((p = n.src.indexOf('?')) != -1)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
    52
					t.query = n.src.substring(p + 1);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
    53
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    54
				t.baseURL = n.src.substring(0, n.src.lastIndexOf('/'));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    55
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    56
				// If path to script is relative and a base href was found add that one infront
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
    57
				// the src property will always be an absolute one on non IE browsers and IE 8
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
    58
				// so this logic will basically only be executed on older IE versions
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
    59
				if (base && t.baseURL.indexOf('://') == -1 && t.baseURL.indexOf('/') !== 0)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    60
					t.baseURL = base + t.baseURL;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    61
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    62
				return t.baseURL;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    63
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    64
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    65
			return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    66
		};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    67
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    68
		// Check document
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
    69
		nl = d.getElementsByTagName('script');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    70
		for (i=0; i<nl.length; i++) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    71
			if (getBase(nl[i]))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    72
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    73
		}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    74
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    75
		// Check head
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
    76
		n = d.getElementsByTagName('head')[0];
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    77
		if (n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    78
			nl = n.getElementsByTagName('script');
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
    79
			for (i=0; i<nl.length; i++) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    80
				if (getBase(nl[i]))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    81
					return;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
    82
			}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
    83
		}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
    84
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    85
		return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    86
	},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    87
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    88
	is : function(o, t) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    89
		var n = typeof(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    90
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    91
		if (!t)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    92
			return n != 'undefined';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    93
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
    94
		if (t == 'array' && (o.hasOwnProperty && o instanceof Array))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    95
			return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    96
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
    97
		return n == t;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
    98
	},
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
    99
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   100
	each : function(o, cb, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   101
		var n, l;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   102
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   103
		if (!o)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   104
			return 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   105
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   106
		s = s || o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   107
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   108
		if (typeof(o.length) != 'undefined') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   109
			// Indexed arrays, needed for Safari
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   110
			for (n=0, l = o.length; n<l; n++) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   111
				if (cb.call(s, o[n], n, o) === false)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   112
					return 0;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   113
			}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   114
		} else {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   115
			// Hashtables
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   116
			for (n in o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   117
				if (o.hasOwnProperty(n)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   118
					if (cb.call(s, o[n], n, o) === false)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   119
						return 0;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   120
				}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   121
			}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   122
		}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   123
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   124
		return 1;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   125
	},
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   126
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   127
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   128
	map : function(a, f) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   129
		var o = [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   130
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   131
		tinymce.each(a, function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   132
			o.push(f(v));
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   133
		});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   134
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   135
		return o;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   136
	},
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   137
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   138
	grep : function(a, f) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   139
		var o = [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   140
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   141
		tinymce.each(a, function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   142
			if (!f || f(v))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   143
				o.push(v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   144
		});
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   145
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   146
		return o;
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   147
	},
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   148
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   149
	inArray : function(a, v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   150
		var i, l;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   151
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   152
		if (a) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   153
			for (i = 0, l = a.length; i < l; i++) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   154
				if (a[i] === v)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   155
					return i;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   156
			}
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   157
		}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   158
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   159
		return -1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   160
	},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   161
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   162
	extend : function(o, e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   163
		var i, a = arguments;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   164
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   165
		for (i=1; i<a.length; i++) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   166
			e = a[i];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   167
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   168
			tinymce.each(e, function(v, n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   169
				if (typeof(v) !== 'undefined')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   170
					o[n] = v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   171
			});
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   172
		}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   173
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   174
		return o;
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   175
	},
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   176
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   177
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   178
	trim : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   179
		return (s ? '' + s : '').replace(/^\s*|\s*$/g, '');
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   180
	},
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   181
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   182
	create : function(s, p) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   183
		var t = this, sp, ns, cn, scn, c, de = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   184
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   185
		// Parse : <prefix> <class>:<super class>
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   186
		s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   187
		cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   188
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   189
		// Create namespace for new class
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   190
		ns = t.createNS(s[3].replace(/\.\w+$/, ''));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   191
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   192
		// Class already exists
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   193
		if (ns[cn])
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   194
			return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   195
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   196
		// Make pure static class
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   197
		if (s[2] == 'static') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   198
			ns[cn] = p;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   199
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   200
			if (this.onCreate)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   201
				this.onCreate(s[2], s[3], ns[cn]);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   202
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   203
			return;
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   204
		}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   205
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   206
		// Create default constructor
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   207
		if (!p[cn]) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   208
			p[cn] = function() {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   209
			de = 1;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   210
		}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   211
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   212
		// Add constructor and methods
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   213
		ns[cn] = p[cn];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   214
		t.extend(ns[cn].prototype, p);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   215
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   216
		// Extend
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   217
		if (s[5]) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   218
			sp = t.resolve(s[5]).prototype;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   219
			scn = s[5].match(/\.(\w+)$/i)[1]; // Class name
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   220
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   221
			// Extend constructor
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   222
			c = ns[cn];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   223
			if (de) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   224
				// Add passthrough constructor
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   225
				ns[cn] = function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   226
					return sp[scn].apply(this, arguments);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   227
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   228
			} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   229
				// Add inherit constructor
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   230
				ns[cn] = function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   231
					this.parent = sp[scn];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   232
					return c.apply(this, arguments);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   233
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   234
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   235
			ns[cn].prototype[cn] = ns[cn];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   236
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   237
			// Add super methods
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   238
			t.each(sp, function(f, n) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   239
				ns[cn].prototype[n] = sp[n];
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   240
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   241
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   242
			// Add overridden methods
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   243
			t.each(p, function(f, n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   244
				// Extend methods if needed
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   245
				if (sp[n]) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   246
					ns[cn].prototype[n] = function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   247
						this.parent = sp[n];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   248
						return f.apply(this, arguments);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   249
					};
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   250
				} else {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   251
					if (n != cn)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   252
						ns[cn].prototype[n] = f;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   253
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   254
			});
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   255
		}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   256
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   257
		// Add static methods
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   258
		t.each(p['static'], function(f, n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   259
			ns[cn][n] = f;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   260
		});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   261
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   262
		if (this.onCreate)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   263
			this.onCreate(s[2], s[3], ns[cn].prototype);
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   264
	},
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   265
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   266
	walk : function(o, f, n, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   267
		s = s || this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   268
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   269
		if (o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   270
			if (n)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   271
				o = o[n];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   272
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   273
			tinymce.each(o, function(o, i) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   274
				if (f.call(s, o, i, n) === false)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   275
					return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   276
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   277
				tinymce.walk(o, f, n, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   278
			});
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   279
		}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   280
	},
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   281
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   282
	createNS : function(n, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   283
		var i, v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   284
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   285
		o = o || window;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   286
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   287
		n = n.split('.');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   288
		for (i=0; i<n.length; i++) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   289
			v = n[i];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   290
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   291
			if (!o[v])
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   292
				o[v] = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   293
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   294
			o = o[v];
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   295
		}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   296
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   297
		return o;
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   298
	},
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   299
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   300
	resolve : function(n, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   301
		var i, l;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   302
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   303
		o = o || window;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   304
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   305
		n = n.split('.');
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   306
		for (i = 0, l = n.length; i < l; i++) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   307
			o = o[n[i]];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   308
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   309
			if (!o)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   310
				break;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   311
		}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   312
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   313
		return o;
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   314
	},
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   315
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   316
	addUnload : function(f, s) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   317
		var t = this, w = window;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   318
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   319
		f = {func : f, scope : s || this};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   320
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   321
		if (!t.unloads) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   322
			function unload() {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   323
				var li = t.unloads, o, n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   324
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   325
				if (li) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   326
					// Call unload handlers
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   327
					for (n in li) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   328
						o = li[n];
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   329
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   330
						if (o && o.func)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   331
							o.func.call(o.scope, 1); // Send in one arg to distinct unload and user destroy
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   332
					}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   333
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   334
					// Detach unload function
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   335
					if (w.detachEvent) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   336
						w.detachEvent('onbeforeunload', fakeUnload);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   337
						w.detachEvent('onunload', unload);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   338
					} else if (w.removeEventListener)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   339
						w.removeEventListener('unload', unload, false);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   340
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   341
					// Destroy references
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   342
					t.unloads = o = li = w = unload = 0;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   343
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   344
					// Run garbarge collector on IE
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   345
					if (window.CollectGarbage)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   346
						window.CollectGarbage();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   347
				}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   348
			};
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   349
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   350
			function fakeUnload() {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   351
				var d = document;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   352
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   353
				// Is there things still loading, then do some magic
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   354
				if (d.readyState == 'interactive') {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   355
					function stop() {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   356
						// Prevent memory leak
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   357
						d.detachEvent('onstop', stop);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   358
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   359
						// Call unload handler
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   360
						if (unload)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   361
							unload();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   362
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   363
						d = 0;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   364
					};
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   365
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   366
					// Fire unload when the currently loading page is stopped
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   367
					if (d)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   368
						d.attachEvent('onstop', stop);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   369
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   370
					// Remove onstop listener after a while to prevent the unload function
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   371
					// to execute if the user presses cancel in an onbeforeunload
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   372
					// confirm dialog and then presses the browser stop button
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   373
					window.setTimeout(function() {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   374
						if (d)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   375
							d.detachEvent('onstop', stop);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   376
					}, 0);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   377
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   378
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   379
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   380
			// Attach unload handler
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   381
			if (w.attachEvent) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   382
				w.attachEvent('onunload', unload);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   383
				w.attachEvent('onbeforeunload', fakeUnload);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   384
			} else if (w.addEventListener)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   385
				w.addEventListener('unload', unload, false);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   386
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   387
			// Setup initial unload handler array
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   388
			t.unloads = [f];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   389
		} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   390
			t.unloads.push(f);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   391
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   392
		return f;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   393
	},
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   394
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   395
	removeUnload : function(f) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   396
		var u = this.unloads, r = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   397
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   398
		tinymce.each(u, function(o, i) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   399
			if (o && o.func == f) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   400
				u.splice(i, 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   401
				r = f;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   402
				return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   403
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   404
		});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   405
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   406
		return r;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   407
	},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   408
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   409
	explode : function(s, d) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   410
		return s ? tinymce.map(s.split(d || ','), tinymce.trim) : s;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   411
	},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   412
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   413
	_addVer : function(u) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   414
		var v;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   415
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   416
		if (!this.query)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   417
			return u;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   418
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   419
		v = (u.indexOf('?') == -1 ? '?' : '&') + this.query;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   420
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   421
		if (u.indexOf('#') == -1)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   422
			return u + v;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   423
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   424
		return u.replace('#', v + '#');
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   425
	}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   426
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   427
	};
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   428
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   429
// Required for GZip AJAX loading
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   430
window.tinymce = tinymce;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   431
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   432
// Initialize the API
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   433
tinymce._init();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   434
tinymce.create('tinymce.util.Dispatcher', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   435
	scope : null,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   436
	listeners : null,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   437
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   438
	Dispatcher : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   439
		this.scope = s || this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   440
		this.listeners = [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   441
	},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   442
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   443
	add : function(cb, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   444
		this.listeners.push({cb : cb, scope : s || this.scope});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   445
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   446
		return cb;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   447
	},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   448
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   449
	addToTop : function(cb, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   450
		this.listeners.unshift({cb : cb, scope : s || this.scope});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   451
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   452
		return cb;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   453
	},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   454
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   455
	remove : function(cb) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   456
		var l = this.listeners, o = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   457
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   458
		tinymce.each(l, function(c, i) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   459
			if (cb == c.cb) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   460
				o = cb;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   461
				l.splice(i, 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   462
				return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   463
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   464
		});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   465
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   466
		return o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   467
	},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   468
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   469
	dispatch : function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   470
		var s, a = arguments, i, li = this.listeners, c;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   471
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   472
		// Needs to be a real loop since the listener count might change while looping
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   473
		// And this is also more efficient
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   474
		for (i = 0; i<li.length; i++) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   475
			c = li[i];
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   476
			s = c.cb.apply(c.scope, a);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   477
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   478
			if (s === false)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   479
				break;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   480
		}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   481
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   482
		return s;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   483
	}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   484
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   485
	});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   486
(function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   487
	var each = tinymce.each;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   488
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   489
	tinymce.create('tinymce.util.URI', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   490
		URI : function(u, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   491
			var t = this, o, a, b;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   492
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   493
			// Trim whitespace
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   494
			u = tinymce.trim(u);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   495
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   496
			// Default settings
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   497
			s = t.settings = s || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   498
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   499
			// Strange app protocol or local anchor
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   500
			if (/^(mailto|tel|news|javascript|about|data):/i.test(u) || /^\s*#/.test(u)) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   501
				t.source = u;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   502
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   503
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   504
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   505
			// Absolute path with no host, fake host and protocol
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   506
			if (u.indexOf('/') === 0 && u.indexOf('//') !== 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   507
				u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   508
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   509
			// Relative path http:// or protocol relative //path
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   510
			if (!/^\w*:?\/\//.test(u))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   511
				u = (s.base_uri.protocol || 'http') + '://mce_host' + t.toAbsPath(s.base_uri.path, u);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   512
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   513
			// Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri)
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   514
			u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   515
			u = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   516
			each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   517
				var s = u[i];
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   518
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   519
				// Zope 3 workaround, they use @@something
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   520
				if (s)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   521
					s = s.replace(/\(mce_at\)/g, '@@');
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   522
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   523
				t[v] = s;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   524
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   525
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   526
			if (b = s.base_uri) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   527
				if (!t.protocol)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   528
					t.protocol = b.protocol;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   529
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   530
				if (!t.userInfo)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   531
					t.userInfo = b.userInfo;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   532
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   533
				if (!t.port && t.host == 'mce_host')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   534
					t.port = b.port;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   535
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   536
				if (!t.host || t.host == 'mce_host')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   537
					t.host = b.host;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   538
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   539
				t.source = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   540
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   541
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   542
			//t.path = t.path || '/';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   543
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   544
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   545
		setPath : function(p) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   546
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   547
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   548
			p = /^(.*?)\/?(\w+)?$/.exec(p);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   549
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   550
			// Update path parts
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   551
			t.path = p[0];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   552
			t.directory = p[1];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   553
			t.file = p[2];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   554
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   555
			// Rebuild source
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   556
			t.source = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   557
			t.getURI();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   558
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   559
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   560
		toRelative : function(u) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   561
			var t = this, o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   562
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   563
			if (u === "./")
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   564
				return u;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   565
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   566
			u = new tinymce.util.URI(u, {base_uri : t});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   567
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   568
			// Not on same domain/port or protocol
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   569
			if ((u.host != 'mce_host' && t.host != u.host && u.host) || t.port != u.port || t.protocol != u.protocol)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   570
				return u.getURI();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   571
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   572
			o = t.toRelPath(t.path, u.path);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   573
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   574
			// Add query
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   575
			if (u.query)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   576
				o += '?' + u.query;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   577
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   578
			// Add anchor
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   579
			if (u.anchor)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   580
				o += '#' + u.anchor;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   581
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   582
			return o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   583
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   584
	
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   585
		toAbsolute : function(u, nh) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   586
			var u = new tinymce.util.URI(u, {base_uri : this});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   587
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   588
			return u.getURI(this.host == u.host && this.protocol == u.protocol ? nh : 0);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   589
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   590
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   591
		toRelPath : function(base, path) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   592
			var items, bp = 0, out = '', i, l;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   593
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   594
			// Split the paths
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   595
			base = base.substring(0, base.lastIndexOf('/'));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   596
			base = base.split('/');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   597
			items = path.split('/');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   598
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   599
			if (base.length >= items.length) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   600
				for (i = 0, l = base.length; i < l; i++) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   601
					if (i >= items.length || base[i] != items[i]) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   602
						bp = i + 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   603
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   604
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   605
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   606
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   607
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   608
			if (base.length < items.length) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   609
				for (i = 0, l = items.length; i < l; i++) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   610
					if (i >= base.length || base[i] != items[i]) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   611
						bp = i + 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   612
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   613
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   614
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   615
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   616
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   617
			if (bp == 1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   618
				return path;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   619
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   620
			for (i = 0, l = base.length - (bp - 1); i < l; i++)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   621
				out += "../";
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   622
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   623
			for (i = bp - 1, l = items.length; i < l; i++) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   624
				if (i != bp - 1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   625
					out += "/" + items[i];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   626
				else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   627
					out += items[i];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   628
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   629
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   630
			return out;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   631
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   632
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   633
		toAbsPath : function(base, path) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   634
			var i, nb = 0, o = [], tr, outPath;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   635
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   636
			// Split paths
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   637
			tr = /\/$/.test(path) ? '/' : '';
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   638
			base = base.split('/');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   639
			path = path.split('/');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   640
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   641
			// Remove empty chunks
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   642
			each(base, function(k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   643
				if (k)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   644
					o.push(k);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   645
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   646
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   647
			base = o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   648
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   649
			// Merge relURLParts chunks
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   650
			for (i = path.length - 1, o = []; i >= 0; i--) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   651
				// Ignore empty or .
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   652
				if (path[i].length == 0 || path[i] == ".")
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   653
					continue;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   654
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   655
				// Is parent
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   656
				if (path[i] == '..') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   657
					nb++;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   658
					continue;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   659
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   660
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   661
				// Move up
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   662
				if (nb > 0) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   663
					nb--;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   664
					continue;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   665
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   666
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   667
				o.push(path[i]);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   668
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   669
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   670
			i = base.length - nb;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   671
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   672
			// If /a/b/c or /
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   673
			if (i <= 0)
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   674
				outPath = o.reverse().join('/');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   675
			else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   676
				outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   677
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   678
			// Add front / if it's needed
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   679
			if (outPath.indexOf('/') !== 0)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   680
				outPath = '/' + outPath;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   681
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   682
			// Add traling / if it's needed
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   683
			if (tr && outPath.lastIndexOf('/') !== outPath.length - 1)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   684
				outPath += tr;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   685
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   686
			return outPath;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   687
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   688
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   689
		getURI : function(nh) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   690
			var s, t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   691
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   692
			// Rebuild source
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   693
			if (!t.source || nh) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   694
				s = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   695
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   696
				if (!nh) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   697
					if (t.protocol)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   698
						s += t.protocol + '://';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   699
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   700
					if (t.userInfo)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   701
						s += t.userInfo + '@';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   702
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   703
					if (t.host)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   704
						s += t.host;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   705
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   706
					if (t.port)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   707
						s += ':' + t.port;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   708
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   709
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   710
				if (t.path)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   711
					s += t.path;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   712
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   713
				if (t.query)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   714
					s += '?' + t.query;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   715
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   716
				if (t.anchor)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   717
					s += '#' + t.anchor;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   718
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   719
				t.source = s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   720
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   721
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   722
			return t.source;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   723
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   724
	});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   725
})();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   726
(function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   727
	var each = tinymce.each;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   728
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   729
	tinymce.create('static tinymce.util.Cookie', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   730
		getHash : function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   731
			var v = this.get(n), h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   732
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   733
			if (v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   734
				each(v.split('&'), function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   735
					v = v.split('=');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   736
					h = h || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   737
					h[unescape(v[0])] = unescape(v[1]);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   738
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   739
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   740
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   741
			return h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   742
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   743
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   744
		setHash : function(n, v, e, p, d, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   745
			var o = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   746
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   747
			each(v, function(v, k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   748
				o += (!o ? '' : '&') + escape(k) + '=' + escape(v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   749
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   750
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   751
			this.set(n, o, e, p, d, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   752
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   753
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   754
		get : function(n) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   755
			var c = document.cookie, e, p = n + "=", b;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   756
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   757
			// Strict mode
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   758
			if (!c)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   759
				return;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   760
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   761
			b = c.indexOf("; " + p);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   762
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   763
			if (b == -1) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   764
				b = c.indexOf(p);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   765
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   766
				if (b != 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   767
					return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   768
			} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   769
				b += 2;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   770
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   771
			e = c.indexOf(";", b);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   772
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   773
			if (e == -1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   774
				e = c.length;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   775
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   776
			return unescape(c.substring(b + p.length, e));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   777
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   778
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   779
		set : function(n, v, e, p, d, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   780
			document.cookie = n + "=" + escape(v) +
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   781
				((e) ? "; expires=" + e.toGMTString() : "") +
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   782
				((p) ? "; path=" + escape(p) : "") +
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   783
				((d) ? "; domain=" + d : "") +
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   784
				((s) ? "; secure" : "");
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   785
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   786
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   787
		remove : function(n, p) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   788
			var d = new Date();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   789
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   790
			d.setTime(d.getTime() - 1000);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   791
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   792
			this.set(n, '', d, p, d);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   793
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   794
	});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   795
})();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   796
tinymce.create('static tinymce.util.JSON', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   797
	serialize : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   798
		var i, v, s = tinymce.util.JSON.serialize, t;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   799
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   800
		if (o == null)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   801
			return 'null';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   802
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   803
		t = typeof o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   804
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   805
		if (t == 'string') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   806
			v = '\bb\tt\nn\ff\rr\""\'\'\\\\';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   807
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   808
			return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(a, b) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   809
				i = v.indexOf(b);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   810
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   811
				if (i + 1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   812
					return '\\' + v.charAt(i + 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   813
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   814
				a = b.charCodeAt().toString(16);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   815
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   816
				return '\\u' + '0000'.substring(a.length) + a;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   817
			}) + '"';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   818
		}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   819
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   820
		if (t == 'object') {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   821
			if (o.hasOwnProperty && o instanceof Array) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   822
					for (i=0, v = '['; i<o.length; i++)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   823
						v += (i > 0 ? ',' : '') + s(o[i]);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   824
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   825
					return v + ']';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   826
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   827
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   828
				v = '{';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   829
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   830
				for (i in o)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   831
					v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   832
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   833
				return v + '}';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   834
		}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   835
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   836
		return '' + o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   837
	},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   838
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   839
	parse : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   840
		try {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   841
			return eval('(' + s + ')');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   842
		} catch (ex) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   843
			// Ignore
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   844
		}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   845
	}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   846
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   847
	});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   848
tinymce.create('static tinymce.util.XHR', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   849
	send : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   850
		var x, t, w = window, c = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   851
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   852
		// Default settings
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   853
		o.scope = o.scope || this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   854
		o.success_scope = o.success_scope || o.scope;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   855
		o.error_scope = o.error_scope || o.scope;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   856
		o.async = o.async === false ? false : true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   857
		o.data = o.data || '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   858
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   859
		function get(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   860
			x = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   861
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   862
			try {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   863
				x = new ActiveXObject(s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   864
			} catch (ex) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   865
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   866
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   867
			return x;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   868
		};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   869
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   870
		x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   871
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   872
		if (x) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   873
			if (x.overrideMimeType)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   874
				x.overrideMimeType(o.content_type);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   875
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   876
			x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   877
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   878
			if (o.content_type)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   879
				x.setRequestHeader('Content-Type', o.content_type);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   880
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   881
			x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   882
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   883
			x.send(o.data);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   884
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
   885
			function ready() {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
   886
				if (!o.async || x.readyState == 4 || c++ > 10000) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   887
					if (o.success && c < 10000 && x.status == 200)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   888
						o.success.call(o.success_scope, '' + x.responseText, x, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   889
					else if (o.error)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   890
						o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   891
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   892
					x = null;
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
   893
				} else
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
   894
					w.setTimeout(ready, 10);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
   895
			};
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
   896
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
   897
			// Syncronous request
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
   898
			if (!o.async)
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
   899
				return ready();
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
   900
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
   901
			// Wait for response, onReadyStateChange can not be used since it leaks memory in IE
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
   902
			t = w.setTimeout(ready, 10);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   903
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   904
	}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   905
});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   906
(function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   907
	var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   908
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   909
	tinymce.create('tinymce.util.JSONRequest', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   910
		JSONRequest : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   911
			this.settings = extend({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   912
			}, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   913
			this.count = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   914
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   915
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   916
		send : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   917
			var ecb = o.error, scb = o.success;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   918
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   919
			o = extend(this.settings, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   920
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   921
			o.success = function(c, x) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   922
				c = JSON.parse(c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   923
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   924
				if (typeof(c) == 'undefined') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   925
					c = {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   926
						error : 'JSON Parse error.'
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   927
					};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   928
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   929
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   930
				if (c.error)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   931
					ecb.call(o.error_scope || o.scope, c.error, x);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   932
				else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   933
					scb.call(o.success_scope || o.scope, c.result);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   934
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   935
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   936
			o.error = function(ty, x) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   937
				ecb.call(o.error_scope || o.scope, ty, x);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   938
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   939
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   940
			o.data = JSON.serialize({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   941
				id : o.id || 'c' + (this.count++),
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   942
				method : o.method,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   943
				params : o.params
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   944
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   945
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
   946
			// JSON content type for Ruby on rails. Bug: #1883287
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
   947
			o.content_type = 'application/json';
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
   948
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   949
			XHR.send(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   950
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   951
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   952
		'static' : {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   953
			sendRPC : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   954
				return new tinymce.util.JSONRequest().send(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   955
			}
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
   956
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   957
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   958
}());(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   959
	// Shorten names
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   960
	var each = tinymce.each, is = tinymce.is;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   961
	var isWebKit = tinymce.isWebKit, isIE = tinymce.isIE;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   962
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   963
	tinymce.create('tinymce.dom.DOMUtils', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   964
		doc : null,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   965
		root : null,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   966
		files : null,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   967
		pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/,
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   968
		props : {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   969
			"for" : "htmlFor",
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   970
			"class" : "className",
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   971
			className : "className",
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   972
			checked : "checked",
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   973
			disabled : "disabled",
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   974
			maxlength : "maxLength",
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   975
			readonly : "readOnly",
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   976
			selected : "selected",
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   977
			value : "value",
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   978
			id : "id",
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   979
			name : "name",
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   980
			type : "type"
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
   981
		},
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   982
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   983
		DOMUtils : function(d, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   984
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   985
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   986
			t.doc = d;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   987
			t.win = window;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   988
			t.files = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   989
			t.cssFlicker = false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   990
			t.counter = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   991
			t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat"; 
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
   992
			t.stdMode = d.documentMode === 8;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   993
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
   994
			t.settings = s = tinymce.extend({
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   995
				keep_values : false,
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   996
				hex_colors : 1,
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
   997
				process_html : 1
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   998
			}, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
   999
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1000
			// Fix IE6SP2 flicker and check it failed for pre SP2
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1001
			if (tinymce.isIE6) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1002
				try {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1003
					d.execCommand('BackgroundImageCache', false, true);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1004
				} catch (e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1005
					t.cssFlicker = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1006
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1007
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1008
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1009
			tinymce.addUnload(t.destroy, t);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1010
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1011
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1012
		getRoot : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1013
			var t = this, s = t.settings;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1014
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1015
			return (s && t.get(s.root_element)) || t.doc.body;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1016
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1017
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1018
		getViewPort : function(w) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1019
			var d, b;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1020
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1021
			w = !w ? this.win : w;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1022
			d = w.document;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1023
			b = this.boxModel ? d.documentElement : d.body;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1024
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1025
			// Returns viewport size excluding scrollbars
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1026
			return {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1027
				x : w.pageXOffset || b.scrollLeft,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1028
				y : w.pageYOffset || b.scrollTop,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1029
				w : w.innerWidth || b.clientWidth,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1030
				h : w.innerHeight || b.clientHeight
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1031
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1032
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1033
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1034
		getRect : function(e) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1035
			var p, t = this, sr;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1036
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1037
			e = t.get(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1038
			p = t.getPos(e);
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1039
			sr = t.getSize(e);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1040
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1041
			return {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1042
				x : p.x,
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1043
				y : p.y,
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1044
				w : sr.w,
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1045
				h : sr.h
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1046
			};
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1047
		},
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1048
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1049
		getSize : function(e) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1050
			var t = this, w, h;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1051
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1052
			e = t.get(e);
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1053
			w = t.getStyle(e, 'width');
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1054
			h = t.getStyle(e, 'height');
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1055
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1056
			// Non pixel value, then force offset/clientWidth
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1057
			if (w.indexOf('px') === -1)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1058
				w = 0;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1059
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1060
			// Non pixel value, then force offset/clientWidth
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1061
			if (h.indexOf('px') === -1)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1062
				h = 0;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1063
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1064
			return {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1065
				w : parseInt(w) || e.offsetWidth || e.clientWidth,
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1066
				h : parseInt(h) || e.offsetHeight || e.clientHeight
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1067
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1068
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1069
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1070
		getParent : function(n, f, r) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1071
			return this.getParents(n, f, r, false);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1072
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1073
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1074
		getParents : function(n, f, r, c) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1075
			var t = this, na, se = t.settings, o = [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1076
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1077
			n = t.get(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1078
			c = c === undefined;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1079
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1080
			if (se.strict_root)
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1081
				r = r || t.getRoot();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1082
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1083
			// Wrap node name as func
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1084
			if (is(f, 'string')) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1085
				na = f;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1086
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1087
				if (f === '*') {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1088
					f = function(n) {return n.nodeType == 1;};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1089
				} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1090
					f = function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1091
						return t.is(n, na);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1092
					};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1093
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1094
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1095
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1096
			while (n) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1097
				if (n == r || !n.nodeType || n.nodeType === 9)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1098
					break;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1099
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1100
				if (!f || f(n)) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1101
					if (c)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1102
						o.push(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1103
					else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1104
						return n;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1105
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1106
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1107
				n = n.parentNode;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1108
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1109
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1110
			return c ? o : null;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1111
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1112
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1113
		get : function(e) {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1114
			var n;
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1115
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1116
			if (e && this.doc && typeof(e) == 'string') {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1117
				n = e;
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1118
				e = this.doc.getElementById(e);
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1119
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1120
				// IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1121
				if (e && e.id !== n)
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1122
					return this.doc.getElementsByName(n)[1];
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1123
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1124
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1125
			return e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1126
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1127
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1128
		getNext : function(node, selector) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1129
			return this._findSib(node, selector, 'nextSibling');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1130
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1131
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1132
		getPrev : function(node, selector) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1133
			return this._findSib(node, selector, 'previousSibling');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1134
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1135
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1136
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1137
		select : function(pa, s) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1138
			var t = this;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1139
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1140
			return tinymce.dom.Sizzle(pa, t.get(s) || t.get(t.settings.root_element) || t.doc, []);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1141
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1142
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1143
		is : function(n, patt) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1144
			return tinymce.dom.Sizzle.matches(patt, n.nodeType ? [n] : n).length > 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1145
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1146
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1147
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1148
		add : function(p, n, a, h, c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1149
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1150
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1151
			return this.run(p, function(p) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1152
				var e, k;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1153
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1154
				e = is(n, 'string') ? t.doc.createElement(n) : n;
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1155
				t.setAttribs(e, a);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1156
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1157
				if (h) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1158
					if (h.nodeType)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1159
						e.appendChild(h);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1160
					else
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1161
						t.setHTML(e, h);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1162
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1163
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1164
				return !c ? p.appendChild(e) : e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1165
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1166
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1167
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1168
		create : function(n, a, h) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1169
			return this.add(this.doc.createElement(n), n, a, h, 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1170
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1171
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1172
		createHTML : function(n, a, h) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1173
			var o = '', t = this, k;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1174
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1175
			o += '<' + n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1176
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1177
			for (k in a) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1178
				if (a.hasOwnProperty(k))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1179
					o += ' ' + k + '="' + t.encode(a[k]) + '"';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1180
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1181
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1182
			if (tinymce.is(h))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1183
				return o + '>' + h + '</' + n + '>';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1184
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1185
			return o + ' />';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1186
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1187
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1188
		remove : function(n, k) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1189
			var t = this;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1190
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1191
			return this.run(n, function(n) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1192
				var p, g, i;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1193
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1194
				p = n.parentNode;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1195
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1196
				if (!p)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1197
					return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1198
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1199
				if (k) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1200
					for (i = n.childNodes.length - 1; i >= 0; i--)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1201
						t.insertAfter(n.childNodes[i], n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1202
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1203
					//each(n.childNodes, function(c) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1204
					//	p.insertBefore(c.cloneNode(true), n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1205
					//});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1206
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1207
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1208
				// Fix IE psuedo leak
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1209
				if (t.fixPsuedoLeaks) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1210
					p = n.cloneNode(true);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1211
					k = 'IELeakGarbageBin';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1212
					g = t.get(k) || t.add(t.doc.body, 'div', {id : k, style : 'display:none'});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1213
					g.appendChild(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1214
					g.innerHTML = '';
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1215
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1216
					return p;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1217
				}
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1218
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1219
				return p.removeChild(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1220
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1221
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1222
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1223
		setStyle : function(n, na, v) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1224
			var t = this;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1225
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1226
			return t.run(n, function(e) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1227
				var s, i;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1228
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1229
				s = e.style;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1230
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1231
				// Camelcase it, if needed
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1232
				na = na.replace(/-(\D)/g, function(a, b){
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1233
					return b.toUpperCase();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1234
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1235
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1236
				// Default px suffix on these
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1237
				if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v)))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1238
					v += 'px';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1239
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1240
				switch (na) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1241
					case 'opacity':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1242
						// IE specific opacity
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1243
						if (isIE) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1244
							s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")";
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1245
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1246
							if (!n.currentStyle || !n.currentStyle.hasLayout)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1247
								s.display = 'inline-block';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1248
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1249
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1250
						// Fix for older browsers
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1251
						s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || '';
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1252
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1253
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1254
					case 'float':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1255
						isIE ? s.styleFloat = v : s.cssFloat = v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1256
						break;
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1257
					
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1258
					default:
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1259
						s[na] = v || '';
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1260
				}
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1261
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1262
				// Force update of the style data
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1263
				if (t.settings.update_styles)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1264
					t.setAttrib(e, 'mce_style');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1265
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1266
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1267
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1268
		getStyle : function(n, na, c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1269
			n = this.get(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1270
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1271
			if (!n)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1272
				return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1273
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1274
			// Gecko
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1275
			if (this.doc.defaultView && c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1276
				// Remove camelcase
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1277
				na = na.replace(/[A-Z]/g, function(a){
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1278
					return '-' + a;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1279
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1280
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1281
				try {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1282
					return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1283
				} catch (ex) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1284
					// Old safari might fail
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1285
					return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1286
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1287
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1288
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1289
			// Camelcase it, if needed
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1290
			na = na.replace(/-(\D)/g, function(a, b){
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1291
				return b.toUpperCase();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1292
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1293
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1294
			if (na == 'float')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1295
				na = isIE ? 'styleFloat' : 'cssFloat';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1296
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1297
			// IE & Opera
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1298
			if (n.currentStyle && c)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1299
				return n.currentStyle[na];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1300
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1301
			return n.style[na];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1302
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1303
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1304
		setStyles : function(e, o) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1305
			var t = this, s = t.settings, ol;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1306
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1307
			ol = s.update_styles;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1308
			s.update_styles = 0;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1309
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1310
			each(o, function(v, n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1311
				t.setStyle(e, n, v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1312
			});
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1313
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1314
			// Update style info
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1315
			s.update_styles = ol;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1316
			if (s.update_styles)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1317
				t.setAttrib(e, s.cssText);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1318
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1319
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1320
		setAttrib : function(e, n, v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1321
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1322
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1323
			// Whats the point
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1324
			if (!e || !n)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1325
				return;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1326
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1327
			// Strict XML mode
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1328
			if (t.settings.strict)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1329
				n = n.toLowerCase();
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1330
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1331
			return this.run(e, function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1332
				var s = t.settings;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1333
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1334
				switch (n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1335
					case "style":
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1336
						if (!is(v, 'string')) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1337
							each(v, function(v, n) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1338
								t.setStyle(e, n, v);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1339
							});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1340
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1341
							return;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1342
						}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1343
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1344
						// No mce_style for elements with these since they might get resized by the user
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1345
						if (s.keep_values) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1346
							if (v && !t._isRes(v))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1347
								e.setAttribute('mce_style', v, 2);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1348
							else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1349
								e.removeAttribute('mce_style', 2);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1350
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1351
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1352
						e.style.cssText = v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1353
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1354
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1355
					case "class":
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1356
						e.className = v || ''; // Fix IE null bug
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1357
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1358
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1359
					case "src":
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1360
					case "href":
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1361
						if (s.keep_values) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1362
							if (s.url_converter)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1363
								v = s.url_converter.call(s.url_converter_scope || t, v, n, e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1364
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1365
							t.setAttrib(e, 'mce_' + n, v, 2);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1366
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1367
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1368
						break;
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1369
					
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1370
					case "shape":
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1371
						e.setAttribute('mce_style', v);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1372
						break;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1373
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1374
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1375
				if (is(v) && v !== null && v.length !== 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1376
					e.setAttribute(n, '' + v, 2);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1377
				else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1378
					e.removeAttribute(n, 2);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1379
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1380
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1381
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1382
		setAttribs : function(e, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1383
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1384
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1385
			return this.run(e, function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1386
				each(o, function(v, n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1387
					t.setAttrib(e, n, v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1388
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1389
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1390
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1391
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1392
		getAttrib : function(e, n, dv) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1393
			var v, t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1394
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1395
			e = t.get(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1396
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1397
			if (!e || e.nodeType !== 1)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1398
				return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1399
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1400
			if (!is(dv))
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1401
				dv = '';
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1402
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1403
			// Try the mce variant for these
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1404
			if (/^(src|href|style|coords|shape)$/.test(n)) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1405
				v = e.getAttribute("mce_" + n);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1406
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1407
				if (v)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1408
					return v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1409
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1410
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1411
			if (isIE && t.props[n]) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1412
				v = e[t.props[n]];
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1413
				v = v && v.nodeValue ? v.nodeValue : v;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1414
			}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1415
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1416
			if (!v)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1417
				v = e.getAttribute(n, 2);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1418
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1419
			// Check boolean attribs
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1420
			if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1421
				if (e[t.props[n]] === true && v === '')
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1422
					return n;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1423
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1424
				return v ? n : '';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1425
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1426
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1427
			// Inner input elements will override attributes on form elements
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1428
			if (e.nodeName === "FORM" && e.getAttributeNode(n))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1429
				return e.getAttributeNode(n).nodeValue;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1430
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1431
			if (n === 'style') {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1432
				v = v || e.style.cssText;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1433
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1434
				if (v) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1435
					v = t.serializeStyle(t.parseStyle(v));
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1436
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1437
					if (t.settings.keep_values && !t._isRes(v))
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1438
						e.setAttribute('mce_style', v);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1439
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1440
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1441
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1442
			// Remove Apple and WebKit stuff
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1443
			if (isWebKit && n === "class" && v)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1444
				v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1445
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1446
			// Handle IE issues
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1447
			if (isIE) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1448
				switch (n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1449
					case 'rowspan':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1450
					case 'colspan':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1451
						// IE returns 1 as default value
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1452
						if (v === 1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1453
							v = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1454
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1455
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1456
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1457
					case 'size':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1458
						// IE returns +0 as default value for size
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1459
						if (v === '+0' || v === 20 || v === 0)
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1460
							v = '';
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1461
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1462
						break;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1463
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1464
					case 'width':
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1465
					case 'height':
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1466
					case 'vspace':
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1467
					case 'checked':
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1468
					case 'disabled':
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1469
					case 'readonly':
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1470
						if (v === 0)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1471
							v = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1472
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1473
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1474
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1475
					case 'hspace':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1476
						// IE returns -1 as default value
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1477
						if (v === -1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1478
							v = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1479
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1480
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1481
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1482
					case 'maxlength':
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1483
					case 'tabindex':
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1484
						// IE returns default value
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1485
						if (v === 32768 || v === 2147483647 || v === '32768')
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1486
							v = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1487
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1488
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1489
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1490
					case 'multiple':
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1491
					case 'compact':
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1492
					case 'noshade':
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1493
					case 'nowrap':
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1494
						if (v === 65535)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1495
							return n;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1496
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1497
						return dv;
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1498
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1499
					case 'shape':
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1500
						v = v.toLowerCase();
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1501
						break;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1502
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1503
					default:
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1504
						// IE has odd anonymous function for event attributes
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1505
						if (n.indexOf('on') === 0 && v)
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1506
							v = ('' + v).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1507
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1508
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1509
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1510
			return (v !== undefined && v !== null && v !== '') ? '' + v : dv;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1511
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1512
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1513
		getPos : function(n, ro) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1514
			var t = this, x = 0, y = 0, e, d = t.doc, r;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1515
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1516
			n = t.get(n);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1517
			ro = ro || d.body;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1518
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1519
			if (n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1520
				// Use getBoundingClientRect on IE, Opera has it but it's not perfect
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1521
				if (isIE && !t.stdMode) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1522
					n = n.getBoundingClientRect();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1523
					e = t.boxModel ? d.documentElement : d.body;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1524
					x = t.getStyle(t.select('html')[0], 'borderWidth'); // Remove border
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1525
					x = (x == 'medium' || t.boxModel && !t.isIE6) && 2 || x;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1526
					n.top += t.win.self != t.win.top ? 2 : 0; // IE adds some strange extra cord if used in a frameset
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1527
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1528
					return {x : n.left + e.scrollLeft - x, y : n.top + e.scrollTop - x};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1529
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1530
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1531
				r = n;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1532
				while (r && r != ro && r.nodeType) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1533
					x += r.offsetLeft || 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1534
					y += r.offsetTop || 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1535
					r = r.offsetParent;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1536
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1537
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1538
				r = n.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1539
				while (r && r != ro && r.nodeType) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1540
					x -= r.scrollLeft || 0;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1541
					y -= r.scrollTop || 0;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1542
					r = r.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1543
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1544
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1545
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1546
			return {x : x, y : y};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1547
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1548
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1549
		parseStyle : function(st) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1550
			var t = this, s = t.settings, o = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1551
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1552
			if (!st)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1553
				return o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1554
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1555
			function compress(p, s, ot) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1556
				var t, r, b, l;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1557
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1558
				// Get values and check it it needs compressing
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1559
				t = o[p + '-top' + s];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1560
				if (!t)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1561
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1562
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1563
				r = o[p + '-right' + s];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1564
				if (t != r)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1565
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1566
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1567
				b = o[p + '-bottom' + s];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1568
				if (r != b)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1569
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1570
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1571
				l = o[p + '-left' + s];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1572
				if (b != l)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1573
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1574
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1575
				// Compress
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1576
				o[ot] = l;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1577
				delete o[p + '-top' + s];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1578
				delete o[p + '-right' + s];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1579
				delete o[p + '-bottom' + s];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1580
				delete o[p + '-left' + s];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1581
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1582
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1583
			function compress2(ta, a, b, c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1584
				var t;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1585
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1586
				t = o[a];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1587
				if (!t)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1588
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1589
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1590
				t = o[b];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1591
				if (!t)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1592
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1593
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1594
				t = o[c];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1595
				if (!t)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1596
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1597
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1598
				// Compress
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1599
				o[ta] = o[a] + ' ' + o[b] + ' ' + o[c];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1600
				delete o[a];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1601
				delete o[b];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1602
				delete o[c];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1603
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1604
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1605
			st = st.replace(/&(#?[a-z0-9]+);/g, '&$1_MCE_SEMI_'); // Protect entities
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1606
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1607
			each(st.split(';'), function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1608
				var sv, ur = [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1609
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1610
				if (v) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1611
					v = v.replace(/_MCE_SEMI_/g, ';'); // Restore entities
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1612
					v = v.replace(/url\([^\)]+\)/g, function(v) {ur.push(v);return 'url(' + ur.length + ')';});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1613
					v = v.split(':');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1614
					sv = tinymce.trim(v[1]);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1615
					sv = sv.replace(/url\(([^\)]+)\)/g, function(a, b) {return ur[parseInt(b) - 1];});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1616
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1617
					sv = sv.replace(/rgb\([^\)]+\)/g, function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1618
						return t.toHex(v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1619
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1620
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1621
					if (s.url_converter) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1622
						sv = sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g, function(x, c) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1623
							return 'url(' + s.url_converter.call(s.url_converter_scope || t, t.decode(c), 'style', null) + ')';
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1624
						});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1625
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1626
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1627
					o[tinymce.trim(v[0]).toLowerCase()] = sv;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1628
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1629
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1630
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1631
			compress("border", "", "border");
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1632
			compress("border", "-width", "border-width");
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1633
			compress("border", "-color", "border-color");
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1634
			compress("border", "-style", "border-style");
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1635
			compress("padding", "", "padding");
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1636
			compress("margin", "", "margin");
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1637
			compress2('border', 'border-width', 'border-style', 'border-color');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1638
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1639
			if (isIE) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1640
				// Remove pointless border
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1641
				if (o.border == 'medium none')
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1642
					o.border = '';
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1643
			}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1644
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1645
			return o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1646
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1647
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1648
		serializeStyle : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1649
			var s = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1650
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1651
			each(o, function(v, k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1652
				if (k && v) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1653
					if (tinymce.isGecko && k.indexOf('-moz-') === 0)
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1654
						return;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1655
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1656
					switch (k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1657
						case 'color':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1658
						case 'background-color':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1659
							v = v.toLowerCase();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1660
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1661
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1662
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1663
					s += (s ? ' ' : '') + k + ': ' + v + ';';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1664
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1665
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1666
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1667
			return s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1668
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1669
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1670
		loadCSS : function(u) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1671
			var t = this, d = t.doc, head;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1672
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1673
			if (!u)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1674
				u = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1675
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1676
			head = t.select('head')[0];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1677
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1678
			each(u.split(','), function(u) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1679
				var link;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1680
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1681
				if (t.files[u])
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1682
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1683
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1684
				t.files[u] = true;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1685
				link = t.create('link', {rel : 'stylesheet', href : tinymce._addVer(u)});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1686
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1687
				// IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1688
				// This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1689
				// It's ugly but it seems to work fine.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1690
				if (isIE && d.documentMode) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1691
					link.onload = function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1692
						d.recalc();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1693
						link.onload = null;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1694
					};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1695
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1696
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1697
				head.appendChild(link);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1698
			});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1699
		},
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1700
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1701
		addClass : function(e, c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1702
			return this.run(e, function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1703
				var o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1704
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1705
				if (!c)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1706
					return 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1707
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1708
				if (this.hasClass(e, c))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1709
					return e.className;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1710
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1711
				o = this.removeClass(e, c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1712
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1713
				return e.className = (o != '' ? (o + ' ') : '') + c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1714
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1715
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1716
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1717
		removeClass : function(e, c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1718
			var t = this, re;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1719
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1720
			return t.run(e, function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1721
				var v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1722
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1723
				if (t.hasClass(e, c)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1724
					if (!re)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1725
						re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g");
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1726
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1727
					v = e.className.replace(re, ' ');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1728
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1729
					return e.className = tinymce.trim(v != ' ' ? v : '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1730
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1731
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1732
				return e.className;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1733
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1734
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1735
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1736
		hasClass : function(n, c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1737
			n = this.get(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1738
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1739
			if (!n || !c)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1740
				return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1741
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1742
			return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1743
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1744
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1745
		show : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1746
			return this.setStyle(e, 'display', 'block');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1747
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1748
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1749
		hide : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1750
			return this.setStyle(e, 'display', 'none');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1751
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1752
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1753
		isHidden : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1754
			e = this.get(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1755
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1756
			return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none';
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1757
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1758
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1759
		uniqueId : function(p) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1760
			return (!p ? 'mce_' : p) + (this.counter++);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1761
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1762
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1763
		setHTML : function(e, h) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1764
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1765
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1766
			return this.run(e, function(e) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1767
				var x, i, nl, n, p, x;
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1768
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1769
				h = t.processHTML(h);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1770
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1771
				if (isIE) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1772
					function set() {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1773
						try {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1774
							// IE will remove comments from the beginning
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1775
							// unless you padd the contents with something
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1776
							e.innerHTML = '<br />' + h;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1777
							e.removeChild(e.firstChild);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1778
						} catch (ex) {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1779
							// IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1780
							// This seems to fix this problem
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1781
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1782
							// Remove all child nodes
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1783
							while (e.firstChild)
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1784
								e.firstChild.removeNode();
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1785
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1786
							// Create new div with HTML contents and a BR infront to keep comments
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1787
							x = t.create('div');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1788
							x.innerHTML = '<br />' + h;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1789
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1790
							// Add all children from div to target
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1791
							each (x.childNodes, function(n, i) {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1792
								// Skip br element
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  1793
								if (i)
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1794
									e.appendChild(n);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1795
							});
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1796
						}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1797
					};
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1798
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1799
					// IE has a serious bug when it comes to paragraphs it can produce an invalid
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1800
					// DOM tree if contents like this <p><ul><li>Item 1</li></ul></p> is inserted
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1801
					// It seems to be that IE doesn't like a root block element placed inside another root block element
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1802
					if (t.settings.fix_ie_paragraphs)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1803
						h = h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi, '<p$1 mce_keep="true">&nbsp;</p>');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1804
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1805
					set();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1806
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1807
					if (t.settings.fix_ie_paragraphs) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1808
						// Check for odd paragraphs this is a sign of a broken DOM
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1809
						nl = e.getElementsByTagName("p");
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1810
						for (i = nl.length - 1, x = 0; i >= 0; i--) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1811
							n = nl[i];
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1812
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1813
							if (!n.hasChildNodes()) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1814
								if (!n.mce_keep) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1815
									x = 1; // Is broken
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1816
									break;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1817
								}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1818
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1819
								n.removeAttribute('mce_keep');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1820
							}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1821
						}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1822
					}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1823
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1824
					// Time to fix the madness IE left us
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1825
					if (x) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1826
						// So if we replace the p elements with divs and mark them and then replace them back to paragraphs
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1827
						// after we use innerHTML we can fix the DOM tree
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1828
						h = h.replace(/<p ([^>]+)>|<p>/ig, '<div $1 mce_tmp="1">');
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1829
						h = h.replace(/<\/p>/g, '</div>');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1830
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1831
						// Set the new HTML with DIVs
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1832
						set();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1833
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1834
						// Replace all DIV elements with he mce_tmp attibute back to paragraphs
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1835
						// This is needed since IE has a annoying bug see above for details
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1836
						// This is a slow process but it has to be done. :(
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1837
						if (t.settings.fix_ie_paragraphs) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1838
							nl = e.getElementsByTagName("DIV");
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1839
							for (i = nl.length - 1; i >= 0; i--) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1840
								n = nl[i];
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1841
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1842
								// Is it a temp div
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1843
								if (n.mce_tmp) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1844
									// Create new paragraph
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1845
									p = t.doc.createElement('p');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1846
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1847
									// Copy all attributes
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1848
									n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi, function(a, b) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1849
										var v;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1850
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1851
										if (b !== 'mce_tmp') {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1852
											v = n.getAttribute(b);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1853
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1854
											if (!v && b === 'class')
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1855
												v = n.className;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1856
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1857
											p.setAttribute(b, v);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1858
										}
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1859
									});
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1860
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1861
									// Append all children to new paragraph
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1862
									for (x = 0; x<n.childNodes.length; x++)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1863
										p.appendChild(n.childNodes[x].cloneNode(true));
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1864
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1865
									// Replace div with new paragraph
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1866
									n.swapNode(p);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1867
								}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1868
							}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  1869
						}
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1870
					}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1871
				} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1872
					e.innerHTML = h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1873
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1874
				return h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1875
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1876
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1877
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1878
		processHTML : function(h) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1879
			var t = this, s = t.settings, codeBlocks = [];
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1880
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1881
			if (!s.process_html)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1882
				return h;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1883
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1884
			// Convert strong and em to b and i in FF since it can't handle them
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1885
			if (tinymce.isGecko) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1886
				h = h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi, '<$1b$2>');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1887
				h = h.replace(/<(\/?)em>|<em( [^>]+)>/gi, '<$1i$2>');
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1888
			} else if (isIE) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1889
				h = h.replace(/&apos;/g, '&#39;'); // IE can't handle apos
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1890
				h = h.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi, ''); // IE doesn't handle default values correct
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1891
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1892
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1893
			// Fix some issues
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1894
			h = h.replace(/<a( )([^>]+)\/>|<a\/>/gi, '<a$1$2></a>'); // Force open
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1895
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1896
			// Store away src and href in mce_src and mce_href since browsers mess them up
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1897
			if (s.keep_values) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1898
				// Wrap scripts and styles in comments for serialization purposes
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1899
				if (/<script|noscript|style/i.test(h)) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1900
					function trim(s) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1901
						// Remove prefix and suffix code for element
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1902
						s = s.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n');
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1903
						s = s.replace(/^[\r\n]*|[\r\n]*$/g, '');
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1904
						s = s.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g, '');
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1905
						s = s.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g, '');
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1906
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1907
						return s;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1908
					};
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1909
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1910
					// Wrap the script contents in CDATA and keep them from executing
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1911
					h = h.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi, function(v, attribs, text) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1912
						// Force type attribute
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1913
						if (!attribs)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1914
							attribs = ' type="text/javascript"';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1915
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1916
						// Convert the src attribute of the scripts
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1917
						attribs = attribs.replace(/src=\"([^\"]+)\"?/i, function(a, url) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1918
							if (s.url_converter)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1919
								url = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(url), 'src', 'script'));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1920
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1921
							return 'mce_src="' + url + '"';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1922
						});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1923
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1924
						// Wrap text contents
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1925
						if (tinymce.trim(text)) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1926
							codeBlocks.push(trim(text));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1927
							text = '<!--\nMCE_SCRIPT:' + (codeBlocks.length - 1) + '\n// -->';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1928
						}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1929
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1930
						return '<mce:script' + attribs + '>' + text + '</mce:script>';
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1931
					});
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1932
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1933
					// Wrap style elements
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1934
					h = h.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi, function(v, attribs, text) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1935
						// Wrap text contents
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1936
						if (text) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1937
							codeBlocks.push(trim(text));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1938
							text = '<!--\nMCE_SCRIPT:' + (codeBlocks.length - 1) + '\n-->';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1939
						}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1940
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1941
						return '<mce:style' + attribs + '>' + text + '</mce:style><style ' + attribs + ' mce_bogus="1">' + text + '</style>';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1942
					});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1943
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1944
					// Wrap noscript elements
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1945
					h = h.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1946
						return '<mce:noscript' + attribs + '><!--' + t.encode(text).replace(/--/g, '&#45;&#45;') + '--></mce:noscript>';
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1947
					});
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1948
				}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  1949
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1950
				h = h.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g, '<!--[CDATA[$1]]-->');
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  1951
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1952
				// Remove false bool attributes and force attributes into xhtml style attr="attr"
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1953
				h = h.replace(/<([\w:]+) [^>]*(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)[^>]*>/gi, function(val) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1954
					function handle(val, name, value) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1955
						// Remove false/0 attribs
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1956
						if (value === 'false' || value === '0')
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1957
							return '';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1958
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1959
						return ' ' + name + '="' + name + '"';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1960
					};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1961
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1962
					val = val.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\"]([^\"]+)[\"]/gi, handle); // W3C
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1963
					val = val.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\']([^\']+)[\']/gi, handle); // W3C
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1964
					val = val.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=([^\s\"\'>]+)/gi, handle); // IE
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1965
					val = val.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)([\s>])/gi, ' $1="$1"$2'); // Force attr="attr"
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1966
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1967
					return val;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1968
				});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1969
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1970
				// Process all tags with src, href or style
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1971
				h = h.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi, function(a, n) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1972
					function handle(m, b, c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1973
						var u = c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1974
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1975
						// Tag already got a mce_ version
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1976
						if (a.indexOf('mce_' + b) != -1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1977
							return m;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1978
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1979
						if (b == 'style') {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1980
							// No mce_style for elements with these since they might get resized by the user
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1981
							if (t._isRes(c))
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1982
								return m;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  1983
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1984
							// Parse and serialize the style to convert for example uppercase styles like "BORDER: 1px"
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1985
							u = t.encode(t.serializeStyle(t.parseStyle(u)));
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1986
						} else if (b != 'coords' && b != 'shape') {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1987
							if (s.url_converter)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1988
								u = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), b, n));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1989
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1990
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1991
						return ' ' + b + '="' + c + '" mce_' + b + '="' + u + '"';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1992
					};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1993
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1994
					a = a.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi, handle); // W3C
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1995
					a = a.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi, handle); // W3C
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1996
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  1997
					return a.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi, handle); // IE
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  1998
				});
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  1999
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2000
				// Restore script blocks
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2001
				h = h.replace(/MCE_SCRIPT:([0-9]+)/g, function(val, idx) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2002
					return codeBlocks[idx];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2003
				});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2004
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2005
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2006
			return h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2007
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2008
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2009
		getOuterHTML : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2010
			var d;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2011
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2012
			e = this.get(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2013
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2014
			if (!e)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2015
				return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2016
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2017
			if (e.outerHTML !== undefined)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2018
				return e.outerHTML;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2019
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2020
			d = (e.ownerDocument || this.doc).createElement("body");
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2021
			d.appendChild(e.cloneNode(true));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2022
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2023
			return d.innerHTML;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2024
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2025
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2026
		setOuterHTML : function(e, h, d) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2027
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2028
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2029
			function setHTML(e, h, d) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2030
				var n, tp;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2031
				
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2032
				tp = d.createElement("body");
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2033
				tp.innerHTML = h;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2034
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2035
				n = tp.lastChild;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2036
				while (n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2037
					t.insertAfter(n.cloneNode(true), e);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2038
					n = n.previousSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2039
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2040
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2041
				t.remove(e);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2042
			};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2043
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2044
			return this.run(e, function(e) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2045
				e = t.get(e);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2046
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2047
				// Only set HTML on elements
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2048
				if (e.nodeType == 1) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2049
					d = d || e.ownerDocument || t.doc;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2050
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2051
					if (isIE) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2052
						try {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2053
							// Try outerHTML for IE it sometimes produces an unknown runtime error
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2054
							if (isIE && e.nodeType == 1)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2055
								e.outerHTML = h;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2056
							else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2057
								setHTML(e, h, d);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2058
						} catch (ex) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2059
							// Fix for unknown runtime error
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2060
							setHTML(e, h, d);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2061
						}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2062
					} else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2063
						setHTML(e, h, d);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2064
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2065
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2066
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2067
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2068
		decode : function(s) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  2069
			var e, n, v;
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  2070
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  2071
			// Look for entities to decode
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  2072
			if (/&[^;]+;/.test(s)) {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  2073
				// Decode the entities using a div element not super efficient but less code
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  2074
				e = this.doc.createElement("div");
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  2075
				e.innerHTML = s;
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  2076
				n = e.firstChild;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  2077
				v = '';
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  2078
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  2079
				if (n) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  2080
					do {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  2081
						v += n.nodeValue;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  2082
					} while (n.nextSibling);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  2083
				}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  2084
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  2085
				return v || s;
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  2086
			}
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  2087
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  2088
			return s;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2089
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2090
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2091
		encode : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2092
			return s ? ('' + s).replace(/[<>&\"]/g, function (c, b) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2093
				switch (c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2094
					case '&':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2095
						return '&amp;';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2096
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2097
					case '"':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2098
						return '&quot;';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2099
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2100
					case '<':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2101
						return '&lt;';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2102
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2103
					case '>':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2104
						return '&gt;';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2105
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2106
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2107
				return c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2108
			}) : s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2109
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2110
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2111
		insertAfter : function(n, r) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2112
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2113
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2114
			r = t.get(r);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2115
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2116
			return this.run(n, function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2117
				var p, ns;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2118
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2119
				p = r.parentNode;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2120
				ns = r.nextSibling;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2121
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2122
				if (ns)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2123
					p.insertBefore(n, ns);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2124
				else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2125
					p.appendChild(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2126
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2127
				return n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2128
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2129
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2130
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2131
		isBlock : function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2132
			if (n.nodeType && n.nodeType !== 1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2133
				return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2134
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2135
			n = n.nodeName || n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2136
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2137
			return /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TH|TBODY|TR|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2138
		},
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2139
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2140
		replace : function(n, o, k) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2141
			var t = this;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2142
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2143
			if (is(o, 'array'))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2144
				n = n.cloneNode(true);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2145
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2146
			return t.run(o, function(o) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2147
				if (k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2148
					each(o.childNodes, function(c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2149
						n.appendChild(c.cloneNode(true));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2150
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2151
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2152
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2153
				// Fix IE psuedo leak for elements since replacing elements if fairly common
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2154
				// Will break parentNode for some unknown reason
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2155
				if (t.fixPsuedoLeaks && o.nodeType === 1) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2156
					o.parentNode.insertBefore(n, o);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2157
					t.remove(o);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2158
					return n;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2159
				}
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2160
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2161
				return o.parentNode.replaceChild(n, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2162
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2163
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2164
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2165
		findCommonAncestor : function(a, b) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2166
			var ps = a, pe;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2167
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2168
			while (ps) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2169
				pe = b;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2170
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2171
				while (pe && ps != pe)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2172
					pe = pe.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2173
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2174
				if (ps == pe)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2175
					break;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2176
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2177
				ps = ps.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2178
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2179
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2180
			if (!ps && a.ownerDocument)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2181
				return a.ownerDocument.documentElement;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2182
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2183
			return ps;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2184
		},
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2185
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2186
		toHex : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2187
			var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2188
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2189
			function hex(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2190
				s = parseInt(s).toString(16);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2191
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2192
				return s.length > 1 ? s : '0' + s; // 0 -> 00
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2193
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2194
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2195
			if (c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2196
				s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2197
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2198
				return s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2199
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2200
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2201
			return s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2202
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2203
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2204
		getClasses : function() {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  2205
			var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2206
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2207
			if (t.classes)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2208
				return t.classes;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2209
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2210
			function addClasses(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2211
				// IE style imports
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2212
				each(s.imports, function(r) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2213
					addClasses(r);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2214
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2215
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2216
				each(s.cssRules || s.rules, function(r) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2217
					// Real type or fake it on IE
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2218
					switch (r.type || 1) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2219
						// Rule
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2220
						case 1:
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2221
							if (r.selectorText) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2222
								each(r.selectorText.split(','), function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2223
									v = v.replace(/^\s*|\s*$|^\s\./g, "");
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2224
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  2225
									// Is internal or it doesn't contain a class
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  2226
									if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2227
										return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2228
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  2229
									// Remove everything but class name
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  2230
									ov = v;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  2231
									v = v.replace(/.*\.([a-z0-9_\-]+).*/i, '$1');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  2232
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  2233
									// Filter classes
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  2234
									if (f && !(v = f(v, ov)))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2235
										return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2236
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2237
									if (!lo[v]) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2238
										cl.push({'class' : v});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2239
										lo[v] = 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2240
									}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2241
								});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2242
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2243
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2244
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2245
						// Import
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2246
						case 3:
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2247
							addClasses(r.styleSheet);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2248
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2249
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2250
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2251
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2252
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2253
			try {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2254
				each(t.doc.styleSheets, addClasses);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2255
			} catch (ex) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2256
				// Ignore
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2257
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2258
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2259
			if (cl.length > 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2260
				t.classes = cl;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2261
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2262
			return cl;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2263
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2264
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2265
		run : function(e, f, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2266
			var t = this, o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2267
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2268
			if (t.doc && typeof(e) === 'string')
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  2269
				e = t.get(e);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2270
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2271
			if (!e)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2272
				return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2273
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2274
			s = s || this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2275
			if (!e.nodeType && (e.length || e.length === 0)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2276
				o = [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2277
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2278
				each(e, function(e, i) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2279
					if (e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2280
						if (typeof(e) == 'string')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2281
							e = t.doc.getElementById(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2282
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2283
						o.push(f.call(s, e, i));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2284
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2285
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2286
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2287
				return o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2288
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2289
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2290
			return f.call(s, e);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2291
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2292
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2293
		getAttribs : function(n) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2294
			var o;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2295
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2296
			n = this.get(n);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2297
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2298
			if (!n)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2299
				return [];
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2300
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2301
			if (isIE) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2302
				o = [];
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2303
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2304
				// Object will throw exception in IE
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2305
				if (n.nodeName == 'OBJECT')
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2306
					return n.attributes;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2307
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2308
				// IE doesn't keep the selected attribute if you clone option elements
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2309
				if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected'))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2310
					o.push({specified : 1, nodeName : 'selected'});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2311
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2312
				// It's crazy that this is faster in IE but it's because it returns all attributes all the time
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2313
				n.cloneNode(false).outerHTML.replace(/<\/?[\w:]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=\w+|>/gi, '').replace(/[\w:]+/gi, function(a) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2314
					o.push({specified : 1, nodeName : a});
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2315
				});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2316
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2317
				return o;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2318
			}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2319
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2320
			return n.attributes;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2321
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2322
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2323
		destroy : function(s) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2324
			var t = this;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2325
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2326
			if (t.events)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2327
				t.events.destroy();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2328
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2329
			t.win = t.doc = t.root = t.events = null;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2330
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2331
			// Manual destroy then remove unload handler
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2332
			if (!s)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2333
				tinymce.removeUnload(t.destroy);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2334
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2335
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2336
		createRng : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2337
			var d = this.doc;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2338
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2339
			return d.createRange ? d.createRange() : new tinymce.dom.Range(this);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2340
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2341
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2342
		split : function(pe, e, re) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2343
			var t = this, r = t.createRng(), bef, aft, pa;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2344
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2345
			// W3C valid browsers tend to leave empty nodes to the left/right side of the contents, this makes sence
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2346
			// but we don't want that in our code since it serves no purpose
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2347
			// For example if this is chopped:
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2348
			//   <p>text 1<span><b>CHOP</b></span>text 2</p>
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2349
			// would produce:
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2350
			//   <p>text 1<span></span></p><b>CHOP</b><p><span></span>text 2</p>
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2351
			// this function will then trim of empty edges and produce:
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2352
			//   <p>text 1</p><b>CHOP</b><p>text 2</p>
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2353
			function trimEdge(n, na) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2354
				n = n[na];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2355
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2356
				if (n && n[na] && n[na].nodeType == 1 && isEmpty(n[na]))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2357
					t.remove(n[na]);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2358
			};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2359
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2360
			function isEmpty(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2361
				n = t.getOuterHTML(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2362
				n = n.replace(/<(img|hr|table)/gi, '-'); // Keep these convert them to - chars
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2363
				n = n.replace(/<[^>]+>/g, ''); // Remove all tags
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2364
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2365
				return n.replace(/[ \t\r\n]+|&nbsp;|&#160;/g, '') == '';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2366
			};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2367
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2368
			// Added until Gecko can create real HTML documents using implementation.createHTMLDocument
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2369
			// this is to future proof it if Gecko decides to implement the error checking for range methods.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2370
			function nodeIndex(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2371
				var i = 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2372
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2373
				while (n.previousSibling) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2374
					i++;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2375
					n = n.previousSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2376
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2377
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2378
				return i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2379
			};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2380
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2381
			if (pe && e) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2382
				// Get before chunk
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2383
				r.setStart(pe.parentNode, nodeIndex(pe));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2384
				r.setEnd(e.parentNode, nodeIndex(e));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2385
				bef = r.extractContents();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2386
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2387
				// Get after chunk
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2388
				r = t.createRng();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2389
				r.setStart(e.parentNode, nodeIndex(e) + 1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2390
				r.setEnd(pe.parentNode, nodeIndex(pe) + 1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2391
				aft = r.extractContents();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2392
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2393
				// Insert chunks and remove parent
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2394
				pa = pe.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2395
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2396
				// Remove right side edge of the before contents
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2397
				trimEdge(bef, 'lastChild');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2398
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2399
				if (!isEmpty(bef))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2400
					pa.insertBefore(bef, pe);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2401
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2402
				if (re)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2403
					pa.replaceChild(re, e);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2404
				else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2405
					pa.insertBefore(e, pe);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2406
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2407
				// Remove left site edge of the after contents
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2408
				trimEdge(aft, 'firstChild');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2409
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2410
				if (!isEmpty(aft))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2411
					pa.insertBefore(aft, pe);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2412
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2413
				t.remove(pe);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2414
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2415
				return re || e;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2416
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2417
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2418
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2419
		bind : function(target, name, func, scope) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2420
			var t = this;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2421
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2422
			if (!t.events)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2423
				t.events = new tinymce.dom.EventUtils();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2424
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2425
			return t.events.add(target, name, func, scope || this);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2426
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2427
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2428
		unbind : function(target, name, func) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2429
			var t = this;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2430
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2431
			if (!t.events)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2432
				t.events = new tinymce.dom.EventUtils();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2433
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2434
			return t.events.remove(target, name, func);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2435
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2436
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2437
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2438
		_findSib : function(node, selector, name) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2439
			var t = this, f = selector;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2440
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2441
			if (node) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2442
				// If expression make a function of it using is
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2443
				if (is(f, 'string')) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2444
					f = function(node) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2445
						return t.is(node, selector);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2446
					};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2447
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2448
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2449
				// Loop all siblings
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2450
				for (node = node[name]; node; node = node[name]) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2451
					if (f(node))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2452
						return node;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2453
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2454
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2455
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2456
			return null;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2457
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2458
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2459
		_isRes : function(c) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  2460
			// Is live resizble element
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  2461
			return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2462
		}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2463
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2464
		/*
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2465
		walk : function(n, f, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2466
			var d = this.doc, w;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2467
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2468
			if (d.createTreeWalker) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2469
				w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2470
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2471
				while ((n = w.nextNode()) != null)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2472
					f.call(s || this, n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2473
			} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2474
				tinymce.walk(n, f, 'childNodes', s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2475
		}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2476
		*/
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2477
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2478
		/*
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2479
		toRGB : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2480
			var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2481
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2482
			if (c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2483
				// #FFF -> #FFFFFF
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2484
				if (!is(c[3]))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2485
					c[3] = c[2] = c[1];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2486
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2487
				return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")";
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2488
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2489
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2490
			return s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2491
		}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  2492
		*/
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2493
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2494
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  2495
	tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0});
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2496
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2497
(function(ns) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2498
	// Traverse constants
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2499
	var EXTRACT = 0, CLONE = 1, DELETE = 2, extend = tinymce.extend;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2500
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2501
	function indexOf(child, parent) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2502
		var i, node;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2503
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2504
		if (child.parentNode != parent)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2505
			return -1;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2506
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2507
		for (node = parent.firstChild, i = 0; node != child; node = node.nextSibling)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2508
			i++;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2509
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2510
		return i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2511
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2512
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2513
	function nodeIndex(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2514
		var i = 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2515
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2516
		while (n.previousSibling) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2517
			i++;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2518
			n = n.previousSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2519
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2520
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2521
		return i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2522
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2523
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2524
	function getSelectedNode(container, offset) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2525
		var child;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2526
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2527
		if (container.nodeType == 3 /* TEXT_NODE */)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2528
			return container;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2529
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2530
		if (offset < 0)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2531
			return container;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2532
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2533
		child = container.firstChild;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2534
		while (child != null && offset > 0) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2535
			--offset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2536
			child = child.nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2537
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2538
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2539
		if (child != null)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2540
			return child;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2541
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2542
		return container;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2543
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2544
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2545
	// Range constructor
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2546
	function Range(dom) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2547
		var d = dom.doc;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2548
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2549
		extend(this, {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2550
			dom : dom,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2551
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2552
			// Inital states
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2553
			startContainer : d,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2554
			startOffset : 0,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2555
			endContainer : d,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2556
			endOffset : 0,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2557
			collapsed : true,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2558
			commonAncestorContainer : d,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2559
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2560
			// Range constants
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2561
			START_TO_START : 0,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2562
			START_TO_END : 1,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2563
			END_TO_END : 2,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2564
			END_TO_START : 3
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2565
		});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2566
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2567
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2568
	// Add range methods
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2569
	extend(Range.prototype, {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2570
		setStart : function(n, o) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2571
			this._setEndPoint(true, n, o);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2572
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2573
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2574
		setEnd : function(n, o) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2575
			this._setEndPoint(false, n, o);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2576
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2577
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2578
		setStartBefore : function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2579
			this.setStart(n.parentNode, nodeIndex(n));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2580
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2581
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2582
		setStartAfter : function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2583
			this.setStart(n.parentNode, nodeIndex(n) + 1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2584
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2585
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2586
		setEndBefore : function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2587
			this.setEnd(n.parentNode, nodeIndex(n));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2588
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2589
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2590
		setEndAfter : function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2591
			this.setEnd(n.parentNode, nodeIndex(n) + 1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2592
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2593
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2594
		collapse : function(ts) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2595
			var t = this;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2596
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2597
			if (ts) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2598
				t.endContainer = t.startContainer;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2599
				t.endOffset = t.startOffset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2600
			} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2601
				t.startContainer = t.endContainer;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2602
				t.startOffset = t.endOffset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2603
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2604
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2605
			t.collapsed = true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2606
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2607
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2608
		selectNode : function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2609
			this.setStartBefore(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2610
			this.setEndAfter(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2611
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2612
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2613
		selectNodeContents : function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2614
			this.setStart(n, 0);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2615
			this.setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2616
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2617
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2618
		compareBoundaryPoints : function(h, r) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2619
			var t = this, sc = t.startContainer, so = t.startOffset, ec = t.endContainer, eo = t.endOffset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2620
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2621
			// Check START_TO_START
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2622
			if (h === 0)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2623
				return t._compareBoundaryPoints(sc, so, sc, so);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2624
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2625
			// Check START_TO_END
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2626
			if (h === 1)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2627
				return t._compareBoundaryPoints(sc, so, ec, eo);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2628
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2629
			// Check END_TO_END
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2630
			if (h === 2)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2631
				return t._compareBoundaryPoints(ec, eo, ec, eo);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2632
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2633
			// Check END_TO_START
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2634
			if (h === 3)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2635
				return t._compareBoundaryPoints(ec, eo, sc, so);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2636
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2637
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2638
		deleteContents : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2639
			this._traverse(DELETE);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2640
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2641
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2642
		extractContents : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2643
			return this._traverse(EXTRACT);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2644
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2645
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2646
		cloneContents : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2647
			return this._traverse(CLONE);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2648
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2649
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2650
		insertNode : function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2651
			var t = this, nn, o;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2652
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2653
			// Node is TEXT_NODE or CDATA
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2654
			if (n.nodeType === 3 || n.nodeType === 4) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2655
				nn = t.startContainer.splitText(t.startOffset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2656
				t.startContainer.parentNode.insertBefore(n, nn);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2657
			} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2658
				// Insert element node
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2659
				if (t.startContainer.childNodes.length > 0)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2660
					o = t.startContainer.childNodes[t.startOffset];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2661
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2662
				t.startContainer.insertBefore(n, o);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2663
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2664
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2665
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2666
		surroundContents : function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2667
			var t = this, f = t.extractContents();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2668
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2669
			t.insertNode(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2670
			n.appendChild(f);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2671
			t.selectNode(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2672
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2673
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2674
		cloneRange : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2675
			var t = this;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2676
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2677
			return extend(new Range(t.dom), {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2678
				startContainer : t.startContainer,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2679
				startOffset : t.startOffset,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2680
				endContainer : t.endContainer,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2681
				endOffset : t.endOffset,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2682
				collapsed : t.collapsed,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2683
				commonAncestorContainer : t.commonAncestorContainer
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2684
			});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2685
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2686
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2687
/*
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2688
		detach : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2689
			// Not implemented
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2690
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2691
*/
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2692
		// Internal methods
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2693
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2694
		_isCollapsed : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2695
			return (this.startContainer == this.endContainer && this.startOffset == this.endOffset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2696
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2697
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2698
		_compareBoundaryPoints : function (containerA, offsetA, containerB, offsetB) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2699
			var c, offsetC, n, cmnRoot, childA, childB;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2700
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2701
			// In the first case the boundary-points have the same container. A is before B 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2702
			// if its offset is less than the offset of B, A is equal to B if its offset is 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2703
			// equal to the offset of B, and A is after B if its offset is greater than the 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2704
			// offset of B.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2705
			if (containerA == containerB) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2706
				if (offsetA == offsetB) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2707
					return 0; // equal
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2708
				} else if (offsetA < offsetB) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2709
					return -1; // before
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2710
				} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2711
					return 1; // after
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2712
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2713
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2714
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2715
			// In the second case a child node C of the container of A is an ancestor 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2716
			// container of B. In this case, A is before B if the offset of A is less than or 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2717
			// equal to the index of the child node C and A is after B otherwise.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2718
			c = containerB;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2719
			while (c && c.parentNode != containerA) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2720
				c = c.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2721
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2722
			if (c) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2723
				offsetC = 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2724
				n = containerA.firstChild;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2725
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2726
				while (n != c && offsetC < offsetA) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2727
					offsetC++;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2728
					n = n.nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2729
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2730
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2731
				if (offsetA <= offsetC) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2732
					return -1; // before
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2733
				} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2734
					return 1; // after
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2735
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2736
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2737
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2738
			// In the third case a child node C of the container of B is an ancestor container 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2739
			// of A. In this case, A is before B if the index of the child node C is less than 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2740
			// the offset of B and A is after B otherwise.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2741
			c = containerA;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2742
			while (c && c.parentNode != containerB) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2743
				c = c.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2744
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2745
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2746
			if (c) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2747
				offsetC = 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2748
				n = containerB.firstChild;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2749
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2750
				while (n != c && offsetC < offsetB) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2751
					offsetC++;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2752
					n = n.nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2753
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2754
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2755
				if (offsetC < offsetB) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2756
					return -1; // before
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2757
				} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2758
					return 1; // after
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2759
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2760
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2761
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2762
			// In the fourth case, none of three other cases hold: the containers of A and B 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2763
			// are siblings or descendants of sibling nodes. In this case, A is before B if 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2764
			// the container of A is before the container of B in a pre-order traversal of the
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2765
			// Ranges' context tree and A is after B otherwise.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2766
			cmnRoot = this.dom.findCommonAncestor(containerA, containerB);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2767
			childA = containerA;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2768
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2769
			while (childA && childA.parentNode != cmnRoot) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2770
				childA = childA.parentNode;  
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2771
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2772
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2773
			if (!childA) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2774
				childA = cmnRoot;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2775
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2776
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2777
			childB = containerB;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2778
			while (childB && childB.parentNode != cmnRoot) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2779
				childB = childB.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2780
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2781
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2782
			if (!childB) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2783
				childB = cmnRoot;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2784
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2785
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2786
			if (childA == childB) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2787
				return 0; // equal
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2788
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2789
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2790
			n = cmnRoot.firstChild;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2791
			while (n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2792
				if (n == childA) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2793
					return -1; // before
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2794
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2795
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2796
				if (n == childB) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2797
					return 1; // after
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2798
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2799
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2800
				n = n.nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2801
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2802
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2803
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2804
		_setEndPoint : function(st, n, o) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2805
			var t = this, ec, sc;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2806
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2807
			if (st) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2808
				t.startContainer = n;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2809
				t.startOffset = o;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2810
			} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2811
				t.endContainer = n;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2812
				t.endOffset = o;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2813
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2814
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2815
			// If one boundary-point of a Range is set to have a root container 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2816
			// other than the current one for the Range, the Range is collapsed to 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2817
			// the new position. This enforces the restriction that both boundary-
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2818
			// points of a Range must have the same root container.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2819
			ec = t.endContainer;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2820
			while (ec.parentNode)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2821
				ec = ec.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2822
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2823
			sc = t.startContainer;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2824
			while (sc.parentNode)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2825
				sc = sc.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2826
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2827
			if (sc != ec) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2828
				t.collapse(st);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2829
			} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2830
				// The start position of a Range is guaranteed to never be after the 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2831
				// end position. To enforce this restriction, if the start is set to 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2832
				// be at a position after the end, the Range is collapsed to that 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2833
				// position.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2834
				if (t._compareBoundaryPoints(t.startContainer, t.startOffset, t.endContainer, t.endOffset) > 0)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2835
					t.collapse(st);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2836
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2837
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2838
			t.collapsed = t._isCollapsed();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2839
			t.commonAncestorContainer = t.dom.findCommonAncestor(t.startContainer, t.endContainer);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2840
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2841
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2842
		// This code is heavily "inspired" by the Apache Xerces implementation. I hope they don't mind. :)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2843
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2844
		_traverse : function(how) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2845
			var t = this, c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2846
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2847
			if (t.startContainer == t.endContainer)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2848
				return t._traverseSameContainer(how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2849
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2850
			for (c = t.endContainer, p = c.parentNode; p != null; c = p, p = p.parentNode) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2851
				if (p == t.startContainer)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2852
					return t._traverseCommonStartContainer(c, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2853
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2854
				++endContainerDepth;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2855
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2856
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2857
			for (c = t.startContainer, p = c.parentNode; p != null; c = p, p = p.parentNode) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2858
				if (p == t.endContainer)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2859
					return t._traverseCommonEndContainer(c, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2860
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2861
				++startContainerDepth;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2862
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2863
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2864
			depthDiff = startContainerDepth - endContainerDepth;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2865
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2866
			startNode = t.startContainer;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2867
			while (depthDiff > 0) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2868
				startNode = startNode.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2869
				depthDiff--;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2870
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2871
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2872
			endNode = t.endContainer;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2873
			while (depthDiff < 0) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2874
				endNode = endNode.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2875
				depthDiff++;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2876
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2877
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2878
			// ascend the ancestor hierarchy until we have a common parent.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2879
			for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2880
				startNode = sp;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2881
				endNode = ep;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2882
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2883
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2884
			return t._traverseCommonAncestors(startNode, endNode, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2885
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2886
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2887
		_traverseSameContainer : function(how) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2888
			var t = this, frag, s, sub, n, cnt, sibling, xferNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2889
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2890
			if (how != DELETE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2891
				frag = t.dom.doc.createDocumentFragment();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2892
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2893
			// If selection is empty, just return the fragment
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2894
			if (t.startOffset == t.endOffset)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2895
				return frag;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2896
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2897
			// Text node needs special case handling
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2898
			if (t.startContainer.nodeType == 3 /* TEXT_NODE */) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2899
				// get the substring
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2900
				s = t.startContainer.nodeValue;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2901
				sub = s.substring(t.startOffset, t.endOffset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2902
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2903
				// set the original text node to its new value
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2904
				if (how != CLONE) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2905
					t.startContainer.deleteData(t.startOffset, t.endOffset - t.startOffset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2906
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2907
					// Nothing is partially selected, so collapse to start point
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2908
					t.collapse(true);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2909
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2910
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2911
				if (how == DELETE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2912
					return null;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2913
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2914
				frag.appendChild(t.dom.doc.createTextNode(sub));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2915
				return frag;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2916
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2917
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2918
			// Copy nodes between the start/end offsets.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2919
			n = getSelectedNode(t.startContainer, t.startOffset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2920
			cnt = t.endOffset - t.startOffset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2921
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2922
			while (cnt > 0) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2923
				sibling = n.nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2924
				xferNode = t._traverseFullySelected(n, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2925
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2926
				if (frag)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2927
					frag.appendChild( xferNode );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2928
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2929
				--cnt;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2930
				n = sibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2931
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2932
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2933
			// Nothing is partially selected, so collapse to start point
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2934
			if (how != CLONE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2935
				t.collapse(true);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2936
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2937
			return frag;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2938
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2939
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2940
		_traverseCommonStartContainer : function(endAncestor, how) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2941
			var t = this, frag, n, endIdx, cnt, sibling, xferNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2942
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2943
			if (how != DELETE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2944
				frag = t.dom.doc.createDocumentFragment();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2945
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2946
			n = t._traverseRightBoundary(endAncestor, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2947
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2948
			if (frag)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2949
				frag.appendChild(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2950
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2951
			endIdx = indexOf(endAncestor, t.startContainer);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2952
			cnt = endIdx - t.startOffset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2953
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2954
			if (cnt <= 0) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2955
				// Collapse to just before the endAncestor, which 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2956
				// is partially selected.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2957
				if (how != CLONE) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2958
					t.setEndBefore(endAncestor);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2959
					t.collapse(false);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2960
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2961
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2962
				return frag;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2963
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2964
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2965
			n = endAncestor.previousSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2966
			while (cnt > 0) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2967
				sibling = n.previousSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2968
				xferNode = t._traverseFullySelected(n, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2969
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2970
				if (frag)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2971
					frag.insertBefore(xferNode, frag.firstChild);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2972
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2973
				--cnt;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2974
				n = sibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2975
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2976
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2977
			// Collapse to just before the endAncestor, which 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2978
			// is partially selected.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2979
			if (how != CLONE) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2980
				t.setEndBefore(endAncestor);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2981
				t.collapse(false);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2982
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2983
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2984
			return frag;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2985
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2986
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2987
		_traverseCommonEndContainer : function(startAncestor, how) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2988
			var t = this, frag, startIdx, n, cnt, sibling, xferNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2989
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2990
			if (how != DELETE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2991
				frag = t.dom.doc.createDocumentFragment();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2992
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2993
			n = t._traverseLeftBoundary(startAncestor, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2994
			if (frag)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2995
				frag.appendChild(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2996
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2997
			startIdx = indexOf(startAncestor, t.endContainer);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2998
			++startIdx;  // Because we already traversed it....
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  2999
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3000
			cnt = t.endOffset - startIdx;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3001
			n = startAncestor.nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3002
			while (cnt > 0) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3003
				sibling = n.nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3004
				xferNode = t._traverseFullySelected(n, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3005
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3006
				if (frag)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3007
					frag.appendChild(xferNode);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3008
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3009
				--cnt;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3010
				n = sibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3011
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3012
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3013
			if (how != CLONE) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3014
				t.setStartAfter(startAncestor);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3015
				t.collapse(true);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3016
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3017
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3018
			return frag;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3019
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3020
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3021
		_traverseCommonAncestors : function(startAncestor, endAncestor, how) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3022
			var t = this, n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3023
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3024
			if (how != DELETE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3025
				frag = t.dom.doc.createDocumentFragment();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3026
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3027
			n = t._traverseLeftBoundary(startAncestor, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3028
			if (frag)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3029
				frag.appendChild(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3030
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3031
			commonParent = startAncestor.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3032
			startOffset = indexOf(startAncestor, commonParent);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3033
			endOffset = indexOf(endAncestor, commonParent);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3034
			++startOffset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3035
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3036
			cnt = endOffset - startOffset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3037
			sibling = startAncestor.nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3038
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3039
			while (cnt > 0) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3040
				nextSibling = sibling.nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3041
				n = t._traverseFullySelected(sibling, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3042
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3043
				if (frag)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3044
					frag.appendChild(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3045
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3046
				sibling = nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3047
				--cnt;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3048
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3049
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3050
			n = t._traverseRightBoundary(endAncestor, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3051
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3052
			if (frag)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3053
				frag.appendChild(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3054
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3055
			if (how != CLONE) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3056
				t.setStartAfter(startAncestor);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3057
				t.collapse(true);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3058
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3059
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3060
			return frag;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3061
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3062
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3063
		_traverseRightBoundary : function(root, how) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3064
			var t = this, next = getSelectedNode(t.endContainer, t.endOffset - 1), parent, clonedParent, prevSibling, clonedChild, clonedGrandParent;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3065
			var isFullySelected = next != t.endContainer;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3066
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3067
			if (next == root)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3068
				return t._traverseNode(next, isFullySelected, false, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3069
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3070
			parent = next.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3071
			clonedParent = t._traverseNode(parent, false, false, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3072
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3073
			while (parent != null) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3074
				while (next != null) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3075
					prevSibling = next.previousSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3076
					clonedChild = t._traverseNode(next, isFullySelected, false, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3077
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3078
					if (how != DELETE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3079
						clonedParent.insertBefore(clonedChild, clonedParent.firstChild);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3080
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3081
					isFullySelected = true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3082
					next = prevSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3083
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3084
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3085
				if (parent == root)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3086
					return clonedParent;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3087
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3088
				next = parent.previousSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3089
				parent = parent.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3090
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3091
				clonedGrandParent = t._traverseNode(parent, false, false, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3092
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3093
				if (how != DELETE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3094
					clonedGrandParent.appendChild(clonedParent);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3095
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3096
				clonedParent = clonedGrandParent;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3097
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3098
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3099
			// should never occur
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3100
			return null;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3101
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3102
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3103
		_traverseLeftBoundary : function(root, how) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3104
			var t = this, next = getSelectedNode(t.startContainer, t.startOffset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3105
			var isFullySelected = next != t.startContainer, parent, clonedParent, nextSibling, clonedChild, clonedGrandParent;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3106
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3107
			if (next == root)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3108
				return t._traverseNode(next, isFullySelected, true, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3109
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3110
			parent = next.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3111
			clonedParent = t._traverseNode(parent, false, true, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3112
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3113
			while (parent != null) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3114
				while (next != null) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3115
					nextSibling = next.nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3116
					clonedChild = t._traverseNode(next, isFullySelected, true, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3117
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3118
					if (how != DELETE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3119
						clonedParent.appendChild(clonedChild);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3120
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3121
					isFullySelected = true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3122
					next = nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3123
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3124
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3125
				if (parent == root)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3126
					return clonedParent;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3127
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3128
				next = parent.nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3129
				parent = parent.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3130
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3131
				clonedGrandParent = t._traverseNode(parent, false, true, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3132
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3133
				if (how != DELETE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3134
					clonedGrandParent.appendChild(clonedParent);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3135
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3136
				clonedParent = clonedGrandParent;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3137
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3138
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3139
			// should never occur
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3140
			return null;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3141
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3142
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3143
		_traverseNode : function(n, isFullySelected, isLeft, how) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3144
			var t = this, txtValue, newNodeValue, oldNodeValue, offset, newNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3145
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3146
			if (isFullySelected)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3147
				return t._traverseFullySelected(n, how);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3148
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3149
			if (n.nodeType == 3 /* TEXT_NODE */) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3150
				txtValue = n.nodeValue;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3151
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3152
				if (isLeft) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3153
					offset = t.startOffset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3154
					newNodeValue = txtValue.substring(offset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3155
					oldNodeValue = txtValue.substring(0, offset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3156
				} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3157
					offset = t.endOffset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3158
					newNodeValue = txtValue.substring(0, offset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3159
					oldNodeValue = txtValue.substring(offset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3160
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3161
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3162
				if (how != CLONE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3163
					n.nodeValue = oldNodeValue;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3164
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3165
				if (how == DELETE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3166
					return null;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3167
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3168
				newNode = n.cloneNode(false);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3169
				newNode.nodeValue = newNodeValue;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3170
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3171
				return newNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3172
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3173
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3174
			if (how == DELETE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3175
				return null;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3176
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3177
			return n.cloneNode(false);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3178
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3179
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3180
		_traverseFullySelected : function(n, how) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3181
			var t = this;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3182
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3183
			if (how != DELETE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3184
				return how == CLONE ? n.cloneNode(true) : n;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3185
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3186
			n.parentNode.removeChild(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3187
			return null;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3188
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3189
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3190
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3191
	ns.Range = Range;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3192
})(tinymce.dom);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3193
(function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3194
	function Selection(selection) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3195
		var t = this, invisibleChar = '\uFEFF', range, lastIERng;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3196
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3197
		function compareRanges(rng1, rng2) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3198
			if (rng1 && rng2) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3199
				// Both are control ranges and the selected element matches
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3200
				if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3201
					return 1;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3202
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3203
				// Both are text ranges and the range matches
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3204
				if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3205
					return 1;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3206
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3207
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3208
			return 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3209
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3210
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3211
		function getRange() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3212
			var dom = selection.dom, ieRange = selection.getRng(), domRange = dom.createRng(), startPos, endPos, element, sc, ec, collapsed;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3213
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3214
			function findIndex(element) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3215
				var nl = element.parentNode.childNodes, i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3216
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3217
				for (i = nl.length - 1; i >= 0; i--) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3218
					if (nl[i] == element)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3219
						return i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3220
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3221
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3222
				return -1;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3223
			};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3224
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3225
			function findEndPoint(start) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3226
				var rng = ieRange.duplicate(), parent, i, nl, n, offset = 0, index = 0, pos, tmpRng;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3227
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3228
				// Insert marker character
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3229
				rng.collapse(start);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3230
				parent = rng.parentElement();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3231
				rng.pasteHTML(invisibleChar); // Needs to be a pasteHTML instead of .text = since IE has a bug with nodeValue
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3232
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3233
				// Find marker character
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3234
				nl = parent.childNodes;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3235
				for (i = 0; i < nl.length; i++) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3236
					n = nl[i];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3237
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3238
					// Calculate node index excluding text node fragmentation
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3239
					if (i > 0 && (n.nodeType !== 3 || nl[i - 1].nodeType !== 3))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3240
						index++;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3241
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3242
					// If text node then calculate offset
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3243
					if (n.nodeType === 3) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3244
						// Look for marker
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3245
						pos = n.nodeValue.indexOf(invisibleChar);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3246
						if (pos !== -1) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3247
							offset += pos;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3248
							break;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3249
						}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3250
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3251
						offset += n.nodeValue.length;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3252
					} else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3253
						offset = 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3254
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3255
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3256
				// Remove marker character
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3257
				rng.moveStart('character', -1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3258
				rng.text = '';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3259
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3260
				return {index : index, offset : offset, parent : parent};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3261
			};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3262
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3263
			// If selection is outside the current document just return an empty range
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3264
			element = ieRange.item ? ieRange.item(0) : ieRange.parentElement();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3265
			if (element.ownerDocument != dom.doc)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3266
				return domRange;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3267
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3268
			// Handle control selection or text selection of a image
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3269
			if (ieRange.item || !element.hasChildNodes()) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3270
				domRange.setStart(element.parentNode, findIndex(element));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3271
				domRange.setEnd(domRange.startContainer, domRange.startOffset + 1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3272
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3273
				return domRange;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3274
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3275
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3276
			// Check collapsed state
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3277
			collapsed = selection.isCollapsed();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3278
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3279
			// Find start and end pos index and offset
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3280
			startPos = findEndPoint(true);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3281
			endPos = findEndPoint(false);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3282
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3283
			// Normalize the elements to avoid fragmented dom
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3284
			startPos.parent.normalize();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3285
			endPos.parent.normalize();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3286
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3287
			// Set start container and offset
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3288
			sc = startPos.parent.childNodes[Math.min(startPos.index, startPos.parent.childNodes.length - 1)];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3289
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3290
			if (sc.nodeType != 3)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3291
				domRange.setStart(startPos.parent, startPos.index);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3292
			else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3293
				domRange.setStart(startPos.parent.childNodes[startPos.index], startPos.offset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3294
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3295
			// Set end container and offset
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3296
			ec = endPos.parent.childNodes[Math.min(endPos.index, endPos.parent.childNodes.length - 1)];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3297
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3298
			if (ec.nodeType != 3) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3299
				if (!collapsed)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3300
					endPos.index++;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3301
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3302
				domRange.setEnd(endPos.parent, endPos.index);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3303
			} else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3304
				domRange.setEnd(endPos.parent.childNodes[endPos.index], endPos.offset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3305
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3306
			// If not collapsed then make sure offsets are valid
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3307
			if (!collapsed) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3308
				sc = domRange.startContainer;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3309
				if (sc.nodeType == 1)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3310
					domRange.setStart(sc, Math.min(domRange.startOffset, sc.childNodes.length));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3311
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3312
				ec = domRange.endContainer;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3313
				if (ec.nodeType == 1)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3314
					domRange.setEnd(ec, Math.min(domRange.endOffset, ec.childNodes.length));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3315
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3316
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3317
			// Restore selection to new range
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3318
			t.addRange(domRange);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3319
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3320
			return domRange;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3321
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3322
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3323
		this.addRange = function(rng) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3324
			var ieRng, body = selection.dom.doc.body, startPos, endPos, sc, so, ec, eo;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3325
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3326
			// Setup some shorter versions
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3327
			sc = rng.startContainer;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3328
			so = rng.startOffset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3329
			ec = rng.endContainer;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3330
			eo = rng.endOffset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3331
			ieRng = body.createTextRange();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3332
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3333
			// Find element
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3334
			sc = sc.nodeType == 1 ? sc.childNodes[Math.min(so, sc.childNodes.length - 1)] : sc;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3335
			ec = ec.nodeType == 1 ? ec.childNodes[Math.min(so == eo ? eo : eo - 1, ec.childNodes.length - 1)] : ec;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3336
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3337
			// Single element selection
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3338
			if (sc == ec && sc.nodeType == 1) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3339
				// Make control selection for some elements
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3340
				if (/^(IMG|TABLE)$/.test(sc.nodeName) && so != eo) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3341
					ieRng = body.createControlRange();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3342
					ieRng.addElement(sc);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3343
				} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3344
					ieRng = body.createTextRange();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3345
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3346
					// Padd empty elements with invisible character
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3347
					if (!sc.hasChildNodes() && sc.canHaveHTML)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3348
						sc.innerHTML = invisibleChar;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3349
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3350
					// Select element contents
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3351
					ieRng.moveToElementText(sc);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3352
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3353
					// If it's only containing a padding remove it so the caret remains
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3354
					if (sc.innerHTML == invisibleChar) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3355
						ieRng.collapse(true);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3356
						sc.removeChild(sc.firstChild);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3357
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3358
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3359
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3360
				if (so == eo)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3361
					ieRng.collapse(eo <= rng.endContainer.childNodes.length - 1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3362
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3363
				ieRng.select();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3364
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3365
				return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3366
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3367
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3368
			function getCharPos(container, offset) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3369
				var nodeVal, rng, pos;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3370
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3371
				if (container.nodeType != 3)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3372
					return -1;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3373
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3374
				nodeVal = container.nodeValue;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3375
				rng = body.createTextRange();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3376
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3377
				// Insert marker at offset position
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3378
				container.nodeValue = nodeVal.substring(0, offset) + invisibleChar + nodeVal.substring(offset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3379
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3380
				// Find char pos of marker and remove it
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3381
				rng.moveToElementText(container.parentNode);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3382
				rng.findText(invisibleChar);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3383
				pos = Math.abs(rng.moveStart('character', -0xFFFFF));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3384
				container.nodeValue = nodeVal;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3385
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3386
				return pos;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3387
			};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3388
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3389
			// Collapsed range
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3390
			if (rng.collapsed) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3391
				pos = getCharPos(sc, so);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3392
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3393
				ieRng = body.createTextRange();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3394
				ieRng.move('character', pos);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3395
				ieRng.select();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3396
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3397
				return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3398
			} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3399
				// If same text container
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3400
				if (sc == ec && sc.nodeType == 3) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3401
					startPos = getCharPos(sc, so);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3402
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3403
					ieRng = body.createTextRange();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3404
					ieRng.move('character', startPos);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3405
					ieRng.moveEnd('character', eo - so);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3406
					ieRng.select();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3407
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3408
					return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3409
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3410
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3411
				// Get caret positions
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3412
				startPos = getCharPos(sc, so);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3413
				endPos = getCharPos(ec, eo);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3414
				ieRng = body.createTextRange();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3415
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3416
				// Move start of range to start character position or start element
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3417
				if (startPos == -1) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3418
					ieRng.moveToElementText(sc);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3419
					startPos = 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3420
				} else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3421
					ieRng.move('character', startPos);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3422
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3423
				// Move end of range to end character position or end element
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3424
				tmpRng = body.createTextRange();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3425
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3426
				if (endPos == -1)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3427
					tmpRng.moveToElementText(ec);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3428
				else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3429
					tmpRng.move('character', endPos);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3430
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3431
				ieRng.setEndPoint('EndToEnd', tmpRng);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3432
				ieRng.select();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3433
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3434
				return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3435
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3436
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3437
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3438
		this.getRangeAt = function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3439
			// Setup new range if the cache is empty
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3440
			if (!range || !compareRanges(lastIERng, selection.getRng())) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3441
				range = getRange();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3442
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3443
				// Store away text range for next call
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3444
				lastIERng = selection.getRng();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3445
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3446
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3447
			// Return cached range
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3448
			return range;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3449
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3450
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3451
		this.destroy = function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3452
			// Destroy cached range and last IE range to avoid memory leaks
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3453
			lastIERng = range = null;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3454
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3455
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3456
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3457
	// Expose the selection object
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3458
	tinymce.dom.TridentSelection = Selection;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  3459
})();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  3460
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3461
/*
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3462
 * Sizzle CSS Selector Engine - v1.0
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3463
 *  Copyright 2009, The Dojo Foundation
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3464
 *  Released under the MIT, BSD, and GPL Licenses.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3465
 *  More information: http://sizzlejs.com/
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3466
 */
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3467
(function(){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3468
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3469
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3470
	done = 0,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3471
	toString = Object.prototype.toString,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3472
	hasDuplicate = false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3473
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3474
var Sizzle = function(selector, context, results, seed) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3475
	results = results || [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3476
	var origContext = context = context || document;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3477
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3478
	if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3479
		return [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3480
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3481
	
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3482
	if ( !selector || typeof selector !== "string" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3483
		return results;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3484
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3485
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3486
	var parts = [], m, set, checkSet, check, mode, extra, prune = true, contextXML = isXML(context);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3487
	
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3488
	// Reset the position of the chunker regexp (start from head)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3489
	chunker.lastIndex = 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3490
	
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3491
	while ( (m = chunker.exec(selector)) !== null ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3492
		parts.push( m[1] );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3493
		
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3494
		if ( m[2] ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3495
			extra = RegExp.rightContext;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3496
			break;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3497
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3498
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3499
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3500
	if ( parts.length > 1 && origPOS.exec( selector ) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3501
		if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3502
			set = posProcess( parts[0] + parts[1], context );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3503
		} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3504
			set = Expr.relative[ parts[0] ] ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3505
				[ context ] :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3506
				Sizzle( parts.shift(), context );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3507
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3508
			while ( parts.length ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3509
				selector = parts.shift();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3510
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3511
				if ( Expr.relative[ selector ] )
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3512
					selector += parts.shift();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3513
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3514
				set = posProcess( selector, set );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3515
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3516
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3517
	} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3518
		// Take a shortcut and set the context if the root selector is an ID
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3519
		// (but not if it'll be faster if the inner selector is an ID)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3520
		if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3521
				Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3522
			var ret = Sizzle.find( parts.shift(), context, contextXML );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3523
			context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3524
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3525
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3526
		if ( context ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3527
			var ret = seed ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3528
				{ expr: parts.pop(), set: makeArray(seed) } :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3529
				Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3530
			set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3531
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3532
			if ( parts.length > 0 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3533
				checkSet = makeArray(set);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3534
			} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3535
				prune = false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3536
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3537
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3538
			while ( parts.length ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3539
				var cur = parts.pop(), pop = cur;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3540
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3541
				if ( !Expr.relative[ cur ] ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3542
					cur = "";
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3543
				} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3544
					pop = parts.pop();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3545
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3546
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3547
				if ( pop == null ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3548
					pop = context;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3549
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3550
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3551
				Expr.relative[ cur ]( checkSet, pop, contextXML );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3552
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3553
		} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3554
			checkSet = parts = [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3555
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3556
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3557
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3558
	if ( !checkSet ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3559
		checkSet = set;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3560
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3561
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3562
	if ( !checkSet ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3563
		throw "Syntax error, unrecognized expression: " + (cur || selector);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3564
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3565
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3566
	if ( toString.call(checkSet) === "[object Array]" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3567
		if ( !prune ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3568
			results.push.apply( results, checkSet );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3569
		} else if ( context && context.nodeType === 1 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3570
			for ( var i = 0; checkSet[i] != null; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3571
				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3572
					results.push( set[i] );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3573
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3574
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3575
		} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3576
			for ( var i = 0; checkSet[i] != null; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3577
				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3578
					results.push( set[i] );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3579
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3580
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3581
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3582
	} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3583
		makeArray( checkSet, results );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3584
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3585
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3586
	if ( extra ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3587
		Sizzle( extra, origContext, results, seed );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3588
		Sizzle.uniqueSort( results );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3589
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3590
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3591
	return results;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3592
};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3593
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3594
Sizzle.uniqueSort = function(results){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3595
	if ( sortOrder ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3596
		hasDuplicate = false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3597
		results.sort(sortOrder);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3598
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3599
		if ( hasDuplicate ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3600
			for ( var i = 1; i < results.length; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3601
				if ( results[i] === results[i-1] ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3602
					results.splice(i--, 1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3603
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3604
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3605
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3606
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3607
};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3608
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3609
Sizzle.matches = function(expr, set){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3610
	return Sizzle(expr, null, null, set);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3611
};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3612
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3613
Sizzle.find = function(expr, context, isXML){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3614
	var set, match;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3615
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3616
	if ( !expr ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3617
		return [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3618
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3619
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3620
	for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3621
		var type = Expr.order[i], match;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3622
		
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3623
		if ( (match = Expr.match[ type ].exec( expr )) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3624
			var left = RegExp.leftContext;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3625
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3626
			if ( left.substr( left.length - 1 ) !== "\\" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3627
				match[1] = (match[1] || "").replace(/\\/g, "");
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3628
				set = Expr.find[ type ]( match, context, isXML );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3629
				if ( set != null ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3630
					expr = expr.replace( Expr.match[ type ], "" );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3631
					break;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3632
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3633
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3634
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3635
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3636
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3637
	if ( !set ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3638
		set = context.getElementsByTagName("*");
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3639
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3640
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3641
	return {set: set, expr: expr};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3642
};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3643
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3644
Sizzle.filter = function(expr, set, inplace, not){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3645
	var old = expr, result = [], curLoop = set, match, anyFound,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3646
		isXMLFilter = set && set[0] && isXML(set[0]);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3647
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3648
	while ( expr && set.length ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3649
		for ( var type in Expr.filter ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3650
			if ( (match = Expr.match[ type ].exec( expr )) != null ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3651
				var filter = Expr.filter[ type ], found, item;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3652
				anyFound = false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3653
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3654
				if ( curLoop == result ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3655
					result = [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3656
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3657
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3658
				if ( Expr.preFilter[ type ] ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3659
					match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3660
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3661
					if ( !match ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3662
						anyFound = found = true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3663
					} else if ( match === true ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3664
						continue;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3665
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3666
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3667
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3668
				if ( match ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3669
					for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3670
						if ( item ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3671
							found = filter( item, match, i, curLoop );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3672
							var pass = not ^ !!found;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3673
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3674
							if ( inplace && found != null ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3675
								if ( pass ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3676
									anyFound = true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3677
								} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3678
									curLoop[i] = false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3679
								}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3680
							} else if ( pass ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3681
								result.push( item );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3682
								anyFound = true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3683
							}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3684
						}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3685
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3686
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3687
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3688
				if ( found !== undefined ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3689
					if ( !inplace ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3690
						curLoop = result;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3691
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3692
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3693
					expr = expr.replace( Expr.match[ type ], "" );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3694
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3695
					if ( !anyFound ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3696
						return [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3697
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3698
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3699
					break;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3700
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3701
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3702
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3703
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3704
		// Improper expression
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3705
		if ( expr == old ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3706
			if ( anyFound == null ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3707
				throw "Syntax error, unrecognized expression: " + expr;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3708
			} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3709
				break;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3710
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3711
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3712
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3713
		old = expr;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3714
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3715
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3716
	return curLoop;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3717
};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3718
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3719
var Expr = Sizzle.selectors = {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3720
	order: [ "ID", "NAME", "TAG" ],
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3721
	match: {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3722
		ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3723
		CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3724
		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3725
		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3726
		TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3727
		CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3728
		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3729
		PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3730
	},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3731
	attrMap: {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3732
		"class": "className",
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3733
		"for": "htmlFor"
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3734
	},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3735
	attrHandle: {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3736
		href: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3737
			return elem.getAttribute("href");
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3738
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3739
	},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3740
	relative: {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3741
		"+": function(checkSet, part, isXML){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3742
			var isPartStr = typeof part === "string",
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3743
				isTag = isPartStr && !/\W/.test(part),
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3744
				isPartStrNotTag = isPartStr && !isTag;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3745
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3746
			if ( isTag && !isXML ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3747
				part = part.toUpperCase();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3748
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3749
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3750
			for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3751
				if ( (elem = checkSet[i]) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3752
					while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3753
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3754
					checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3755
						elem || false :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3756
						elem === part;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3757
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3758
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3759
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3760
			if ( isPartStrNotTag ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3761
				Sizzle.filter( part, checkSet, true );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3762
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3763
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3764
		">": function(checkSet, part, isXML){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3765
			var isPartStr = typeof part === "string";
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3766
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3767
			if ( isPartStr && !/\W/.test(part) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3768
				part = isXML ? part : part.toUpperCase();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3769
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3770
				for ( var i = 0, l = checkSet.length; i < l; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3771
					var elem = checkSet[i];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3772
					if ( elem ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3773
						var parent = elem.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3774
						checkSet[i] = parent.nodeName === part ? parent : false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3775
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3776
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3777
			} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3778
				for ( var i = 0, l = checkSet.length; i < l; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3779
					var elem = checkSet[i];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3780
					if ( elem ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3781
						checkSet[i] = isPartStr ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3782
							elem.parentNode :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3783
							elem.parentNode === part;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3784
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3785
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3786
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3787
				if ( isPartStr ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3788
					Sizzle.filter( part, checkSet, true );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3789
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3790
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3791
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3792
		"": function(checkSet, part, isXML){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3793
			var doneName = done++, checkFn = dirCheck;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3794
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3795
			if ( !part.match(/\W/) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3796
				var nodeCheck = part = isXML ? part : part.toUpperCase();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3797
				checkFn = dirNodeCheck;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3798
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3799
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3800
			checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3801
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3802
		"~": function(checkSet, part, isXML){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3803
			var doneName = done++, checkFn = dirCheck;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3804
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3805
			if ( typeof part === "string" && !part.match(/\W/) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3806
				var nodeCheck = part = isXML ? part : part.toUpperCase();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3807
				checkFn = dirNodeCheck;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3808
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3809
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3810
			checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3811
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3812
	},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3813
	find: {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3814
		ID: function(match, context, isXML){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3815
			if ( typeof context.getElementById !== "undefined" && !isXML ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3816
				var m = context.getElementById(match[1]);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3817
				return m ? [m] : [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3818
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3819
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3820
		NAME: function(match, context, isXML){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3821
			if ( typeof context.getElementsByName !== "undefined" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3822
				var ret = [], results = context.getElementsByName(match[1]);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3823
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3824
				for ( var i = 0, l = results.length; i < l; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3825
					if ( results[i].getAttribute("name") === match[1] ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3826
						ret.push( results[i] );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3827
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3828
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3829
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3830
				return ret.length === 0 ? null : ret;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3831
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3832
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3833
		TAG: function(match, context){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3834
			return context.getElementsByTagName(match[1]);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3835
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3836
	},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3837
	preFilter: {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3838
		CLASS: function(match, curLoop, inplace, result, not, isXML){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3839
			match = " " + match[1].replace(/\\/g, "") + " ";
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3840
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3841
			if ( isXML ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3842
				return match;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3843
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3844
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3845
			for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3846
				if ( elem ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3847
					if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3848
						if ( !inplace )
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3849
							result.push( elem );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3850
					} else if ( inplace ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3851
						curLoop[i] = false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3852
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3853
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3854
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3855
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3856
			return false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3857
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3858
		ID: function(match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3859
			return match[1].replace(/\\/g, "");
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3860
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3861
		TAG: function(match, curLoop){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3862
			for ( var i = 0; curLoop[i] === false; i++ ){}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3863
			return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3864
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3865
		CHILD: function(match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3866
			if ( match[1] == "nth" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3867
				// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3868
				var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3869
					match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3870
					!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3871
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3872
				// calculate the numbers (first)n+(last) including if they are negative
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3873
				match[2] = (test[1] + (test[2] || 1)) - 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3874
				match[3] = test[3] - 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3875
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3876
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3877
			// TODO: Move to normal caching system
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3878
			match[0] = done++;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3879
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3880
			return match;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3881
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3882
		ATTR: function(match, curLoop, inplace, result, not, isXML){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3883
			var name = match[1].replace(/\\/g, "");
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3884
			
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3885
			if ( !isXML && Expr.attrMap[name] ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3886
				match[1] = Expr.attrMap[name];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3887
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3888
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3889
			if ( match[2] === "~=" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3890
				match[4] = " " + match[4] + " ";
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3891
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3892
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3893
			return match;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3894
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3895
		PSEUDO: function(match, curLoop, inplace, result, not){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3896
			if ( match[1] === "not" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3897
				// If we're dealing with a complex expression, or a simple one
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3898
				if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3899
					match[3] = Sizzle(match[3], null, null, curLoop);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3900
				} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3901
					var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3902
					if ( !inplace ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3903
						result.push.apply( result, ret );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3904
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3905
					return false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3906
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3907
			} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3908
				return true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3909
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3910
			
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3911
			return match;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3912
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3913
		POS: function(match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3914
			match.unshift( true );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3915
			return match;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3916
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3917
	},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3918
	filters: {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3919
		enabled: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3920
			return elem.disabled === false && elem.type !== "hidden";
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3921
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3922
		disabled: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3923
			return elem.disabled === true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3924
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3925
		checked: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3926
			return elem.checked === true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3927
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3928
		selected: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3929
			// Accessing this property makes selected-by-default
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3930
			// options in Safari work properly
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3931
			elem.parentNode.selectedIndex;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3932
			return elem.selected === true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3933
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3934
		parent: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3935
			return !!elem.firstChild;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3936
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3937
		empty: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3938
			return !elem.firstChild;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3939
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3940
		has: function(elem, i, match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3941
			return !!Sizzle( match[3], elem ).length;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3942
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3943
		header: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3944
			return /h\d/i.test( elem.nodeName );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3945
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3946
		text: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3947
			return "text" === elem.type;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3948
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3949
		radio: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3950
			return "radio" === elem.type;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3951
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3952
		checkbox: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3953
			return "checkbox" === elem.type;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3954
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3955
		file: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3956
			return "file" === elem.type;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3957
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3958
		password: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3959
			return "password" === elem.type;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3960
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3961
		submit: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3962
			return "submit" === elem.type;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3963
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3964
		image: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3965
			return "image" === elem.type;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3966
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3967
		reset: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3968
			return "reset" === elem.type;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3969
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3970
		button: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3971
			return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3972
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3973
		input: function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3974
			return /input|select|textarea|button/i.test(elem.nodeName);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3975
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3976
	},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3977
	setFilters: {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3978
		first: function(elem, i){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3979
			return i === 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3980
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3981
		last: function(elem, i, match, array){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3982
			return i === array.length - 1;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3983
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3984
		even: function(elem, i){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3985
			return i % 2 === 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3986
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3987
		odd: function(elem, i){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3988
			return i % 2 === 1;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3989
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3990
		lt: function(elem, i, match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3991
			return i < match[3] - 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3992
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3993
		gt: function(elem, i, match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3994
			return i > match[3] - 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3995
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3996
		nth: function(elem, i, match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3997
			return match[3] - 0 == i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3998
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  3999
		eq: function(elem, i, match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4000
			return match[3] - 0 == i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4001
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4002
	},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4003
	filter: {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4004
		PSEUDO: function(elem, match, i, array){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4005
			var name = match[1], filter = Expr.filters[ name ];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4006
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4007
			if ( filter ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4008
				return filter( elem, i, match, array );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4009
			} else if ( name === "contains" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4010
				return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4011
			} else if ( name === "not" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4012
				var not = match[3];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4013
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4014
				for ( var i = 0, l = not.length; i < l; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4015
					if ( not[i] === elem ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4016
						return false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4017
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4018
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4019
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4020
				return true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4021
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4022
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4023
		CHILD: function(elem, match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4024
			var type = match[1], node = elem;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4025
			switch (type) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4026
				case 'only':
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4027
				case 'first':
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4028
					while (node = node.previousSibling)  {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4029
						if ( node.nodeType === 1 ) return false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4030
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4031
					if ( type == 'first') return true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4032
					node = elem;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4033
				case 'last':
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4034
					while (node = node.nextSibling)  {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4035
						if ( node.nodeType === 1 ) return false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4036
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4037
					return true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4038
				case 'nth':
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4039
					var first = match[2], last = match[3];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4040
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4041
					if ( first == 1 && last == 0 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4042
						return true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4043
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4044
					
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4045
					var doneName = match[0],
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4046
						parent = elem.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4047
	
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4048
					if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4049
						var count = 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4050
						for ( node = parent.firstChild; node; node = node.nextSibling ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4051
							if ( node.nodeType === 1 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4052
								node.nodeIndex = ++count;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4053
							}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4054
						} 
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4055
						parent.sizcache = doneName;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4056
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4057
					
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4058
					var diff = elem.nodeIndex - last;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4059
					if ( first == 0 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4060
						return diff == 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4061
					} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4062
						return ( diff % first == 0 && diff / first >= 0 );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4063
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4064
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4065
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4066
		ID: function(elem, match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4067
			return elem.nodeType === 1 && elem.getAttribute("id") === match;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4068
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4069
		TAG: function(elem, match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4070
			return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4071
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4072
		CLASS: function(elem, match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4073
			return (" " + (elem.className || elem.getAttribute("class")) + " ")
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4074
				.indexOf( match ) > -1;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4075
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4076
		ATTR: function(elem, match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4077
			var name = match[1],
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4078
				result = Expr.attrHandle[ name ] ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4079
					Expr.attrHandle[ name ]( elem ) :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4080
					elem[ name ] != null ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4081
						elem[ name ] :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4082
						elem.getAttribute( name ),
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4083
				value = result + "",
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4084
				type = match[2],
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4085
				check = match[4];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4086
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4087
			return result == null ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4088
				type === "!=" :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4089
				type === "=" ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4090
				value === check :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4091
				type === "*=" ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4092
				value.indexOf(check) >= 0 :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4093
				type === "~=" ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4094
				(" " + value + " ").indexOf(check) >= 0 :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4095
				!check ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4096
				value && result !== false :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4097
				type === "!=" ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4098
				value != check :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4099
				type === "^=" ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4100
				value.indexOf(check) === 0 :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4101
				type === "$=" ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4102
				value.substr(value.length - check.length) === check :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4103
				type === "|=" ?
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4104
				value === check || value.substr(0, check.length + 1) === check + "-" :
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4105
				false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4106
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4107
		POS: function(elem, match, i, array){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4108
			var name = match[2], filter = Expr.setFilters[ name ];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4109
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4110
			if ( filter ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4111
				return filter( elem, i, match, array );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4112
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4113
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4114
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4115
};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4116
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4117
var origPOS = Expr.match.POS;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4118
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4119
for ( var type in Expr.match ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4120
	Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4121
}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4122
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4123
var makeArray = function(array, results) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4124
	array = Array.prototype.slice.call( array );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4125
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4126
	if ( results ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4127
		results.push.apply( results, array );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4128
		return results;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4129
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4130
	
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4131
	return array;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4132
};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4133
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4134
// Perform a simple check to determine if the browser is capable of
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4135
// converting a NodeList to an array using builtin methods.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4136
try {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4137
	Array.prototype.slice.call( document.documentElement.childNodes );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4138
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4139
// Provide a fallback method if it does not work
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4140
} catch(e){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4141
	makeArray = function(array, results) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4142
		var ret = results || [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4143
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4144
		if ( toString.call(array) === "[object Array]" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4145
			Array.prototype.push.apply( ret, array );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4146
		} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4147
			if ( typeof array.length === "number" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4148
				for ( var i = 0, l = array.length; i < l; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4149
					ret.push( array[i] );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4150
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4151
			} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4152
				for ( var i = 0; array[i]; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4153
					ret.push( array[i] );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4154
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4155
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4156
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4157
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4158
		return ret;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4159
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4160
}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4161
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4162
var sortOrder;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4163
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4164
if ( document.documentElement.compareDocumentPosition ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4165
	sortOrder = function( a, b ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4166
		var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4167
		if ( ret === 0 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4168
			hasDuplicate = true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4169
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4170
		return ret;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4171
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4172
} else if ( "sourceIndex" in document.documentElement ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4173
	sortOrder = function( a, b ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4174
		var ret = a.sourceIndex - b.sourceIndex;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4175
		if ( ret === 0 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4176
			hasDuplicate = true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4177
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4178
		return ret;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4179
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4180
} else if ( document.createRange ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4181
	sortOrder = function( a, b ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4182
		var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4183
		aRange.setStart(a, 0);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4184
		aRange.setEnd(a, 0);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4185
		bRange.setStart(b, 0);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4186
		bRange.setEnd(b, 0);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4187
		var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4188
		if ( ret === 0 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4189
			hasDuplicate = true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4190
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4191
		return ret;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4192
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4193
}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4194
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4195
// Check to see if the browser returns elements by name when
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4196
// querying by getElementById (and provide a workaround)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4197
(function(){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4198
	// We're going to inject a fake input element with a specified name
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4199
	var form = document.createElement("div"),
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4200
		id = "script" + (new Date).getTime();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4201
	form.innerHTML = "<a name='" + id + "'/>";
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4202
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4203
	// Inject it into the root element, check its status, and remove it quickly
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4204
	var root = document.documentElement;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4205
	root.insertBefore( form, root.firstChild );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4206
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4207
	// The workaround has to do additional checks after a getElementById
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4208
	// Which slows things down for other browsers (hence the branching)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4209
	if ( !!document.getElementById( id ) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4210
		Expr.find.ID = function(match, context, isXML){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4211
			if ( typeof context.getElementById !== "undefined" && !isXML ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4212
				var m = context.getElementById(match[1]);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4213
				return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4214
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4215
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4216
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4217
		Expr.filter.ID = function(elem, match){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4218
			var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4219
			return elem.nodeType === 1 && node && node.nodeValue === match;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4220
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4221
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4222
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4223
	root.removeChild( form );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4224
})();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4225
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4226
(function(){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4227
	// Check to see if the browser returns only elements
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4228
	// when doing getElementsByTagName("*")
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4229
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4230
	// Create a fake element
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4231
	var div = document.createElement("div");
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4232
	div.appendChild( document.createComment("") );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4233
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4234
	// Make sure no comments are found
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4235
	if ( div.getElementsByTagName("*").length > 0 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4236
		Expr.find.TAG = function(match, context){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4237
			var results = context.getElementsByTagName(match[1]);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4238
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4239
			// Filter out possible comments
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4240
			if ( match[1] === "*" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4241
				var tmp = [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4242
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4243
				for ( var i = 0; results[i]; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4244
					if ( results[i].nodeType === 1 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4245
						tmp.push( results[i] );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4246
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4247
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4248
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4249
				results = tmp;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4250
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4251
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4252
			return results;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4253
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4254
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4255
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4256
	// Check to see if an attribute returns normalized href attributes
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4257
	div.innerHTML = "<a href='#'></a>";
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4258
	if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4259
			div.firstChild.getAttribute("href") !== "#" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4260
		Expr.attrHandle.href = function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4261
			return elem.getAttribute("href", 2);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4262
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4263
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4264
})();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4265
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4266
if ( document.querySelectorAll ) (function(){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4267
	var oldSizzle = Sizzle, div = document.createElement("div");
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4268
	div.innerHTML = "<p class='TEST'></p>";
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4269
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4270
	// Safari can't handle uppercase or unicode characters when
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4271
	// in quirks mode.
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4272
	if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4273
		return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4274
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4275
	
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4276
	Sizzle = function(query, context, extra, seed){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4277
		context = context || document;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4278
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4279
		// Only use querySelectorAll on non-XML documents
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4280
		// (ID selectors don't work in non-HTML documents)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4281
		if ( !seed && context.nodeType === 9 && !isXML(context) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4282
			try {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4283
				return makeArray( context.querySelectorAll(query), extra );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4284
			} catch(e){}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4285
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4286
		
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4287
		return oldSizzle(query, context, extra, seed);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4288
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4289
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4290
	for ( var prop in oldSizzle ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4291
		Sizzle[ prop ] = oldSizzle[ prop ];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4292
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4293
})();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4294
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4295
if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4296
	var div = document.createElement("div");
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4297
	div.innerHTML = "<div class='test e'></div><div class='test'></div>";
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4298
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4299
	// Opera can't find a second classname (in 9.6)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4300
	if ( div.getElementsByClassName("e").length === 0 )
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4301
		return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4302
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4303
	// Safari caches class attributes, doesn't catch changes (in 3.2)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4304
	div.lastChild.className = "e";
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4305
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4306
	if ( div.getElementsByClassName("e").length === 1 )
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4307
		return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4308
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4309
	Expr.order.splice(1, 0, "CLASS");
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4310
	Expr.find.CLASS = function(match, context, isXML) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4311
		if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4312
			return context.getElementsByClassName(match[1]);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4313
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4314
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4315
})();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4316
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4317
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4318
	var sibDir = dir == "previousSibling" && !isXML;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4319
	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4320
		var elem = checkSet[i];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4321
		if ( elem ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4322
			if ( sibDir && elem.nodeType === 1 ){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4323
				elem.sizcache = doneName;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4324
				elem.sizset = i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4325
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4326
			elem = elem[dir];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4327
			var match = false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4328
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4329
			while ( elem ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4330
				if ( elem.sizcache === doneName ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4331
					match = checkSet[elem.sizset];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4332
					break;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4333
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4334
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4335
				if ( elem.nodeType === 1 && !isXML ){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4336
					elem.sizcache = doneName;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4337
					elem.sizset = i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4338
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4339
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4340
				if ( elem.nodeName === cur ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4341
					match = elem;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4342
					break;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4343
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4344
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4345
				elem = elem[dir];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4346
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4347
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4348
			checkSet[i] = match;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4349
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4350
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4351
}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4352
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4353
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4354
	var sibDir = dir == "previousSibling" && !isXML;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4355
	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4356
		var elem = checkSet[i];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4357
		if ( elem ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4358
			if ( sibDir && elem.nodeType === 1 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4359
				elem.sizcache = doneName;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4360
				elem.sizset = i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4361
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4362
			elem = elem[dir];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4363
			var match = false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4364
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4365
			while ( elem ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4366
				if ( elem.sizcache === doneName ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4367
					match = checkSet[elem.sizset];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4368
					break;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4369
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4370
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4371
				if ( elem.nodeType === 1 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4372
					if ( !isXML ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4373
						elem.sizcache = doneName;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4374
						elem.sizset = i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4375
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4376
					if ( typeof cur !== "string" ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4377
						if ( elem === cur ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4378
							match = true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4379
							break;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4380
						}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4381
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4382
					} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4383
						match = elem;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4384
						break;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4385
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4386
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4387
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4388
				elem = elem[dir];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4389
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4390
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4391
			checkSet[i] = match;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4392
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4393
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4394
}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4395
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4396
var contains = document.compareDocumentPosition ?  function(a, b){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4397
	return a.compareDocumentPosition(b) & 16;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4398
} : function(a, b){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4399
	return a !== b && (a.contains ? a.contains(b) : true);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4400
};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4401
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4402
var isXML = function(elem){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4403
	return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4404
		!!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4405
};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4406
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4407
var posProcess = function(selector, context){
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4408
	var tmpSet = [], later = "", match,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4409
		root = context.nodeType ? [context] : context;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4410
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4411
	// Position selectors must be done after the filter
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4412
	// And so must :not(positional) so we move all PSEUDOs to the end
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4413
	while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4414
		later += match[0];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4415
		selector = selector.replace( Expr.match.PSEUDO, "" );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4416
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4417
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4418
	selector = Expr.relative[selector] ? selector + "*" : selector;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4419
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4420
	for ( var i = 0, l = root.length; i < l; i++ ) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4421
		Sizzle( selector, root[i], tmpSet );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4422
	}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4423
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4424
	return Sizzle.filter( later, tmpSet );
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4425
};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4426
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4427
// EXPOSE
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4428
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4429
window.tinymce.dom.Sizzle = Sizzle;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4430
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4431
})();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4432
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4433
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4434
	// Shorten names
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4435
	var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4436
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4437
	tinymce.create('tinymce.dom.EventUtils', {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4438
		EventUtils : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4439
			this.inits = [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4440
			this.events = [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4441
		},
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4442
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4443
		add : function(o, n, f, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4444
			var cb, t = this, el = t.events, r;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4445
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4446
			if (n instanceof Array) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4447
				r = [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4448
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4449
				each(n, function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4450
					r.push(t.add(o, n, f, s));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4451
				});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4452
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4453
				return r;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4454
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4455
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4456
			// Handle array
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4457
			if (o && o.hasOwnProperty && o instanceof Array) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4458
				r = [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4459
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4460
				each(o, function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4461
					o = DOM.get(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4462
					r.push(t.add(o, n, f, s));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4463
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4464
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4465
				return r;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4466
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4467
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4468
			o = DOM.get(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4469
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4470
			if (!o)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4471
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4472
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4473
			// Setup event callback
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4474
			cb = function(e) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4475
				// Is all events disabled
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4476
				if (t.disabled)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4477
					return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4478
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4479
				e = e || window.event;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4480
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4481
				// Patch in target, preventDefault and stopPropagation in IE it's W3C valid
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4482
				if (e && isIE) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4483
					if (!e.target)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4484
						e.target = e.srcElement;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4485
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4486
					// Patch in preventDefault, stopPropagation methods for W3C compatibility
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4487
					tinymce.extend(e, t._stoppers);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4488
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4489
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4490
				if (!s)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4491
					return f(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4492
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4493
				return f.call(s, e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4494
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4495
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4496
			if (n == 'unload') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4497
				tinymce.unloads.unshift({func : cb});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4498
				return cb;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4499
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4500
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4501
			if (n == 'init') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4502
				if (t.domLoaded)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4503
					cb();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4504
				else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4505
					t.inits.push(cb);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4506
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4507
				return cb;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4508
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4509
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4510
			// Store away listener reference
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4511
			el.push({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4512
				obj : o,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4513
				name : n,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4514
				func : f,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4515
				cfunc : cb,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4516
				scope : s
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4517
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4518
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4519
			t._add(o, n, cb);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4520
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4521
			return f;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4522
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4523
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4524
		remove : function(o, n, f) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4525
			var t = this, a = t.events, s = false, r;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4526
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4527
			// Handle array
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4528
			if (o && o.hasOwnProperty && o instanceof Array) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4529
				r = [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4530
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4531
				each(o, function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4532
					o = DOM.get(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4533
					r.push(t.remove(o, n, f));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4534
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4535
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4536
				return r;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4537
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4538
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4539
			o = DOM.get(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4540
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4541
			each(a, function(e, i) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4542
				if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4543
					a.splice(i, 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4544
					t._remove(o, n, e.cfunc);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4545
					s = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4546
					return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4547
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4548
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4549
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4550
			return s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4551
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4552
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4553
		clear : function(o) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4554
			var t = this, a = t.events, i, e;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4555
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4556
			if (o) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4557
				o = DOM.get(o);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4558
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4559
				for (i = a.length - 1; i >= 0; i--) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4560
					e = a[i];
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4561
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4562
					if (e.obj === o) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4563
						t._remove(e.obj, e.name, e.cfunc);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4564
						e.obj = e.cfunc = null;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4565
						a.splice(i, 1);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4566
					}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4567
				}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4568
			}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4569
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4570
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4571
		cancel : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4572
			if (!e)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4573
				return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4574
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4575
			this.stop(e);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4576
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4577
			return this.prevent(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4578
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4579
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4580
		stop : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4581
			if (e.stopPropagation)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4582
				e.stopPropagation();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4583
			else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4584
				e.cancelBubble = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4585
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4586
			return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4587
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4588
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4589
		prevent : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4590
			if (e.preventDefault)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4591
				e.preventDefault();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4592
			else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4593
				e.returnValue = false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4594
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4595
			return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4596
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4597
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4598
		destroy : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4599
			var t = this;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4600
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4601
			each(t.events, function(e, i) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4602
				t._remove(e.obj, e.name, e.cfunc);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4603
				e.obj = e.cfunc = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4604
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4605
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4606
			t.events = [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4607
			t = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4608
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4609
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4610
		_add : function(o, n, f) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4611
			if (o.attachEvent)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4612
				o.attachEvent('on' + n, f);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4613
			else if (o.addEventListener)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4614
				o.addEventListener(n, f, false);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4615
			else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4616
				o['on' + n] = f;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4617
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4618
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4619
		_remove : function(o, n, f) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4620
			if (o) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4621
				try {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4622
					if (o.detachEvent)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4623
						o.detachEvent('on' + n, f);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4624
					else if (o.removeEventListener)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4625
						o.removeEventListener(n, f, false);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4626
					else
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4627
						o['on' + n] = null;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4628
				} catch (ex) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4629
					// Might fail with permission denined on IE so we just ignore that
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4630
				}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4631
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4632
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4633
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4634
		_pageInit : function(win) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4635
			var t = this;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4636
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4637
			// Keep it from running more than once
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4638
			if (t.domLoaded)
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4639
				return;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4640
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4641
			t.domLoaded = true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4642
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4643
			each(t.inits, function(c) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4644
				c();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4645
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4646
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4647
			t.inits = [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4648
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4649
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4650
		_wait : function(win) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4651
			var t = this, doc = win.document;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4652
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4653
			// No need since the document is already loaded
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4654
			if (win.tinyMCE_GZ && tinyMCE_GZ.loaded) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4655
				t.domLoaded = 1;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4656
				return;
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  4657
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4658
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4659
			// Use IE method
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4660
			if (doc.attachEvent) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4661
				doc.attachEvent("onreadystatechange", function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4662
					if (doc.readyState === "complete") {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4663
						doc.detachEvent("onreadystatechange", arguments.callee);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4664
						t._pageInit(win);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4665
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4666
				});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4667
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4668
				if (doc.documentElement.doScroll && win == win.top) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4669
					(function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4670
						if (t.domLoaded)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4671
							return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4672
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4673
						try {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4674
							// If IE is used, use the trick by Diego Perini
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4675
							// http://javascript.nwbox.com/IEContentLoaded/
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4676
							doc.documentElement.doScroll("left");
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4677
						} catch (ex) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4678
							setTimeout(arguments.callee, 0);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4679
							return;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4680
						}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4681
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4682
						t._pageInit(win);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4683
					})();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4684
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4685
			} else if (doc.addEventListener) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4686
				t._add(win, 'DOMContentLoaded', function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4687
					t._pageInit(win);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4688
				});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4689
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4690
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4691
			t._add(win, 'load', function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4692
				t._pageInit(win);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4693
			});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4694
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4695
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4696
		_stoppers : {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4697
			preventDefault :  function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4698
				this.returnValue = false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4699
			},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4700
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4701
			stopPropagation : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4702
				this.cancelBubble = true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4703
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4704
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4705
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4706
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4707
	Event = tinymce.dom.Event = new tinymce.dom.EventUtils();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4708
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4709
	// Dispatch DOM content loaded event for IE and Safari
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4710
	Event._wait(window);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4711
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4712
	tinymce.addUnload(function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4713
		Event.destroy();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4714
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4715
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4716
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4717
	var each = tinymce.each;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4718
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4719
	tinymce.create('tinymce.dom.Element', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4720
		Element : function(id, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4721
			var t = this, dom, el;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4722
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4723
			s = s || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4724
			t.id = id;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4725
			t.dom = dom = s.dom || tinymce.DOM;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4726
			t.settings = s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4727
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4728
			// Only IE leaks DOM references, this is a lot faster
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4729
			if (!tinymce.isIE)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4730
				el = t.dom.get(t.id);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4731
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4732
			each([
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4733
				'getPos',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4734
				'getRect',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4735
				'getParent',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4736
				'add',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4737
				'setStyle',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4738
				'getStyle',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4739
				'setStyles',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4740
				'setAttrib',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4741
				'setAttribs',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4742
				'getAttrib',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4743
				'addClass',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4744
				'removeClass',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4745
				'hasClass',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4746
				'getOuterHTML',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4747
				'setOuterHTML',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4748
				'remove',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4749
				'show',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4750
				'hide',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4751
				'isHidden',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4752
				'setHTML',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4753
				'get'
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4754
			], function(k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4755
				t[k] = function() {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4756
					var a = [id], i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4757
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4758
					for (i = 0; i < arguments.length; i++)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4759
						a.push(arguments[i]);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4760
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4761
					a = dom[k].apply(dom, a);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4762
					t.update(k);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4763
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4764
					return a;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4765
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4766
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4767
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4768
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4769
		on : function(n, f, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4770
			return tinymce.dom.Event.add(this.id, n, f, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4771
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4772
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4773
		getXY : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4774
			return {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4775
				x : parseInt(this.getStyle('left')),
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4776
				y : parseInt(this.getStyle('top'))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4777
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4778
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4779
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4780
		getSize : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4781
			var n = this.dom.get(this.id);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4782
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4783
			return {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4784
				w : parseInt(this.getStyle('width') || n.clientWidth),
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4785
				h : parseInt(this.getStyle('height') || n.clientHeight)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4786
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4787
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4788
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4789
		moveTo : function(x, y) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4790
			this.setStyles({left : x, top : y});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4791
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4792
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4793
		moveBy : function(x, y) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4794
			var p = this.getXY();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4795
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4796
			this.moveTo(p.x + x, p.y + y);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4797
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4798
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4799
		resizeTo : function(w, h) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4800
			this.setStyles({width : w, height : h});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4801
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4802
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4803
		resizeBy : function(w, h) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4804
			var s = this.getSize();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4805
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4806
			this.resizeTo(s.w + w, s.h + h);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4807
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4808
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4809
		update : function(k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4810
			var t = this, b, dom = t.dom;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4811
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4812
			if (tinymce.isIE6 && t.settings.blocker) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4813
				k = k || '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4814
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4815
				// Ignore getters
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4816
				if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4817
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4818
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4819
				// Remove blocker on remove
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4820
				if (k == 'remove') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4821
					dom.remove(t.blocker);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4822
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4823
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4824
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4825
				if (!t.blocker) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4826
					t.blocker = dom.uniqueId();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4827
					b = dom.add(t.settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4828
					dom.setStyle(b, 'opacity', 0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4829
				} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4830
					b = dom.get(t.blocker);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4831
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4832
				dom.setStyle(b, 'left', t.getStyle('left', 1));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4833
				dom.setStyle(b, 'top', t.getStyle('top', 1));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4834
				dom.setStyle(b, 'width', t.getStyle('width', 1));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4835
				dom.setStyle(b, 'height', t.getStyle('height', 1));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4836
				dom.setStyle(b, 'display', t.getStyle('display', 1));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4837
				dom.setStyle(b, 'zIndex', parseInt(t.getStyle('zIndex', 1) || 0) - 1);
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  4838
			}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  4839
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4840
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4841
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4842
(function(tinymce) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4843
	function trimNl(s) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4844
		return s.replace(/[\n\r]+/g, '');
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4845
	};
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4846
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4847
	// Shorten names
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4848
	var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4849
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4850
	tinymce.create('tinymce.dom.Selection', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4851
		Selection : function(dom, win, serializer) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4852
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4853
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4854
			t.dom = dom;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4855
			t.win = win;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4856
			t.serializer = serializer;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4857
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4858
			// Add events
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4859
			each([
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4860
				'onBeforeSetContent',
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4861
				'onBeforeGetContent',
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4862
				'onSetContent',
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4863
				'onGetContent'
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4864
			], function(e) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4865
				t[e] = new tinymce.util.Dispatcher(t);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4866
			});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4867
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4868
			// No W3C Range support
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4869
			if (!t.win.getSelection)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4870
				t.tridentSel = new tinymce.dom.TridentSelection(t);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4871
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4872
			// Prevent leaks
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4873
			tinymce.addUnload(t.destroy, t);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4874
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4875
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4876
		getContent : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4877
			var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4878
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4879
			s = s || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4880
			wb = wa = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4881
			s.get = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4882
			s.format = s.format || 'html';
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4883
			t.onBeforeGetContent.dispatch(t, s);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4884
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4885
			if (s.format == 'text')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4886
				return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : ''));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4887
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4888
			if (r.cloneContents) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4889
				n = r.cloneContents();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4890
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4891
				if (n)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4892
					e.appendChild(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4893
			} else if (is(r.item) || is(r.htmlText))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4894
				e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4895
			else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4896
				e.innerHTML = r.toString();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4897
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4898
			// Keep whitespace before and after
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4899
			if (/^\s/.test(e.innerHTML))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4900
				wb = ' ';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4901
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4902
			if (/\s+$/.test(e.innerHTML))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4903
				wa = ' ';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4904
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  4905
			s.getInner = true;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  4906
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4907
			s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4908
			t.onGetContent.dispatch(t, s);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4909
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4910
			return s.content;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4911
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4912
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4913
		setContent : function(h, s) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4914
			var t = this, r = t.getRng(), c, d = t.win.document;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4915
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4916
			s = s || {format : 'html'};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4917
			s.set = true;
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4918
			h = s.content = t.dom.processHTML(h);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4919
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4920
			// Dispatch before set content event
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4921
			t.onBeforeSetContent.dispatch(t, s);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4922
			h = s.content;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4923
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4924
			if (r.insertNode) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4925
				// Make caret marker since insertNode places the caret in the beginning of text after insert
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4926
				h += '<span id="__caret">_</span>';
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4927
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4928
				// Delete and insert new node
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4929
				r.deleteContents();
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4930
				r.insertNode(t.getRng().createContextualFragment(h));
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4931
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4932
				// Move to caret marker
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4933
				c = t.dom.get('__caret');
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4934
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4935
				// Make sure we wrap it compleatly, Opera fails with a simple select call
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4936
				r = d.createRange();
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4937
				r.setStartBefore(c);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4938
				r.setEndAfter(c);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4939
				t.setRng(r);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4940
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4941
				// Delete the marker, and hopefully the caret gets placed in the right location
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4942
				// Removed this since it seems to remove &nbsp; in FF and simply deleting it
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4943
				// doesn't seem to affect the caret position in any browser
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4944
				//d.execCommand('Delete', false, null);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4945
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4946
				// Remove the caret position
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4947
				t.dom.remove('__caret');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4948
			} else {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  4949
				if (r.item) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  4950
					// Delete content and get caret text selection
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  4951
					d.execCommand('Delete', false, null);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  4952
					r = t.getRng();
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  4953
				}
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  4954
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  4955
				r.pasteHTML(h);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4956
			}
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4957
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4958
			// Dispatch set content event
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  4959
			t.onSetContent.dispatch(t, s);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4960
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4961
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4962
		getStart : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4963
			var t = this, r = t.getRng(), e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4964
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4965
			if (isIE) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4966
				if (r.item)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4967
					return r.item(0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4968
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4969
				r = r.duplicate();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4970
				r.collapse(1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4971
				e = r.parentElement();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4972
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4973
				if (e && e.nodeName == 'BODY')
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4974
					return e.firstChild;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4975
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4976
				return e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4977
			} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4978
				e = r.startContainer;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4979
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4980
				if (e.nodeName == 'BODY')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4981
					return e.firstChild;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4982
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  4983
				return t.dom.getParent(e, '*');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4984
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4985
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4986
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4987
		getEnd : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4988
			var t = this, r = t.getRng(), e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4989
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4990
			if (isIE) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4991
				if (r.item)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4992
					return r.item(0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4993
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4994
				r = r.duplicate();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4995
				r.collapse(0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4996
				e = r.parentElement();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4997
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  4998
				if (e && e.nodeName == 'BODY')
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  4999
					return e.lastChild;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5000
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5001
				return e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5002
			} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5003
				e = r.endContainer;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5004
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5005
				if (e.nodeName == 'BODY')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5006
					return e.lastChild;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5007
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5008
				return t.dom.getParent(e, '*');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5009
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5010
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5011
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5012
		getBookmark : function(si) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5013
			var t = this, r = t.getRng(), tr, sx, sy, vp = t.dom.getViewPort(t.win), e, sp, bp, le, c = -0xFFFFFF, s, ro = t.dom.getRoot(), wb = 0, wa = 0, nv;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5014
			sx = vp.x;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5015
			sy = vp.y;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5016
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5017
			// Simple bookmark fast but not as persistent
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5018
			if (si)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5019
				return {rng : r, scrollX : sx, scrollY : sy};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5020
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5021
			// Handle IE
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5022
			if (isIE) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5023
				// Control selection
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5024
				if (r.item) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5025
					e = r.item(0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5026
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5027
					each(t.dom.select(e.nodeName), function(n, i) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5028
						if (e == n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5029
							sp = i;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5030
							return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5031
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5032
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5033
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5034
					return {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5035
						tag : e.nodeName,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5036
						index : sp,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5037
						scrollX : sx,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5038
						scrollY : sy
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5039
					};
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5040
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5041
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5042
				// Text selection
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5043
				tr = t.dom.doc.body.createTextRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5044
				tr.moveToElementText(ro);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5045
				tr.collapse(true);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5046
				bp = Math.abs(tr.move('character', c));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5047
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5048
				tr = r.duplicate();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5049
				tr.collapse(true);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5050
				sp = Math.abs(tr.move('character', c));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5051
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5052
				tr = r.duplicate();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5053
				tr.collapse(false);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5054
				le = Math.abs(tr.move('character', c)) - sp;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5055
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5056
				return {
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5057
					start : sp - bp,
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5058
					length : le,
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5059
					scrollX : sx,
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5060
					scrollY : sy
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5061
				};
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5062
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5063
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5064
			// Handle W3C
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5065
			e = t.getNode();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5066
			s = t.getSel();
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5067
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5068
			if (!s)
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5069
				return null;
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5070
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5071
			// Image selection
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5072
			if (e && e.nodeName == 'IMG') {
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5073
				return {
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5074
					scrollX : sx,
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5075
					scrollY : sy
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5076
				};
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5077
			}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5078
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5079
			// Text selection
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5080
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5081
			function getPos(r, sn, en) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5082
				var w = t.dom.doc.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {};
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5083
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5084
				while ((n = w.nextNode()) != null) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5085
					if (n == sn)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5086
						d.start = p;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5087
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5088
					if (n == en) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5089
						d.end = p;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5090
						return d;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5091
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5092
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  5093
					p += trimNl(n.nodeValue || '').length;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5094
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5095
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5096
				return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5097
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5098
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5099
			// Caret or selection
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5100
			if (s.anchorNode == s.focusNode && s.anchorOffset == s.focusOffset) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5101
				e = getPos(ro, s.anchorNode, s.focusNode);
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5102
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5103
				if (!e)
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5104
					return {scrollX : sx, scrollY : sy};
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5105
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5106
				// Count whitespace before
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5107
				trimNl(s.anchorNode.nodeValue || '').replace(/^\s+/, function(a) {wb = a.length;});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5108
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5109
				return {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5110
					start : Math.max(e.start + s.anchorOffset - wb, 0),
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5111
					end : Math.max(e.end + s.focusOffset - wb, 0),
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5112
					scrollX : sx,
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  5113
					scrollY : sy,
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5114
					beg : s.anchorOffset - wb == 0
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5115
				};
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5116
			} else {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5117
				e = getPos(ro, r.startContainer, r.endContainer);
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5118
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5119
				// Count whitespace before start and end container
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5120
				//(r.startContainer.nodeValue || '').replace(/^\s+/, function(a) {wb = a.length;});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5121
				//(r.endContainer.nodeValue || '').replace(/^\s+/, function(a) {wa = a.length;});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5122
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5123
				if (!e)
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5124
					return {scrollX : sx, scrollY : sy};
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5125
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5126
				return {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5127
					start : Math.max(e.start + r.startOffset - wb, 0),
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5128
					end : Math.max(e.end + r.endOffset - wa, 0),
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5129
					scrollX : sx,
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  5130
					scrollY : sy,
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5131
					beg : r.startOffset - wb == 0
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5132
				};
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5133
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5134
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5135
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5136
		moveToBookmark : function(b) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5137
			var t = this, r = t.getRng(), s = t.getSel(), ro = t.dom.getRoot(), sd, nvl, nv;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5138
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5139
			function getPos(r, sp, ep) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5140
				var w = t.dom.doc.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {}, o, v, wa, wb;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5141
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5142
				while ((n = w.nextNode()) != null) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5143
					wa = wb = 0;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5144
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5145
					nv = n.nodeValue || '';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5146
					//nv.replace(/^\s+[^\s]/, function(a) {wb = a.length - 1;});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5147
					//nv.replace(/[^\s]\s+$/, function(a) {wa = a.length - 1;});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5148
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5149
					nvl = trimNl(nv).length;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5150
					p += nvl;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5151
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5152
					if (p >= sp && !d.startNode) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5153
						o = sp - (p - nvl);
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  5154
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  5155
						// Fix for odd quirk in FF
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5156
						if (b.beg && o >= nvl)
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  5157
							continue;
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  5158
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5159
						d.startNode = n;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5160
						d.startOffset = o + wb;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5161
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5162
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5163
					if (p >= ep) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5164
						d.endNode = n;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5165
						d.endOffset = ep - (p - nvl) + wb;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5166
						return d;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5167
					}
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5168
				}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5169
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5170
				return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5171
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5172
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5173
			if (!b)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5174
				return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5175
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5176
			t.win.scrollTo(b.scrollX, b.scrollY);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5177
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5178
			// Handle explorer
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5179
			if (isIE) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5180
				t.tridentSel.destroy();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5181
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5182
				// Handle simple
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5183
				if (r = b.rng) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5184
					try {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5185
						r.select();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5186
					} catch (ex) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5187
						// Ignore
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5188
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5189
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5190
					return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5191
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5192
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5193
				t.win.focus();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5194
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5195
				// Handle control bookmark
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5196
				if (b.tag) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5197
					r = ro.createControlRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5198
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5199
					each(t.dom.select(b.tag), function(n, i) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5200
						if (i == b.index)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5201
							r.addElement(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5202
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5203
				} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5204
					// Try/catch needed since this operation breaks when TinyMCE is placed in hidden divs/tabs
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5205
					try {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5206
						// Incorrect bookmark
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5207
						if (b.start < 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5208
							return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5209
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5210
						r = s.createRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5211
						r.moveToElementText(ro);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5212
						r.collapse(true);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5213
						r.moveStart('character', b.start);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5214
						r.moveEnd('character', b.length);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5215
					} catch (ex2) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5216
						return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5217
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5218
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5219
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5220
				try {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5221
					r.select();
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5222
				} catch (ex) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5223
					// Needed for some odd IE bug #1843306
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5224
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5225
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5226
				return true;
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5227
			}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5228
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5229
			// Handle W3C
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5230
			if (!s)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5231
				return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5232
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5233
			// Handle simple
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5234
			if (b.rng) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5235
				s.removeAllRanges();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5236
				s.addRange(b.rng);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5237
			} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5238
				if (is(b.start) && is(b.end)) {
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5239
					try {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5240
						sd = getPos(ro, b.start, b.end);
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  5241
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5242
						if (sd) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5243
							r = t.dom.doc.createRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5244
							r.setStart(sd.startNode, sd.startOffset);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5245
							r.setEnd(sd.endNode, sd.endOffset);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5246
							s.removeAllRanges();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5247
							s.addRange(r);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5248
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5249
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5250
						if (!tinymce.isOpera)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5251
							t.win.focus();
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5252
					} catch (ex) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5253
						// Ignore
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5254
					}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5255
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5256
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5257
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5258
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5259
		select : function(n, c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5260
			var t = this, r = t.getRng(), s = t.getSel(), b, fn, ln, d = t.win.document;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5261
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5262
			function find(n, start) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5263
				var walker, o;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5264
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5265
				if (n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5266
					walker = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5267
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5268
					// Find first/last non empty text node
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5269
					while (n = walker.nextNode()) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5270
						o = n;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5271
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5272
						if (tinymce.trim(n.nodeValue).length != 0) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5273
							if (start)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5274
								return n;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5275
							else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5276
								o = n;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5277
						}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5278
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5279
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5280
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5281
				return o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5282
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5283
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5284
			if (isIE) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5285
				try {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5286
					b = d.body;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5287
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5288
					if (/^(IMG|TABLE)$/.test(n.nodeName)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5289
						r = b.createControlRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5290
						r.addElement(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5291
					} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5292
						r = b.createTextRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5293
						r.moveToElementText(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5294
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5295
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5296
					r.select();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5297
				} catch (ex) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5298
					// Throws illigal agrument in IE some times
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5299
				}
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  5300
			} else {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5301
				if (c) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5302
					fn = find(n, 1) || t.dom.select('br:first', n)[0];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5303
					ln = find(n, 0) || t.dom.select('br:last', n)[0];
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5304
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5305
					if (fn && ln) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5306
						r = d.createRange();
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5307
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5308
						if (fn.nodeName == 'BR')
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5309
							r.setStartBefore(fn);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5310
						else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5311
							r.setStart(fn, 0);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5312
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5313
						if (ln.nodeName == 'BR')
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5314
							r.setEndBefore(ln);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5315
						else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5316
							r.setEnd(ln, ln.nodeValue.length);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5317
					} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5318
						r.selectNode(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5319
				} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5320
					r.selectNode(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5321
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5322
				t.setRng(r);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5323
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5324
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5325
			return n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5326
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5327
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5328
		isCollapsed : function() {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5329
			var t = this, r = t.getRng(), s = t.getSel();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5330
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5331
			if (!r || r.item)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5332
				return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5333
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5334
			return !s || r.boundingWidth == 0 || r.collapsed;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5335
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5336
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5337
		collapse : function(b) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5338
			var t = this, r = t.getRng(), n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5339
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5340
			// Control range on IE
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5341
			if (r.item) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5342
				n = r.item(0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5343
				r = this.win.document.body.createTextRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5344
				r.moveToElementText(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5345
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5346
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5347
			r.collapse(!!b);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5348
			t.setRng(r);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5349
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5350
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5351
		getSel : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5352
			var t = this, w = this.win;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5353
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5354
			return w.getSelection ? w.getSelection() : w.document.selection;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5355
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5356
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5357
		getRng : function(w3c) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5358
			var t = this, s, r;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5359
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5360
			// Found tridentSel object then we need to use that one
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5361
			if (w3c && t.tridentSel)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5362
				return t.tridentSel.getRangeAt(0);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5363
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5364
			try {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5365
				if (s = t.getSel())
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5366
					r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : t.win.document.createRange());
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5367
			} catch (ex) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5368
				// IE throws unspecified error here if TinyMCE is placed in a frame/iframe
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5369
			}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5370
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5371
			// No range found then create an empty one
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5372
			// This can occur when the editor is placed in a hidden container element on Gecko
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5373
			// Or on IE when there was an exception
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5374
			if (!r)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5375
				r = isIE ? t.win.document.body.createTextRange() : t.win.document.createRange();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5376
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5377
			return r;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5378
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5379
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5380
		setRng : function(r) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5381
			var s, t = this;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5382
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5383
			if (!t.tridentSel) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5384
				s = t.getSel();
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5385
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5386
				if (s) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5387
					s.removeAllRanges();
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5388
					s.addRange(r);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5389
				}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5390
			} else {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5391
				// Is W3C Range
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5392
				if (r.cloneRange) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5393
					t.tridentSel.addRange(r);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5394
					return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5395
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5396
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5397
				// Is IE specific range
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5398
				try {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5399
					r.select();
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5400
				} catch (ex) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5401
					// Needed for some odd IE bug #1843306
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5402
				}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5403
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5404
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5405
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5406
		setNode : function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5407
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5408
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5409
			t.setContent(t.dom.getOuterHTML(n));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5410
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5411
			return n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5412
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5413
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5414
		getNode : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5415
			var t = this, r = t.getRng(), s = t.getSel(), e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5416
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5417
			if (!isIE) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5418
				// Range maybe lost after the editor is made visible again
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5419
				if (!r)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5420
					return t.dom.getRoot();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5421
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5422
				e = r.commonAncestorContainer;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5423
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5424
				// Handle selection a image or other control like element such as anchors
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5425
				if (!r.collapsed) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5426
					// If the anchor node is a element instead of a text node then return this element
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5427
					if (tinymce.isWebKit && s.anchorNode && s.anchorNode.nodeType == 1) 
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5428
						return s.anchorNode.childNodes[s.anchorOffset]; 
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5429
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5430
					if (r.startContainer == r.endContainer) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5431
						if (r.startOffset - r.endOffset < 2) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5432
							if (r.startContainer.hasChildNodes())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5433
								e = r.startContainer.childNodes[r.startOffset];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5434
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5435
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5436
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5437
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5438
				return t.dom.getParent(e, '*');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5439
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5440
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5441
			return r.item ? r.item(0) : r.parentElement();
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5442
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5443
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5444
		getSelectedBlocks : function(st, en) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5445
			var t = this, dom = t.dom, sb, eb, n, bl = [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5446
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5447
			sb = dom.getParent(st || t.getStart(), dom.isBlock);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5448
			eb = dom.getParent(en || t.getEnd(), dom.isBlock);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5449
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5450
			if (sb)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5451
				bl.push(sb);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5452
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5453
			if (sb && eb && sb != eb) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5454
				n = sb;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5455
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5456
				while ((n = n.nextSibling) && n != eb) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5457
					if (dom.isBlock(n))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5458
						bl.push(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5459
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5460
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5461
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5462
			if (eb && sb != eb)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5463
				bl.push(eb);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5464
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5465
			return bl;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5466
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5467
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5468
		destroy : function(s) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5469
			var t = this;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5470
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5471
			t.win = null;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5472
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5473
			if (t.tridentSel)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5474
				t.tridentSel.destroy();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5475
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5476
			// Manual destroy then remove unload handler
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5477
			if (!s)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5478
				tinymce.removeUnload(t.destroy);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5479
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5480
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5481
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5482
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5483
	tinymce.create('tinymce.dom.XMLWriter', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5484
		node : null,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5485
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5486
		XMLWriter : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5487
			// Get XML document
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5488
			function getXML() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5489
				var i = document.implementation;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5490
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5491
				if (!i || !i.createDocument) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5492
					// Try IE objects
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5493
					try {return new ActiveXObject('MSXML2.DOMDocument');} catch (ex) {}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5494
					try {return new ActiveXObject('Microsoft.XmlDom');} catch (ex) {}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5495
				} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5496
					return i.createDocument('', '', null);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5497
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5498
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5499
			this.doc = getXML();
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5500
			
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5501
			// Since Opera and WebKit doesn't escape > into &gt; we need to do it our self to normalize the output for all browsers
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5502
			this.valid = tinymce.isOpera || tinymce.isWebKit;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5503
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5504
			this.reset();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5505
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5506
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5507
		reset : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5508
			var t = this, d = t.doc;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5509
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5510
			if (d.firstChild)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5511
				d.removeChild(d.firstChild);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5512
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5513
			t.node = d.appendChild(d.createElement("html"));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5514
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5515
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5516
		writeStartElement : function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5517
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5518
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5519
			t.node = t.node.appendChild(t.doc.createElement(n));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5520
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5521
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5522
		writeAttribute : function(n, v) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5523
			if (this.valid)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5524
				v = v.replace(/>/g, '%MCGT%');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5525
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5526
			this.node.setAttribute(n, v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5527
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5528
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5529
		writeEndElement : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5530
			this.node = this.node.parentNode;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5531
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5532
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5533
		writeFullEndElement : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5534
			var t = this, n = t.node;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5535
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5536
			n.appendChild(t.doc.createTextNode(""));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5537
			t.node = n.parentNode;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5538
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5539
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5540
		writeText : function(v) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5541
			if (this.valid)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5542
				v = v.replace(/>/g, '%MCGT%');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5543
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5544
			this.node.appendChild(this.doc.createTextNode(v));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5545
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5546
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5547
		writeCDATA : function(v) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5548
			this.node.appendChild(this.doc.createCDATASection(v));
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5549
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5550
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5551
		writeComment : function(v) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5552
			// Fix for bug #2035694
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5553
			if (tinymce.isIE)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5554
				v = v.replace(/^\-|\-$/g, ' ');
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5555
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5556
			this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g, ' ')));
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5557
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5558
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5559
		getContent : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5560
			var h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5561
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5562
			h = this.doc.xml || new XMLSerializer().serializeToString(this.doc);
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5563
			h = h.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g, '');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5564
			h = h.replace(/ ?\/>/g, ' />');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5565
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5566
			if (this.valid)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5567
				h = h.replace(/\%MCGT%/g, '&gt;');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5568
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5569
			return h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5570
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5571
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5572
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5573
(function(tinymce) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5574
	tinymce.create('tinymce.dom.StringWriter', {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5575
		str : null,
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5576
		tags : null,
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5577
		count : 0,
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5578
		settings : null,
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5579
		indent : null,
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5580
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5581
		StringWriter : function(s) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5582
			this.settings = tinymce.extend({
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5583
				indent_char : ' ',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5584
				indentation : 0
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5585
			}, s);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5586
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5587
			this.reset();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5588
		},
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5589
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5590
		reset : function() {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5591
			this.indent = '';
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5592
			this.str = "";
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5593
			this.tags = [];
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5594
			this.count = 0;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5595
		},
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5596
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5597
		writeStartElement : function(n) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5598
			this._writeAttributesEnd();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5599
			this.writeRaw('<' + n);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5600
			this.tags.push(n);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5601
			this.inAttr = true;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5602
			this.count++;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5603
			this.elementCount = this.count;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5604
		},
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5605
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5606
		writeAttribute : function(n, v) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5607
			var t = this;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5608
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5609
			t.writeRaw(" " + t.encode(n) + '="' + t.encode(v) + '"');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5610
		},
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5611
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5612
		writeEndElement : function() {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5613
			var n;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5614
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5615
			if (this.tags.length > 0) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5616
				n = this.tags.pop();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5617
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5618
				if (this._writeAttributesEnd(1))
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5619
					this.writeRaw('</' + n + '>');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5620
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5621
				if (this.settings.indentation > 0)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5622
					this.writeRaw('\n');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5623
			}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5624
		},
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5625
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5626
		writeFullEndElement : function() {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5627
			if (this.tags.length > 0) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5628
				this._writeAttributesEnd();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5629
				this.writeRaw('</' + this.tags.pop() + '>');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5630
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5631
				if (this.settings.indentation > 0)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5632
					this.writeRaw('\n');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5633
			}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5634
		},
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5635
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5636
		writeText : function(v) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5637
			this._writeAttributesEnd();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5638
			this.writeRaw(this.encode(v));
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5639
			this.count++;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5640
		},
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5641
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5642
		writeCDATA : function(v) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5643
			this._writeAttributesEnd();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5644
			this.writeRaw('<![CDATA[' + v + ']]>');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5645
			this.count++;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5646
		},
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5647
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5648
		writeComment : function(v) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5649
			this._writeAttributesEnd();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5650
			this.writeRaw('<!-- ' + v + '-->');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5651
			this.count++;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5652
		},
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5653
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5654
		writeRaw : function(v) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5655
			this.str += v;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5656
		},
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5657
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5658
		encode : function(s) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5659
			return s.replace(/[<>&"]/g, function(v) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5660
				switch (v) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5661
					case '<':
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5662
						return '&lt;';
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5663
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5664
					case '>':
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5665
						return '&gt;';
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5666
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5667
					case '&':
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5668
						return '&amp;';
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5669
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5670
					case '"':
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5671
						return '&quot;';
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5672
				}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5673
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5674
				return v;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5675
			});
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5676
		},
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5677
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5678
		getContent : function() {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5679
			return this.str;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5680
		},
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5681
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5682
		_writeAttributesEnd : function(s) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5683
			if (!this.inAttr)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5684
				return;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5685
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5686
			this.inAttr = false;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5687
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5688
			if (s && this.elementCount == this.count) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5689
				this.writeRaw(' />');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5690
				return false;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5691
			}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5692
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5693
			this.writeRaw('>');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5694
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5695
			return true;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5696
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5697
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5698
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5699
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5700
	// Shorten names
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5701
	var extend = tinymce.extend, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, isIE = tinymce.isIE, isGecko = tinymce.isGecko;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5702
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5703
	function wildcardToRE(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5704
		return s.replace(/([?+*])/g, '.$1');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5705
	};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5706
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5707
	tinymce.create('tinymce.dom.Serializer', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5708
		Serializer : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5709
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5710
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5711
			t.key = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5712
			t.onPreProcess = new Dispatcher(t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5713
			t.onPostProcess = new Dispatcher(t);
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  5714
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5715
			try {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5716
				t.writer = new tinymce.dom.XMLWriter();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5717
			} catch (ex) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5718
				// IE might throw exception if ActiveX is disabled so we then switch to the slightly slower StringWriter
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  5719
				t.writer = new tinymce.dom.StringWriter();
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  5720
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5721
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5722
			// Default settings
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5723
			t.settings = s = extend({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5724
				dom : tinymce.DOM,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5725
				valid_nodes : 0,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5726
				node_filter : 0,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5727
				attr_filter : 0,
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5728
				invalid_attrs : /^(mce_|_moz_|sizset|sizcache)/,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5729
				closed : /^(br|hr|input|meta|img|link|param|area)$/,
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5730
				entity_encoding : 'named',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5731
				entities : '160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5732
				valid_elements : '*[*]',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5733
				extended_valid_elements : 0,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5734
				valid_child_elements : 0,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5735
				invalid_elements : 0,
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5736
				fix_table_elements : 1,
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5737
				fix_list_elements : true,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5738
				fix_content_duplication : true,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5739
				convert_fonts_to_spans : false,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5740
				font_size_classes : 0,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5741
				font_size_style_values : 0,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5742
				apply_source_formatting : 0,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5743
				indent_mode : 'simple',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5744
				indent_char : '\t',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5745
				indent_levels : 1,
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5746
				remove_linebreaks : 1,
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5747
				remove_redundant_brs : 1,
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5748
				element_format : 'xhtml'
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5749
			}, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5750
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5751
			t.dom = s.dom;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5752
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5753
			if (s.remove_redundant_brs) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5754
				t.onPostProcess.add(function(se, o) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5755
					// Remove single BR at end of block elements since they get rendered
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5756
					o.content = o.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi, function(a, b, c) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5757
						// Check if it's a single element
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5758
						if (/^<br \/>\s*<\//.test(a))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5759
							return '</' + c + '>';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5760
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5761
						return a;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5762
					});
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5763
				});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5764
			}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5765
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5766
			// Remove XHTML element endings i.e. produce crap :) XHTML is better
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5767
			if (s.element_format == 'html') {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5768
				t.onPostProcess.add(function(se, o) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5769
					o.content = o.content.replace(/<([^>]+) \/>/g, '<$1>');
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5770
				});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5771
			}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  5772
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5773
			if (s.fix_list_elements) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5774
				t.onPreProcess.add(function(se, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5775
					var nl, x, a = ['ol', 'ul'], i, n, p, r = /^(OL|UL)$/, np;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5776
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5777
					function prevNode(e, n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5778
						var a = n.split(','), i;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5779
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5780
						while ((e = e.previousSibling) != null) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5781
							for (i=0; i<a.length; i++) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5782
								if (e.nodeName == a[i])
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5783
									return e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5784
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5785
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5786
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5787
						return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5788
					};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5789
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5790
					for (x=0; x<a.length; x++) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5791
						nl = t.dom.select(a[x], o.node);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5792
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5793
						for (i=0; i<nl.length; i++) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5794
							n = nl[i];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5795
							p = n.parentNode;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5796
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5797
							if (r.test(p.nodeName)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5798
								np = prevNode(n, 'LI');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5799
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5800
								if (!np) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5801
									np = t.dom.create('li');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5802
									np.innerHTML = '&nbsp;';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5803
									np.appendChild(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5804
									p.insertBefore(np, p.firstChild);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5805
								} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5806
									np.appendChild(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5807
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5808
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5809
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5810
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5811
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5812
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5813
			if (s.fix_table_elements) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5814
				t.onPreProcess.add(function(se, o) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5815
					// Since Opera will crash if you attach the node to a dynamic document we need to brrowser sniff a specific build
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5816
					// so Opera users with an older version will have to live with less compaible output not much we can do here
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5817
					if (!tinymce.isOpera || opera.buildNumber() >= 1767) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5818
						each(t.dom.select('p table', o.node).reverse(), function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5819
							var parent = t.dom.getParent(n.parentNode, 'table,p');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5820
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5821
							if (parent.nodeName != 'TABLE') {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5822
								try {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5823
									t.dom.split(parent, n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5824
								} catch (ex) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5825
									// IE can sometimes fire an unknown runtime error so we just ignore it
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5826
								}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  5827
							}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5828
						});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  5829
					}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5830
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5831
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5832
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5833
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5834
		setEntities : function(s) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5835
			var t = this, a, i, l = {}, re = '', v;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5836
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5837
			// No need to setup more than once
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5838
			if (t.entityLookup)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5839
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5840
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5841
			// Build regex and lookup array
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5842
			a = s.split(',');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5843
			for (i = 0; i < a.length; i += 2) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5844
				v = a[i];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5845
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5846
				// Don't add default &amp; &quot; etc.
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5847
				if (v == 34 || v == 38 || v == 60 || v == 62)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5848
					continue;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5849
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5850
				l[String.fromCharCode(a[i])] = a[i + 1];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5851
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5852
				v = parseInt(a[i]).toString(16);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5853
				re += '\\u' + '0000'.substring(v.length) + v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5854
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5855
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5856
			if (!re) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5857
				t.settings.entity_encoding = 'raw';
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5858
				return;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5859
			}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5860
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5861
			t.entitiesRE = new RegExp('[' + re + ']', 'g');
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  5862
			t.entityLookup = l;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5863
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5864
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5865
		setValidChildRules : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5866
			this.childRules = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5867
			this.addValidChildRules(s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5868
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5869
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5870
		addValidChildRules : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5871
			var t = this, inst, intr, bloc;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5872
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5873
			if (!s)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5874
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5875
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5876
			inst = 'A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5877
			intr = 'A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5878
			bloc = 'H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5879
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5880
			each(s.split(','), function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5881
				var p = s.split(/\[|\]/), re;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5882
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5883
				s = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5884
				each(p[1].split('|'), function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5885
					if (s)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5886
						s += '|';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5887
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5888
					switch (v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5889
						case '%itrans':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5890
							v = intr;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5891
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5892
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5893
						case '%itrans_na':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5894
							v = intr.substring(2);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5895
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5896
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5897
						case '%istrict':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5898
							v = inst;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5899
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5900
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5901
						case '%istrict_na':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5902
							v = inst.substring(2);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5903
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5904
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5905
						case '%btrans':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5906
							v = bloc;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5907
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5908
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5909
						case '%bstrict':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5910
							v = bloc;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5911
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5912
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5913
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5914
					s += v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5915
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5916
				re = new RegExp('^(' + s.toLowerCase() + ')$', 'i');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5917
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5918
				each(p[0].split('/'), function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5919
					t.childRules = t.childRules || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5920
					t.childRules[s] = re;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5921
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5922
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5923
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5924
			// Build regex
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5925
			s = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5926
			each(t.childRules, function(v, k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5927
				if (s)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5928
					s += '|';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5929
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5930
				s += k;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5931
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5932
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5933
			t.parentElementsRE = new RegExp('^(' + s.toLowerCase() + ')$', 'i');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5934
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5935
			/*console.debug(t.parentElementsRE.toString());
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5936
			each(t.childRules, function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5937
				console.debug(v.toString());
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5938
			});*/
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5939
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5940
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5941
		setRules : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5942
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5943
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5944
			t._setup();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5945
			t.rules = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5946
			t.wildRules = [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5947
			t.validElements = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5948
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5949
			return t.addRules(s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5950
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5951
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5952
		addRules : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5953
			var t = this, dr;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5954
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5955
			if (!s)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5956
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5957
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5958
			t._setup();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5959
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5960
			each(s.split(','), function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5961
				var p = s.split(/\[|\]/), tn = p[0].split('/'), ra, at, wat, va = [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5962
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5963
				// Extend with default rules
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5964
				if (dr)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5965
					at = tinymce.extend([], dr.attribs);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5966
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5967
				// Parse attributes
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5968
				if (p.length > 1) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5969
					each(p[1].split('|'), function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5970
						var ar = {}, i;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5971
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5972
						at = at || [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5973
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5974
						// Parse attribute rule
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5975
						s = s.replace(/::/g, '~');
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  5976
						s = /^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5977
						s[2] = s[2].replace(/~/g, ':');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5978
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5979
						// Add required attributes
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5980
						if (s[1] == '!') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5981
							ra = ra || [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5982
							ra.push(s[2]);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5983
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5984
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5985
						// Remove inherited attributes
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5986
						if (s[1] == '-') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5987
							for (i = 0; i <at.length; i++) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5988
								if (at[i].name == s[2]) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5989
									at.splice(i, 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5990
									return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5991
								}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5992
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5993
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5994
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5995
						switch (s[3]) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5996
							// Add default attrib values
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5997
							case '=':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5998
								ar.defaultVal = s[4] || '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  5999
								break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6000
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6001
							// Add forced attrib values
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6002
							case ':':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6003
								ar.forcedVal = s[4];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6004
								break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6005
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6006
							// Add validation values
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6007
							case '<':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6008
								ar.validVals = s[4].split('?');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6009
								break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6010
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6011
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6012
						if (/[*.?]/.test(s[2])) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6013
							wat = wat || [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6014
							ar.nameRE = new RegExp('^' + wildcardToRE(s[2]) + '$');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6015
							wat.push(ar);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6016
						} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6017
							ar.name = s[2];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6018
							at.push(ar);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6019
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6020
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6021
						va.push(s[2]);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6022
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6023
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6024
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6025
				// Handle element names
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6026
				each(tn, function(s, i) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6027
					var pr = s.charAt(0), x = 1, ru = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6028
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6029
					// Extend with default rule data
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6030
					if (dr) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6031
						if (dr.noEmpty)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6032
							ru.noEmpty = dr.noEmpty;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6033
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6034
						if (dr.fullEnd)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6035
							ru.fullEnd = dr.fullEnd;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6036
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6037
						if (dr.padd)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6038
							ru.padd = dr.padd;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6039
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6040
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6041
					// Handle prefixes
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6042
					switch (pr) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6043
						case '-':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6044
							ru.noEmpty = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6045
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6046
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6047
						case '+':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6048
							ru.fullEnd = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6049
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6050
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6051
						case '#':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6052
							ru.padd = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6053
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6054
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6055
						default:
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6056
							x = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6057
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6058
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6059
					tn[i] = s = s.substring(x);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6060
					t.validElements[s] = 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6061
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6062
					// Add element name or element regex
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6063
					if (/[*.?]/.test(tn[0])) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6064
						ru.nameRE = new RegExp('^' + wildcardToRE(tn[0]) + '$');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6065
						t.wildRules = t.wildRules || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6066
						t.wildRules.push(ru);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6067
					} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6068
						ru.name = tn[0];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6069
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6070
						// Store away default rule
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6071
						if (tn[0] == '@')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6072
							dr = ru;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6073
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6074
						t.rules[s] = ru;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6075
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6076
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6077
					ru.attribs = at;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6078
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6079
					if (ra)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6080
						ru.requiredAttribs = ra;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6081
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6082
					if (wat) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6083
						// Build valid attributes regexp
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6084
						s = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6085
						each(va, function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6086
							if (s)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6087
								s += '|';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6088
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6089
							s += '(' + wildcardToRE(v) + ')';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6090
						});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6091
						ru.validAttribsRE = new RegExp('^' + s.toLowerCase() + '$');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6092
						ru.wildAttribs = wat;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6093
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6094
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6095
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6096
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6097
			// Build valid elements regexp
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6098
			s = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6099
			each(t.validElements, function(v, k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6100
				if (s)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6101
					s += '|';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6102
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6103
				if (k != '@')
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6104
					s += k;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6105
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6106
			t.validElementsRE = new RegExp('^(' + wildcardToRE(s.toLowerCase()) + ')$');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6107
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6108
			//console.debug(t.validElementsRE.toString());
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6109
			//console.dir(t.rules);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6110
			//console.dir(t.wildRules);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6111
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6112
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6113
		findRule : function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6114
			var t = this, rl = t.rules, i, r;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6115
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6116
			t._setup();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6117
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6118
			// Exact match
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6119
			r = rl[n];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6120
			if (r)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6121
				return r;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6122
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6123
			// Try wildcards
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6124
			rl = t.wildRules;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6125
			for (i = 0; i < rl.length; i++) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6126
				if (rl[i].nameRE.test(n))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6127
					return rl[i];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6128
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6129
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6130
			return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6131
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6132
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6133
		findAttribRule : function(ru, n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6134
			var i, wa = ru.wildAttribs;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6135
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6136
			for (i = 0; i < wa.length; i++) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6137
				if (wa[i].nameRE.test(n))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6138
					return wa[i];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6139
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6140
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6141
			return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6142
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6143
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6144
		serialize : function(n, o) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6145
			var h, t = this, doc, oldDoc, impl, selected;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6146
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6147
			t._setup();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6148
			o = o || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6149
			o.format = o.format || 'html';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6150
			t.processObj = o;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6151
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6152
			// IE looses the selected attribute on option elements so we need to store it
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6153
			// See: http://support.microsoft.com/kb/829907
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6154
			if (isIE) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6155
				selected = [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6156
				each(n.getElementsByTagName('option'), function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6157
					var v = t.dom.getAttrib(n, 'selected');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6158
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6159
					selected.push(v ? v : null);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6160
				});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6161
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6162
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6163
			n = n.cloneNode(true);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6164
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6165
			// IE looses the selected attribute on option elements so we need to restore it
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6166
			if (isIE) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6167
				each(n.getElementsByTagName('option'), function(n, i) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6168
					t.dom.setAttrib(n, 'selected', selected[i]);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6169
				});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6170
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6171
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6172
			// Nodes needs to be attached to something in WebKit/Opera
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6173
			// Older builds of Opera crashes if you attach the node to an document created dynamically
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6174
			// and since we can't feature detect a crash we need to sniff the acutal build number
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6175
			// This fix will make DOM ranges and make Sizzle happy!
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6176
			impl = n.ownerDocument.implementation;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6177
			if (impl.createHTMLDocument && (tinymce.isOpera && opera.buildNumber() >= 1767)) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6178
				// Create an empty HTML document
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6179
				doc = impl.createHTMLDocument("");
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6180
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6181
				// Add the element or it's children if it's a body element to the new document
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6182
				each(n.nodeName == 'BODY' ? n.childNodes : [n], function(node) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6183
					doc.body.appendChild(doc.importNode(node, true));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6184
				});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6185
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6186
				// Grab first child or body element for serialization
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6187
				if (n.nodeName != 'BODY')
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6188
					n = doc.body.firstChild;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6189
				else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6190
					n = doc.body;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6191
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6192
				// set the new document in DOMUtils so createElement etc works
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6193
				oldDoc = t.dom.doc;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6194
				t.dom.doc = doc;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6195
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6196
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6197
			t.key = '' + (parseInt(t.key) + 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6198
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6199
			// Pre process
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6200
			if (!o.no_events) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6201
				o.node = n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6202
				t.onPreProcess.dispatch(t, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6203
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6204
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6205
			// Serialize HTML DOM into a string
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6206
			t.writer.reset();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6207
			t._serializeNode(n, o.getInner);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6208
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6209
			// Post process
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6210
			o.content = t.writer.getContent();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6211
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6212
			// Restore the old document if it was changed
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6213
			if (oldDoc)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6214
				t.dom.doc = oldDoc;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6215
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6216
			if (!o.no_events)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6217
				t.onPostProcess.dispatch(t, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6218
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6219
			t._postProcess(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6220
			o.node = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6221
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6222
			return tinymce.trim(o.content);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6223
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6224
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6225
		// Internal functions
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6226
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6227
		_postProcess : function(o) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6228
			var t = this, s = t.settings, h = o.content, sc = [], p;
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6229
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6230
			if (o.format == 'html') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6231
				// Protect some elements
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6232
				p = t._protect({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6233
					content : h,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6234
					patterns : [
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6235
						{pattern : /(<script[^>]*>)(.*?)(<\/script>)/g},
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6236
						{pattern : /(<noscript[^>]*>)(.*?)(<\/noscript>)/g},
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6237
						{pattern : /(<style[^>]*>)(.*?)(<\/style>)/g},
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6238
						{pattern : /(<pre[^>]*>)(.*?)(<\/pre>)/g, encode : 1},
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6239
						{pattern : /(<!--\[CDATA\[)(.*?)(\]\]-->)/g}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6240
					]
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6241
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6242
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6243
				h = p.content;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6244
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6245
				// Entity encode
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6246
				if (s.entity_encoding !== 'raw')
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6247
					h = t._encode(h);
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6248
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6249
				// Use BR instead of &nbsp; padded P elements inside editor and use <p>&nbsp;</p> outside editor
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6250
/*				if (o.set)
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6251
					h = h.replace(/<p>\s+(&nbsp;|&#160;|\u00a0|<br \/>)\s+<\/p>/g, '<p><br /></p>');
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6252
				else
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6253
					h = h.replace(/<p>\s+(&nbsp;|&#160;|\u00a0|<br \/>)\s+<\/p>/g, '<p>$1</p>');*/
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6254
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6255
				// Since Gecko and Safari keeps whitespace in the DOM we need to
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6256
				// remove it inorder to match other browsers. But I think Gecko and Safari is right.
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6257
				// This process is only done when getting contents out from the editor.
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6258
				if (!o.set) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6259
					// We need to replace paragraph whitespace with an nbsp before indentation to keep the \u00a0 char
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6260
					h = h.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g, s.entity_encoding == 'numeric' ? '<p$1>&#160;</p>' : '<p$1>&nbsp;</p>');
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6261
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6262
					if (s.remove_linebreaks) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6263
						h = h.replace(/\r?\n|\r/g, ' ');
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6264
						h = h.replace(/(<[^>]+>)\s+/g, '$1 ');
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6265
						h = h.replace(/\s+(<\/[^>]+>)/g, ' $1');
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6266
						h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g, '<$1 $2>'); // Trim block start
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6267
						h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g, '<$1>'); // Trim block start
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6268
						h = h.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g, '</$1>'); // Trim block end
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6269
					}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6270
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6271
					// Simple indentation
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6272
					if (s.apply_source_formatting && s.indent_mode == 'simple') {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6273
						// Add line breaks before and after block elements
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6274
						h = h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g, '\n<$1$2$3>\n');
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6275
						h = h.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g, '\n<$1$2>');
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6276
						h = h.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g, '</$1>\n');
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6277
						h = h.replace(/\n\n/g, '\n');
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6278
					}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6279
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6280
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6281
				h = t._unprotect(h, p);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6282
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6283
				// Restore CDATA sections
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6284
				h = h.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g, '<![CDATA[$1]]>');
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6285
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6286
				// Restore the \u00a0 character if raw mode is enabled
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6287
				if (s.entity_encoding == 'raw')
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6288
					h = h.replace(/<p>&nbsp;<\/p>|<p([^>]+)>&nbsp;<\/p>/g, '<p$1>\u00a0</p>');
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6289
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6290
				// Restore noscript elements
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6291
				h = h.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6292
					return '<noscript' + attribs + '>' + t.dom.decode(text.replace(/<!--|-->/g, '')) + '</noscript>';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6293
				});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6294
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6295
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6296
			o.content = h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6297
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6298
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6299
		_serializeNode : function(n, inn) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6300
			var t = this, s = t.settings, w = t.writer, hc, el, cn, i, l, a, at, no, v, nn, ru, ar, iv, closed;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6301
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6302
			if (!s.node_filter || s.node_filter(n)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6303
				switch (n.nodeType) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6304
					case 1: // Element
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6305
						if (n.hasAttribute ? n.hasAttribute('mce_bogus') : n.getAttribute('mce_bogus'))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6306
							return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6307
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6308
						iv = false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6309
						hc = n.hasChildNodes();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6310
						nn = n.getAttribute('mce_name') || n.nodeName.toLowerCase();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6311
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6312
						// Add correct prefix on IE
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6313
						if (isIE) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6314
							if (n.scopeName !== 'HTML' && n.scopeName !== 'html')
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6315
								nn = n.scopeName + ':' + nn;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6316
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6317
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6318
						// Remove mce prefix on IE needed for the abbr element
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6319
						if (nn.indexOf('mce:') === 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6320
							nn = nn.substring(4);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6321
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6322
						// Check if valid
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6323
						if (!t.validElementsRE || !t.validElementsRE.test(nn) || (t.invalidElementsRE && t.invalidElementsRE.test(nn)) || inn) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6324
							iv = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6325
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6326
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6327
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6328
						if (isIE) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6329
							// Fix IE content duplication (DOM can have multiple copies of the same node)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6330
							if (s.fix_content_duplication) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6331
								if (n.mce_serialized == t.key)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6332
									return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6333
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6334
								n.mce_serialized = t.key;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6335
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6336
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6337
							// IE sometimes adds a / infront of the node name
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6338
							if (nn.charAt(0) == '/')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6339
								nn = nn.substring(1);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6340
						} else if (isGecko) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6341
							// Ignore br elements
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6342
							if (n.nodeName === 'BR' && n.getAttribute('type') == '_moz')
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6343
								return;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6344
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6345
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6346
						// Check if valid child
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6347
						if (t.childRules) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6348
							if (t.parentElementsRE.test(t.elementName)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6349
								if (!t.childRules[t.elementName].test(nn)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6350
									iv = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6351
									break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6352
								}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6353
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6354
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6355
							t.elementName = nn;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6356
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6357
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6358
						ru = t.findRule(nn);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6359
						nn = ru.name || nn;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6360
						closed = s.closed.test(nn);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6361
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6362
						// Skip empty nodes or empty node name in IE
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6363
						if ((!hc && ru.noEmpty) || (isIE && !nn)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6364
							iv = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6365
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6366
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6367
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6368
						// Check required
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6369
						if (ru.requiredAttribs) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6370
							a = ru.requiredAttribs;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6371
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6372
							for (i = a.length - 1; i >= 0; i--) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6373
								if (this.dom.getAttrib(n, a[i]) !== '')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6374
									break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6375
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6376
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6377
							// None of the required was there
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6378
							if (i == -1) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6379
								iv = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6380
								break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6381
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6382
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6383
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6384
						w.writeStartElement(nn);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6385
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6386
						// Add ordered attributes
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6387
						if (ru.attribs) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6388
							for (i=0, at = ru.attribs, l = at.length; i<l; i++) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6389
								a = at[i];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6390
								v = t._getAttrib(n, a);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6391
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6392
								if (v !== null)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6393
									w.writeAttribute(a.name, v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6394
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6395
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6396
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6397
						// Add wild attributes
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6398
						if (ru.validAttribsRE) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6399
							at = t.dom.getAttribs(n);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6400
							for (i=at.length-1; i>-1; i--) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6401
								no = at[i];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6402
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6403
								if (no.specified) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6404
									a = no.nodeName.toLowerCase();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6405
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6406
									if (s.invalid_attrs.test(a) || !ru.validAttribsRE.test(a))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6407
										continue;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6408
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6409
									ar = t.findAttribRule(ru, a);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6410
									v = t._getAttrib(n, ar, a);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6411
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6412
									if (v !== null)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6413
										w.writeAttribute(a, v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6414
								}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6415
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6416
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6417
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6418
						// Write text from script
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6419
						if (nn === 'script' && tinymce.trim(n.innerHTML)) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6420
							w.writeText('// '); // Padd it with a comment so it will parse on older browsers
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6421
							w.writeCDATA(n.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g, '')); // Remove comments and cdata stuctures
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6422
							hc = false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6423
							break;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6424
						}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6425
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6426
						// Padd empty nodes with a &nbsp;
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6427
						if (ru.padd) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6428
							// If it has only one bogus child, padd it anyway workaround for <td><br /></td> bug
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6429
							if (hc && (cn = n.firstChild) && cn.nodeType === 1 && n.childNodes.length === 1) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6430
								if (cn.hasAttribute ? cn.hasAttribute('mce_bogus') : cn.getAttribute('mce_bogus'))
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6431
									w.writeText('\u00a0');
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6432
							} else if (!hc)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6433
								w.writeText('\u00a0'); // No children then padd it
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6434
						}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6435
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6436
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6437
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6438
					case 3: // Text
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6439
						// Check if valid child
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6440
						if (t.childRules && t.parentElementsRE.test(t.elementName)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6441
							if (!t.childRules[t.elementName].test(n.nodeName))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6442
								return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6443
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6444
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6445
						return w.writeText(n.nodeValue);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6446
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6447
					case 4: // CDATA
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6448
						return w.writeCDATA(n.nodeValue);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6449
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6450
					case 8: // Comment
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6451
						return w.writeComment(n.nodeValue);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6452
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6453
			} else if (n.nodeType == 1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6454
				hc = n.hasChildNodes();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6455
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6456
			if (hc && !closed) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6457
				cn = n.firstChild;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6458
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6459
				while (cn) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6460
					t._serializeNode(cn);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6461
					t.elementName = nn;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6462
					cn = cn.nextSibling;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6463
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6464
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6465
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6466
			// Write element end
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6467
			if (!iv) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6468
				if (!closed)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6469
					w.writeFullEndElement();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6470
				else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6471
					w.writeEndElement();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6472
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6473
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6474
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6475
		_protect : function(o) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6476
			var t = this;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6477
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6478
			o.items = o.items || [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6479
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6480
			function enc(s) {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6481
				return s.replace(/[\r\n\\]/g, function(c) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6482
					if (c === '\n')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6483
						return '\\n';
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6484
					else if (c === '\\')
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6485
						return '\\\\';
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6486
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6487
					return '\\r';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6488
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6489
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6490
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6491
			function dec(s) {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6492
				return s.replace(/\\[\\rn]/g, function(c) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6493
					if (c === '\\n')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6494
						return '\n';
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6495
					else if (c === '\\\\')
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6496
						return '\\';
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6497
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6498
					return '\r';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6499
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6500
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6501
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6502
			each(o.patterns, function(p) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6503
				o.content = dec(enc(o.content).replace(p.pattern, function(x, a, b, c) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6504
					b = dec(b);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6505
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6506
					if (p.encode)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6507
						b = t._encode(b);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6508
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6509
					o.items.push(b);
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6510
					return a + '<!--mce:' + (o.items.length - 1) + '-->' + c;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6511
				}));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6512
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6513
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6514
			return o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6515
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6516
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6517
		_unprotect : function(h, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6518
			h = h.replace(/\<!--mce:([0-9]+)--\>/g, function(a, b) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6519
				return o.items[parseInt(b)];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6520
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6521
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6522
			o.items = [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6523
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6524
			return h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6525
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6526
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6527
		_encode : function(h) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6528
			var t = this, s = t.settings, l;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6529
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6530
			// Entity encode
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6531
			if (s.entity_encoding !== 'raw') {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6532
				if (s.entity_encoding.indexOf('named') != -1) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6533
					t.setEntities(s.entities);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6534
					l = t.entityLookup;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6535
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6536
					h = h.replace(t.entitiesRE, function(a) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6537
						var v;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6538
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6539
						if (v = l[a])
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6540
							a = '&' + v + ';';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6541
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6542
						return a;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6543
					});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6544
				}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6545
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6546
				if (s.entity_encoding.indexOf('numeric') != -1) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6547
					h = h.replace(/[\u007E-\uFFFF]/g, function(a) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6548
						return '&#' + a.charCodeAt(0) + ';';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6549
					});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6550
				}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6551
			}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6552
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6553
			return h;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6554
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6555
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6556
		_setup : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6557
			var t = this, s = this.settings;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6558
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6559
			if (t.done)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6560
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6561
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6562
			t.done = 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6563
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6564
			t.setRules(s.valid_elements);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6565
			t.addRules(s.extended_valid_elements);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6566
			t.addValidChildRules(s.valid_child_elements);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6567
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6568
			if (s.invalid_elements)
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  6569
				t.invalidElementsRE = new RegExp('^(' + wildcardToRE(s.invalid_elements.replace(/,/g, '|').toLowerCase()) + ')$');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6570
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6571
			if (s.attrib_value_filter)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6572
				t.attribValueFilter = s.attribValueFilter;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6573
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6574
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6575
		_getAttrib : function(n, a, na) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6576
			var i, v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6577
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6578
			na = na || a.name;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6579
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6580
			if (a.forcedVal && (v = a.forcedVal)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6581
				if (v === '{$uid}')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6582
					return this.dom.uniqueId();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6583
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6584
				return v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6585
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6586
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6587
			v = this.dom.getAttrib(n, na);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6588
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6589
			switch (na) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6590
				case 'rowspan':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6591
				case 'colspan':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6592
					// Whats the point? Remove usless attribute value
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6593
					if (v == '1')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6594
						v = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6595
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6596
					break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6597
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6598
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6599
			if (this.attribValueFilter)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6600
				v = this.attribValueFilter(na, v, n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6601
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6602
			if (a.validVals) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6603
				for (i = a.validVals.length - 1; i >= 0; i--) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6604
					if (v == a.validVals[i])
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6605
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6606
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6607
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6608
				if (i == -1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6609
					return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6610
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6611
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6612
			if (v === '' && typeof(a.defaultVal) != 'undefined') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6613
				v = a.defaultVal;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6614
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6615
				if (v === '{$uid}')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6616
					return this.dom.uniqueId();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6617
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6618
				return v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6619
			} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6620
				// Remove internal mceItemXX classes when content is extracted from editor
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6621
				if (na == 'class' && this.processObj.get)
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6622
					v = v.replace(/\s?mceItem\w+\s?/g, '');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6623
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6624
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6625
			if (v === '')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6626
				return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6627
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6628
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6629
			return v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6630
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6631
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6632
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6633
(function(tinymce) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6634
	var each = tinymce.each, Event = tinymce.dom.Event;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6635
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6636
	tinymce.create('tinymce.dom.ScriptLoader', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6637
		ScriptLoader : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6638
			this.settings = s || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6639
			this.queue = [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6640
			this.lookup = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6641
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6642
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6643
		isDone : function(u) {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6644
			return this.lookup[u] ? this.lookup[u].state == 2 : 0;
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6645
		},
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  6646
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6647
		markDone : function(u) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6648
			this.lookup[u] = {state : 2, url : u};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6649
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6650
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6651
		add : function(u, cb, s, pr) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6652
			var t = this, lo = t.lookup, o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6653
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6654
			if (o = lo[u]) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6655
				// Is loaded fire callback
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6656
				if (cb && o.state == 2)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6657
					cb.call(s || this);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6658
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6659
				return o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6660
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6661
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6662
			o = {state : 0, url : u, func : cb, scope : s || this};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6663
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6664
			if (pr)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6665
				t.queue.unshift(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6666
			else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6667
				t.queue.push(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6668
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6669
			lo[u] = o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6670
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6671
			return o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6672
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6673
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6674
		load : function(u, cb, s) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6675
			var t = this, o;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6676
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6677
			if (o = t.lookup[u]) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6678
				// Is loaded fire callback
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6679
				if (cb && o.state == 2)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6680
					cb.call(s || t);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6681
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6682
				return o;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6683
			}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6684
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6685
			function loadScript(u) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6686
				if (Event.domLoaded || t.settings.strict_mode) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6687
					tinymce.util.XHR.send({
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6688
						url : tinymce._addVer(u),
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6689
						error : t.settings.error,
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6690
						async : false,
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6691
						success : function(co) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6692
							t.eval(co);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6693
						}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6694
					});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6695
				} else
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6696
					document.write('<script type="text/javascript" src="' + tinymce._addVer(u) + '"></script>');
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6697
			};
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6698
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6699
			if (!tinymce.is(u, 'string')) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6700
				each(u, function(u) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6701
					loadScript(u);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6702
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6703
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6704
				if (cb)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6705
					cb.call(s || t);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6706
			} else {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6707
				loadScript(u);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6708
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6709
				if (cb)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6710
					cb.call(s || t);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6711
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6712
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6713
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6714
		loadQueue : function(cb, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6715
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6716
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6717
			if (!t.queueLoading) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6718
				t.queueLoading = 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6719
				t.queueCallbacks = [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6720
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6721
				t.loadScripts(t.queue, function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6722
					t.queueLoading = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6723
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6724
					if (cb)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6725
						cb.call(s || t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6726
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6727
					each(t.queueCallbacks, function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6728
						o.func.call(o.scope);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6729
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6730
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6731
			} else if (cb)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6732
				t.queueCallbacks.push({func : cb, scope : s || t});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6733
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6734
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6735
		eval : function(co) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6736
			var w = window;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6737
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6738
			// Evaluate script
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6739
			if (!w.execScript) {
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  6740
				try {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6741
					eval.call(w, co);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6742
				} catch (ex) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6743
					eval(co, w); // Firefox 3.0a8
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6744
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6745
			} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6746
				w.execScript(co); // IE
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6747
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6748
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6749
		loadScripts : function(sc, cb, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6750
			var t = this, lo = t.lookup;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6751
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6752
			function done(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6753
				o.state = 2; // Has been loaded
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6754
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6755
				// Run callback
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6756
				if (o.func)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6757
					o.func.call(o.scope || t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6758
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6759
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6760
			function allDone() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6761
				var l;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6762
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6763
				// Check if all files are loaded
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6764
				l = sc.length;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6765
				each(sc, function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6766
					o = lo[o.url];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6767
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6768
					if (o.state === 2) {// It has finished loading
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6769
						done(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6770
						l--;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6771
					} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6772
						load(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6773
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6774
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6775
				// They are all loaded
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6776
				if (l === 0 && cb) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6777
					cb.call(s || t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6778
					cb = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6779
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6780
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6781
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6782
			function load(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6783
				if (o.state > 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6784
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6785
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6786
				o.state = 1; // Is loading
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6787
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6788
				tinymce.dom.ScriptLoader.loadScript(o.url, function() {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6789
					done(o);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6790
					allDone();
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6791
				});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6792
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6793
				/*
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6794
				tinymce.util.XHR.send({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6795
					url : o.url,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6796
					error : t.settings.error,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6797
					success : function(co) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6798
						t.eval(co);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6799
						done(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6800
						allDone();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6801
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6802
				});
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6803
				*/
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6804
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6805
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6806
			each(sc, function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6807
				var u = o.url;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6808
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6809
				// Add to queue if needed
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6810
				if (!lo[u]) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6811
					lo[u] = o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6812
					t.queue.push(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6813
				} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6814
					o = lo[u];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6815
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6816
				// Is already loading or has been loaded
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6817
				if (o.state > 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6818
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6819
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6820
				if (!Event.domLoaded && !t.settings.strict_mode) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6821
					var ix, ol = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6822
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6823
					// Add onload events
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6824
					if (cb || o.func) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6825
						o.state = 1; // Is loading
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6826
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6827
						ix = tinymce.dom.ScriptLoader._addOnLoad(function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6828
							done(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6829
							allDone();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6830
						});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6831
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6832
						if (tinymce.isIE)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6833
							ol = ' onreadystatechange="';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6834
						else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6835
							ol = ' onload="';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6836
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6837
						ol += 'tinymce.dom.ScriptLoader._onLoad(this,\'' + u + '\',' + ix + ');"';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6838
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6839
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6840
					document.write('<script type="text/javascript" src="' + tinymce._addVer(u) + '"' + ol + '></script>');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6841
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6842
					if (!o.func)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6843
						done(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6844
				} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6845
					load(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6846
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6847
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6848
			allDone();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6849
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6850
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6851
		// Static methods
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6852
		'static' : {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6853
			_addOnLoad : function(f) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6854
				var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6855
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6856
				t._funcs = t._funcs || [];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6857
				t._funcs.push(f);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6858
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6859
				return t._funcs.length - 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6860
			},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6861
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6862
			_onLoad : function(e, u, ix) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6863
				if (!tinymce.isIE || e.readyState == 'complete')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6864
					this._funcs[ix].call(this);
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6865
			},
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6866
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6867
			loadScript : function(u, cb) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6868
				var id = tinymce.DOM.uniqueId(), e;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6869
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6870
				function done() {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6871
					Event.clear(id);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6872
					tinymce.DOM.remove(id);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6873
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6874
					if (cb) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6875
						cb.call(document, u);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6876
						cb = 0;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6877
					}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6878
				};
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6879
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6880
				if (tinymce.isIE) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6881
/*					Event.add(e, 'readystatechange', function(e) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6882
						if (e.target && e.target.readyState == 'complete')
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6883
							done();
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6884
					});*/
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6885
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6886
					tinymce.util.XHR.send({
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6887
						url : tinymce._addVer(u),
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6888
						async : false,
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6889
						success : function(co) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6890
							window.execScript(co);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6891
							done();
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6892
						}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6893
					});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6894
				} else {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6895
					e = tinymce.DOM.create('script', {id : id, type : 'text/javascript', src : tinymce._addVer(u)});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6896
					Event.add(e, 'load', done);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6897
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6898
					// Check for head or body
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6899
					(document.getElementsByTagName('head')[0] || document.body).appendChild(e);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  6900
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6901
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6902
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6903
	});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6904
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6905
	// Global script loader
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6906
	tinymce.ScriptLoader = new tinymce.dom.ScriptLoader();
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6907
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  6908
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6909
	// Shorten class names
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6910
	var DOM = tinymce.DOM, is = tinymce.is;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6911
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6912
	tinymce.create('tinymce.ui.Control', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6913
		Control : function(id, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6914
			this.id = id;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6915
			this.settings = s = s || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6916
			this.rendered = false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6917
			this.onRender = new tinymce.util.Dispatcher(this);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6918
			this.classPrefix = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6919
			this.scope = s.scope || this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6920
			this.disabled = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6921
			this.active = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6922
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6923
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6924
		setDisabled : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6925
			var e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6926
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6927
			if (s != this.disabled) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6928
				e = DOM.get(this.id);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6929
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6930
				// Add accessibility title for unavailable actions
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6931
				if (e && this.settings.unavailable_prefix) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6932
					if (s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6933
						this.prevTitle = e.title;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6934
						e.title = this.settings.unavailable_prefix + ": " + e.title;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6935
					} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6936
						e.title = this.prevTitle;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6937
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6938
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6939
				this.setState('Disabled', s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6940
				this.setState('Enabled', !s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6941
				this.disabled = s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6942
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6943
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6944
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6945
		isDisabled : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6946
			return this.disabled;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6947
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6948
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6949
		setActive : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6950
			if (s != this.active) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6951
				this.setState('Active', s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6952
				this.active = s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6953
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6954
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6955
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6956
		isActive : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6957
			return this.active;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6958
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6959
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6960
		setState : function(c, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6961
			var n = DOM.get(this.id);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6962
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6963
			c = this.classPrefix + c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6964
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6965
			if (s)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6966
				DOM.addClass(n, c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6967
			else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6968
				DOM.removeClass(n, c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6969
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6970
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6971
		isRendered : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6972
			return this.rendered;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6973
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6974
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6975
		renderHTML : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6976
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6977
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6978
		renderTo : function(n) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  6979
			DOM.setHTML(n, this.renderHTML());
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6980
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6981
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6982
		postRender : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6983
			var t = this, b;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6984
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6985
			// Set pending states
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6986
			if (is(t.disabled)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6987
				b = t.disabled;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6988
				t.disabled = -1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6989
				t.setDisabled(b);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6990
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6991
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6992
			if (is(t.active)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6993
				b = t.active;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6994
				t.active = -1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6995
				t.setActive(b);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6996
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6997
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  6998
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  6999
		remove : function() {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7000
			DOM.remove(this.id);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7001
			this.destroy();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7002
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7003
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7004
		destroy : function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7005
			tinymce.dom.Event.clear(this.id);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7006
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7007
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7008
})(tinymce);tinymce.create('tinymce.ui.Container:tinymce.ui.Control', {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7009
	Container : function(id, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7010
		this.parent(id, s);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7011
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7012
		this.controls = [];
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7013
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7014
		this.lookup = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7015
	},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7016
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7017
	add : function(c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7018
		this.lookup[c.id] = c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7019
		this.controls.push(c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7020
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7021
		return c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7022
	},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7023
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7024
	get : function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7025
		return this.lookup[n];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7026
	}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7027
});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7028
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7029
tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7030
	Separator : function(id, s) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7031
		this.parent(id, s);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7032
		this.classPrefix = 'mceSeparator';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7033
	},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7034
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7035
	renderHTML : function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7036
		return tinymce.DOM.createHTML('span', {'class' : this.classPrefix});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7037
	}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7038
});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7039
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7040
	var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7041
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7042
	tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7043
		MenuItem : function(id, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7044
			this.parent(id, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7045
			this.classPrefix = 'mceMenuItem';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7046
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7047
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7048
		setSelected : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7049
			this.setState('Selected', s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7050
			this.selected = s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7051
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7052
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7053
		isSelected : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7054
			return this.selected;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7055
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7056
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7057
		postRender : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7058
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7059
			
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7060
			t.parent();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7061
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7062
			// Set pending state
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7063
			if (is(t.selected))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7064
				t.setSelected(t.selected);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7065
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7066
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7067
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7068
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7069
	var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7070
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7071
	tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7072
		Menu : function(id, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7073
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7074
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7075
			t.parent(id, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7076
			t.items = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7077
			t.collapsed = false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7078
			t.menuCount = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7079
			t.onAddItem = new tinymce.util.Dispatcher(this);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7080
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7081
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7082
		expand : function(d) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7083
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7084
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7085
			if (d) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7086
				walk(t, function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7087
					if (o.expand)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7088
						o.expand();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7089
				}, 'items', t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7090
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7091
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7092
			t.collapsed = false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7093
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7094
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7095
		collapse : function(d) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7096
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7097
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7098
			if (d) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7099
				walk(t, function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7100
					if (o.collapse)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7101
						o.collapse();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7102
				}, 'items', t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7103
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7104
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7105
			t.collapsed = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7106
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7107
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7108
		isCollapsed : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7109
			return this.collapsed;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7110
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7111
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7112
		add : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7113
			if (!o.settings)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7114
				o = new tinymce.ui.MenuItem(o.id || DOM.uniqueId(), o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7115
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7116
			this.onAddItem.dispatch(this, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7117
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7118
			return this.items[o.id] = o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7119
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7120
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7121
		addSeparator : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7122
			return this.add({separator : true});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7123
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7124
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7125
		addMenu : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7126
			if (!o.collapse)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7127
				o = this.createMenu(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7128
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7129
			this.menuCount++;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7130
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7131
			return this.add(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7132
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7133
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7134
		hasMenus : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7135
			return this.menuCount !== 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7136
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7137
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7138
		remove : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7139
			delete this.items[o.id];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7140
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7141
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7142
		removeAll : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7143
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7144
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7145
			walk(t, function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7146
				if (o.removeAll)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7147
					o.removeAll();
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7148
				else
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7149
					o.remove();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7150
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7151
				o.destroy();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7152
			}, 'items', t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7153
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7154
			t.items = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7155
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7156
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7157
		createMenu : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7158
			var m = new tinymce.ui.Menu(o.id || DOM.uniqueId(), o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7159
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7160
			m.onAddItem.add(this.onAddItem.dispatch, this.onAddItem);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7161
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7162
			return m;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7163
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7164
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7165
})(tinymce);(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7166
	var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event, Element = tinymce.dom.Element;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7167
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7168
	tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7169
		DropMenu : function(id, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7170
			s = s || {};
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7171
			s.container = s.container || DOM.doc.body;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7172
			s.offset_x = s.offset_x || 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7173
			s.offset_y = s.offset_y || 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7174
			s.vp_offset_x = s.vp_offset_x || 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7175
			s.vp_offset_y = s.vp_offset_y || 0;
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7176
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7177
			if (is(s.icons) && !s.icons)
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  7178
				s['class'] += ' mceNoIcons';
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7179
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7180
			this.parent(id, s);
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  7181
			this.onShowMenu = new tinymce.util.Dispatcher(this);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7182
			this.onHideMenu = new tinymce.util.Dispatcher(this);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7183
			this.classPrefix = 'mceMenu';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7184
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7185
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7186
		createMenu : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7187
			var t = this, cs = t.settings, m;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7188
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7189
			s.container = s.container || cs.container;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7190
			s.parent = t;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7191
			s.constrain = s.constrain || cs.constrain;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7192
			s['class'] = s['class'] || cs['class'];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7193
			s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7194
			s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7195
			m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7196
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7197
			m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7198
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7199
			return m;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7200
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7201
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7202
		update : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7203
			var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7204
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7205
			tw = s.max_width ? Math.min(tb.clientWidth, s.max_width) : tb.clientWidth;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7206
			th = s.max_height ? Math.min(tb.clientHeight, s.max_height) : tb.clientHeight;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7207
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7208
			if (!DOM.boxModel)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7209
				t.element.setStyles({width : tw + 2, height : th + 2});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7210
			else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7211
				t.element.setStyles({width : tw, height : th});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7212
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7213
			if (s.max_width)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7214
				DOM.setStyle(co, 'width', tw);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7215
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7216
			if (s.max_height) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7217
				DOM.setStyle(co, 'height', th);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7218
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7219
				if (tb.clientHeight < s.max_height)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7220
					DOM.setStyle(co, 'overflow', 'hidden');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7221
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7222
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7223
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7224
		showMenu : function(x, y, px) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7225
			var t = this, s = t.settings, co, vp = DOM.getViewPort(), w, h, mx, my, ot = 2, dm, tb, cp = t.classPrefix;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7226
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7227
			t.collapse(1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7228
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7229
			if (t.isMenuVisible)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7230
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7231
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7232
			if (!t.rendered) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7233
				co = DOM.add(t.settings.container, t.renderNode());
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7234
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7235
				each(t.items, function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7236
					o.postRender();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7237
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7238
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7239
				t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7240
			} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7241
				co = DOM.get('menu_' + t.id);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7242
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  7243
			// Move layer out of sight unless it's Opera since it scrolls to top of page due to an bug
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  7244
			if (!tinymce.isOpera)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  7245
				DOM.setStyles(co, {left : -0xFFFF , top : -0xFFFF});
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  7246
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7247
			DOM.show(co);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7248
			t.update();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7249
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7250
			x += s.offset_x || 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7251
			y += s.offset_y || 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7252
			vp.w -= 4;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7253
			vp.h -= 4;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7254
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7255
			// Move inside viewport if not submenu
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7256
			if (s.constrain) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7257
				w = co.clientWidth - ot;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7258
				h = co.clientHeight - ot;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7259
				mx = vp.x + vp.w;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7260
				my = vp.y + vp.h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7261
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7262
				if ((x + s.vp_offset_x + w) > mx)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7263
					x = px ? px - w : Math.max(0, (mx - s.vp_offset_x) - w);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7264
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7265
				if ((y + s.vp_offset_y + h) > my)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7266
					y = Math.max(0, (my - s.vp_offset_y) - h);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7267
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7268
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7269
			DOM.setStyles(co, {left : x , top : y});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7270
			t.element.update();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7271
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7272
			t.isMenuVisible = 1;
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7273
			t.mouseClickFunc = Event.add(co, 'click', function(e) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7274
				var m;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7275
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7276
				e = e.target;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7277
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7278
				if (e && (e = DOM.getParent(e, 'tr')) && !DOM.hasClass(e, cp + 'ItemSub')) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7279
					m = t.items[e.id];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7280
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7281
					if (m.isDisabled())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7282
						return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7283
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7284
					dm = t;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7285
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7286
					while (dm) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7287
						if (dm.hideMenu)
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7288
							dm.hideMenu();
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7289
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7290
						dm = dm.settings.parent;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7291
					}
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7292
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7293
					if (m.settings.onclick)
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7294
						m.settings.onclick(e);
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  7295
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7296
					return Event.cancel(e); // Cancel to fix onbeforeunload problem
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7297
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7298
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7299
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7300
			if (t.hasMenus()) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7301
				t.mouseOverFunc = Event.add(co, 'mouseover', function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7302
					var m, r, mi;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7303
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7304
					e = e.target;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7305
					if (e && (e = DOM.getParent(e, 'tr'))) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7306
						m = t.items[e.id];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7307
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7308
						if (t.lastMenu)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7309
							t.lastMenu.collapse(1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7310
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7311
						if (m.isDisabled())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7312
							return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7313
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7314
						if (e && DOM.hasClass(e, cp + 'ItemSub')) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7315
							//p = DOM.getPos(s.container);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7316
							r = DOM.getRect(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7317
							m.showMenu((r.x + r.w - ot), r.y - ot, r.x);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7318
							t.lastMenu = m;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7319
							DOM.addClass(DOM.get(m.id).firstChild, cp + 'ItemActive');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7320
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7321
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7322
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7323
			}
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  7324
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  7325
			t.onShowMenu.dispatch(t);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7326
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7327
			if (s.keyboard_focus) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7328
				Event.add(co, 'keydown', t._keyHandler, t);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7329
				DOM.select('a', 'menu_' + t.id)[0].focus(); // Select first link
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7330
				t._focusIdx = 0;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7331
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7332
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7333
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7334
		hideMenu : function(c) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7335
			var t = this, co = DOM.get('menu_' + t.id), e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7336
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7337
			if (!t.isMenuVisible)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7338
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7339
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7340
			Event.remove(co, 'mouseover', t.mouseOverFunc);
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7341
			Event.remove(co, 'click', t.mouseClickFunc);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7342
			Event.remove(co, 'keydown', t._keyHandler);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7343
			DOM.hide(co);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7344
			t.isMenuVisible = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7345
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7346
			if (!c)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7347
				t.collapse(1);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7348
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7349
			if (t.element)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7350
				t.element.hide();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7351
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7352
			if (e = DOM.get(t.id))
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7353
				DOM.removeClass(e.firstChild, t.classPrefix + 'ItemActive');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7354
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7355
			t.onHideMenu.dispatch(t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7356
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7357
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7358
		add : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7359
			var t = this, co;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7360
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7361
			o = t.parent(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7362
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7363
			if (t.isRendered && (co = DOM.get('menu_' + t.id)))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7364
				t._add(DOM.select('tbody', co)[0], o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7365
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7366
			return o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7367
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7368
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7369
		collapse : function(d) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7370
			this.parent(d);
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7371
			this.hideMenu(1);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7372
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7373
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7374
		remove : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7375
			DOM.remove(o.id);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7376
			this.destroy();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7377
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7378
			return this.parent(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7379
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7380
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7381
		destroy : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7382
			var t = this, co = DOM.get('menu_' + t.id);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7383
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7384
			Event.remove(co, 'mouseover', t.mouseOverFunc);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7385
			Event.remove(co, 'click', t.mouseClickFunc);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7386
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7387
			if (t.element)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7388
				t.element.remove();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7389
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7390
			DOM.remove(co);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7391
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7392
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7393
		renderNode : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7394
			var t = this, s = t.settings, n, tb, co, w;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7395
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7396
			w = DOM.create('div', {id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000'});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7397
			co = DOM.add(w, 'div', {id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7398
			t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7399
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7400
			if (s.menu_line)
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7401
				DOM.add(co, 'span', {'class' : t.classPrefix + 'Line'});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7402
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7403
//			n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7404
			n = DOM.add(co, 'table', {id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7405
			tb = DOM.add(n, 'tbody');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7406
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7407
			each(t.items, function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7408
				t._add(tb, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7409
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7410
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7411
			t.rendered = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7412
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7413
			return w;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7414
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7415
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7416
		// Internal functions
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7417
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7418
		_keyHandler : function(e) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7419
			var t = this, kc = e.keyCode;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7420
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7421
			function focus(d) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7422
				var i = t._focusIdx + d, e = DOM.select('a', 'menu_' + t.id)[i];
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7423
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7424
				if (e) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7425
					t._focusIdx = i;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7426
					e.focus();
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7427
				}
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7428
			};
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7429
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7430
			switch (kc) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7431
				case 38:
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7432
					focus(-1); // Select first link
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7433
					return;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7434
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7435
				case 40:
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7436
					focus(1);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7437
					return;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7438
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7439
				case 13:
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7440
					return;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7441
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7442
				case 27:
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7443
					return this.hideMenu();
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7444
			}
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7445
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7446
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7447
		_add : function(tb, o) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7448
			var n, s = o.settings, a, ro, it, cp = this.classPrefix, ic;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7449
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7450
			if (s.separator) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7451
				ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'ItemSeparator'});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7452
				DOM.add(ro, 'td', {'class' : cp + 'ItemSeparator'});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7453
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7454
				if (n = ro.previousSibling)
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  7455
					DOM.addClass(n, 'mceLast');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7456
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7457
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7458
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7459
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7460
			n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'Item ' + cp + 'ItemEnabled'});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7461
			n = it = DOM.add(n, 'td');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7462
			n = a = DOM.add(n, 'a', {href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7463
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7464
			DOM.addClass(it, s['class']);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7465
//			n = DOM.add(n, 'span', {'class' : 'item'});
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7466
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7467
			ic = DOM.add(n, 'span', {'class' : 'mceIcon' + (s.icon ? ' mce_' + s.icon : '')});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7468
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7469
			if (s.icon_src)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7470
				DOM.add(ic, 'img', {src : s.icon_src});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7471
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  7472
			n = DOM.add(n, s.element || 'span', {'class' : 'mceText', title : o.settings.title}, o.settings.title);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7473
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7474
			if (o.settings.style)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7475
				DOM.setAttrib(n, 'style', o.settings.style);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7476
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7477
			if (tb.childNodes.length == 1)
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  7478
				DOM.addClass(ro, 'mceFirst');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7479
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7480
			if ((n = ro.previousSibling) && DOM.hasClass(n, cp + 'ItemSeparator'))
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  7481
				DOM.addClass(ro, 'mceFirst');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7482
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7483
			if (o.collapse)
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7484
				DOM.addClass(ro, cp + 'ItemSub');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7485
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7486
			if (n = ro.previousSibling)
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  7487
				DOM.removeClass(n, 'mceLast');
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  7488
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  7489
			DOM.addClass(ro, 'mceLast');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7490
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7491
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7492
})(tinymce);(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7493
	var DOM = tinymce.DOM;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7494
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7495
	tinymce.create('tinymce.ui.Button:tinymce.ui.Control', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7496
		Button : function(id, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7497
			this.parent(id, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7498
			this.classPrefix = 'mceButton';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7499
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7500
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7501
		renderHTML : function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7502
			var cp = this.classPrefix, s = this.settings, h, l;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7503
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7504
			l = DOM.encode(s.label || '');
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7505
			h = '<a id="' + this.id + '" href="javascript:;" class="' + cp + ' ' + cp + 'Enabled ' + s['class'] + (l ? ' ' + cp + 'Labeled' : '') +'" onmousedown="return false;" onclick="return false;" title="' + DOM.encode(s.title) + '">';
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7506
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7507
			if (s.image)
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7508
				h += '<img class="mceIcon" src="' + s.image + '" />' + l + '</a>';
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7509
			else
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7510
				h += '<span class="mceIcon ' + s['class'] + '"></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '') + '</a>';
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7511
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7512
			return h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7513
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7514
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7515
		postRender : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7516
			var t = this, s = t.settings;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7517
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7518
			tinymce.dom.Event.add(t.id, 'click', function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7519
				if (!t.isDisabled())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7520
					return s.onclick.call(s.scope, e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7521
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7522
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7523
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7524
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7525
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7526
	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7527
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7528
	tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7529
		ListBox : function(id, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7530
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7531
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7532
			t.parent(id, s);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7533
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7534
			t.items = [];
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7535
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7536
			t.onChange = new Dispatcher(t);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7537
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7538
			t.onPostRender = new Dispatcher(t);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7539
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7540
			t.onAdd = new Dispatcher(t);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7541
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7542
			t.onRenderMenu = new tinymce.util.Dispatcher(this);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7543
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7544
			t.classPrefix = 'mceListBox';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7545
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7546
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7547
		select : function(va) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7548
			var t = this, fv, f;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7549
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7550
			if (va == undefined)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7551
				return t.selectByIndex(-1);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7552
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7553
			// Is string or number make function selector
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7554
			if (va && va.call)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7555
				f = va;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7556
			else {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7557
				f = function(v) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7558
					return v == va;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7559
				};
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7560
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7561
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7562
			// Do we need to do something?
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7563
			if (va != t.selectedValue) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7564
				// Find item
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7565
				each(t.items, function(o, i) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7566
					if (f(o.value)) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7567
						fv = 1;
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7568
						t.selectByIndex(i);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7569
						return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7570
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7571
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7572
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7573
				if (!fv)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7574
					t.selectByIndex(-1);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7575
			}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7576
		},
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7577
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7578
		selectByIndex : function(idx) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7579
			var t = this, e, o;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7580
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7581
			if (idx != t.selectedIndex) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7582
				e = DOM.get(t.id + '_text');
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7583
				o = t.items[idx];
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7584
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7585
				if (o) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7586
					t.selectedValue = o.value;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7587
					t.selectedIndex = idx;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7588
					DOM.setHTML(e, DOM.encode(o.title));
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7589
					DOM.removeClass(e, 'mceTitle');
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7590
				} else {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7591
					DOM.setHTML(e, DOM.encode(t.settings.title));
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  7592
					DOM.addClass(e, 'mceTitle');
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7593
					t.selectedValue = t.selectedIndex = null;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7594
				}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7595
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7596
				e = 0;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7597
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7598
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7599
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7600
		add : function(n, v, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7601
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7602
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7603
			o = o || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7604
			o = tinymce.extend(o, {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7605
				title : n,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7606
				value : v
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7607
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7608
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7609
			t.items.push(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7610
			t.onAdd.dispatch(t, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7611
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7612
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7613
		getLength : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7614
			return this.items.length;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7615
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7616
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7617
		renderHTML : function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7618
			var h = '', t = this, s = t.settings, cp = t.classPrefix;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7619
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7620
			h = '<table id="' + t.id + '" cellpadding="0" cellspacing="0" class="' + cp + ' ' + cp + 'Enabled' + (s['class'] ? (' ' + s['class']) : '') + '"><tbody><tr>';
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  7621
			h += '<td>' + DOM.createHTML('a', {id : t.id + '_text', href : 'javascript:;', 'class' : 'mceText', onclick : "return false;", onmousedown : 'return false;'}, DOM.encode(t.settings.title)) + '</td>';
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7622
			h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', tabindex : -1, href : 'javascript:;', 'class' : 'mceOpen', onclick : "return false;", onmousedown : 'return false;'}, '<span></span>') + '</td>';
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7623
			h += '</tr></tbody></table>';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7624
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7625
			return h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7626
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7627
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7628
		showMenu : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7629
			var t = this, p1, p2, e = DOM.get(this.id), m;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7630
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7631
			if (t.isDisabled() || t.items.length == 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7632
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7633
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7634
			if (t.menu && t.menu.isMenuVisible)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7635
				return t.hideMenu();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7636
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7637
			if (!t.isMenuRendered) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7638
				t.renderMenu();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7639
				t.isMenuRendered = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7640
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7641
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7642
			p1 = DOM.getPos(this.settings.menu_container);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7643
			p2 = DOM.getPos(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7644
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7645
			m = t.menu;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7646
			m.settings.offset_x = p2.x;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7647
			m.settings.offset_y = p2.y;
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7648
			m.settings.keyboard_focus = !tinymce.isOpera; // Opera is buggy when it comes to auto focus
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7649
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7650
			// Select in menu
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7651
			if (t.oldID)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7652
				m.items[t.oldID].setSelected(0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7653
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7654
			each(t.items, function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7655
				if (o.value === t.selectedValue) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7656
					m.items[o.id].setSelected(1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7657
					t.oldID = o.id;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7658
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7659
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7660
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7661
			m.showMenu(0, e.clientHeight);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7662
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7663
			Event.add(DOM.doc, 'mousedown', t.hideMenu, t);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7664
			DOM.addClass(t.id, t.classPrefix + 'Selected');
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7665
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7666
			//DOM.get(t.id + '_text').focus();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7667
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7668
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7669
		hideMenu : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7670
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7671
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7672
			// Prevent double toogles by canceling the mouse click event to the button
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7673
			if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open'))
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7674
				return;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7675
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7676
			if (!e || !DOM.getParent(e.target, '.mceMenu')) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7677
				DOM.removeClass(t.id, t.classPrefix + 'Selected');
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7678
				Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7679
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7680
				if (t.menu)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7681
					t.menu.hideMenu();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7682
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7683
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7684
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7685
		renderMenu : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7686
			var t = this, m;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7687
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7688
			m = t.settings.control_manager.createDropMenu(t.id + '_menu', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7689
				menu_line : 1,
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7690
				'class' : t.classPrefix + 'Menu mceNoIcons',
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7691
				max_width : 150,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7692
				max_height : 150
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7693
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7694
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7695
			m.onHideMenu.add(t.hideMenu, t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7696
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7697
			m.add({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7698
				title : t.settings.title,
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7699
				'class' : 'mceMenuItemTitle',
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7700
				onclick : function() {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7701
					if (t.settings.onselect('') !== false)
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7702
						t.select(''); // Must be runned after
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7703
				}
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7704
			});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7705
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7706
			each(t.items, function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7707
				o.id = DOM.uniqueId();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7708
				o.onclick = function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7709
					if (t.settings.onselect(o.value) !== false)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7710
						t.select(o.value); // Must be runned after
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7711
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7712
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7713
				m.add(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7714
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7715
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7716
			t.onRenderMenu.dispatch(t, m);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7717
			t.menu = m;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7718
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7719
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7720
		postRender : function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7721
			var t = this, cp = t.classPrefix;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7722
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7723
			Event.add(t.id, 'click', t.showMenu, t);
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7724
			Event.add(t.id + '_text', 'focus', function(e) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7725
				if (!t._focused) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7726
					t.keyDownHandler = Event.add(t.id + '_text', 'keydown', function(e) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7727
						var idx = -1, v, kc = e.keyCode;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7728
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7729
						// Find current index
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7730
						each(t.items, function(v, i) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7731
							if (t.selectedValue == v.value)
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7732
								idx = i;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7733
						});
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7734
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7735
						// Move up/down
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7736
						if (kc == 38)
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7737
							v = t.items[idx - 1];
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7738
						else if (kc == 40)
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7739
							v = t.items[idx + 1];
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7740
						else if (kc == 13) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7741
							// Fake select on enter
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7742
							v = t.selectedValue;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7743
							t.selectedValue = null; // Needs to be null to fake change
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7744
							t.settings.onselect(v);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7745
							return Event.cancel(e);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7746
						}
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7747
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7748
						if (v) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7749
							t.hideMenu();
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7750
							t.select(v.value);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7751
						}
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7752
					});
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7753
				}
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7754
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7755
				t._focused = 1;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7756
			});
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  7757
			Event.add(t.id + '_text', 'blur', function() {Event.remove(t.id + '_text', 'keydown', t.keyDownHandler); t._focused = 0;});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7758
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7759
			// Old IE doesn't have hover on all elements
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7760
			if (tinymce.isIE6 || !DOM.boxModel) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7761
				Event.add(t.id, 'mouseover', function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7762
					if (!DOM.hasClass(t.id, cp + 'Disabled'))
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7763
						DOM.addClass(t.id, cp + 'Hover');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7764
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7765
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7766
				Event.add(t.id, 'mouseout', function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7767
					if (!DOM.hasClass(t.id, cp + 'Disabled'))
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7768
						DOM.removeClass(t.id, cp + 'Hover');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7769
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7770
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7771
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7772
			t.onPostRender.dispatch(t, DOM.get(t.id));
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7773
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7774
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7775
		destroy : function() {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7776
			this.parent();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7777
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7778
			Event.clear(this.id + '_text');
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7779
			Event.clear(this.id + '_open');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7780
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7781
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7782
})(tinymce);(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7783
	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7784
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7785
	tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7786
		NativeListBox : function(id, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7787
			this.parent(id, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7788
			this.classPrefix = 'mceNativeListBox';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7789
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7790
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7791
		setDisabled : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7792
			DOM.get(this.id).disabled = s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7793
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7794
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7795
		isDisabled : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7796
			return DOM.get(this.id).disabled;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7797
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7798
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7799
		select : function(va) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7800
			var t = this, fv, f;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7801
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7802
			if (va == undefined)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7803
				return t.selectByIndex(-1);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7804
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7805
			// Is string or number make function selector
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7806
			if (va && va.call)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7807
				f = va;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7808
			else {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7809
				f = function(v) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7810
					return v == va;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7811
				};
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7812
			}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7813
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7814
			// Do we need to do something?
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7815
			if (va != t.selectedValue) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7816
				// Find item
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7817
				each(t.items, function(o, i) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7818
					if (f(o.value)) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7819
						fv = 1;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7820
						t.selectByIndex(i);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7821
						return false;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7822
					}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7823
				});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7824
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7825
				if (!fv)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7826
					t.selectByIndex(-1);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7827
			}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7828
		},
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7829
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7830
		selectByIndex : function(idx) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7831
			DOM.get(this.id).selectedIndex = idx + 1;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7832
			this.selectedValue = this.items[idx] ? this.items[idx].value : null;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7833
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7834
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7835
		add : function(n, v, a) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7836
			var o, t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7837
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7838
			a = a || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7839
			a.value = v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7840
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7841
			if (t.isRendered())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7842
				DOM.add(DOM.get(this.id), 'option', a, n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7843
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7844
			o = {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7845
				title : n,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7846
				value : v,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7847
				attribs : a
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7848
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7849
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7850
			t.items.push(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7851
			t.onAdd.dispatch(t, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7852
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7853
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7854
		getLength : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7855
			return DOM.get(this.id).options.length - 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7856
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7857
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7858
		renderHTML : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7859
			var h, t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7860
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7861
			h = DOM.createHTML('option', {value : ''}, '-- ' + t.settings.title + ' --');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7862
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7863
			each(t.items, function(it) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7864
				h += DOM.createHTML('option', {value : it.value}, it.title);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7865
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7866
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7867
			h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox'}, h);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7868
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7869
			return h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7870
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7871
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7872
		postRender : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7873
			var t = this, ch;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7874
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7875
			t.rendered = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7876
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7877
			function onChange(e) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7878
				var v = t.items[e.target.selectedIndex - 1];
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7879
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7880
				if (v && (v = v.value)) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7881
					t.onChange.dispatch(t, v);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7882
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7883
					if (t.settings.onselect)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7884
						t.settings.onselect(v);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  7885
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7886
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7887
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7888
			Event.add(t.id, 'change', onChange);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7889
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7890
			// Accessibility keyhandler
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7891
			Event.add(t.id, 'keydown', function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7892
				var bf;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7893
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7894
				Event.remove(t.id, 'change', ch);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7895
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7896
				bf = Event.add(t.id, 'blur', function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7897
					Event.add(t.id, 'change', onChange);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7898
					Event.remove(t.id, 'blur', bf);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7899
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7900
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7901
				if (e.keyCode == 13 || e.keyCode == 32) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7902
					onChange(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7903
					return Event.cancel(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7904
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7905
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7906
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7907
			t.onPostRender.dispatch(t, DOM.get(t.id));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7908
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7909
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7910
})(tinymce);(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7911
	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7912
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7913
	tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7914
		MenuButton : function(id, s) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7915
			this.parent(id, s);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7916
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7917
			this.onRenderMenu = new tinymce.util.Dispatcher(this);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7918
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7919
			s.menu_container = s.menu_container || DOM.doc.body;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7920
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7921
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7922
		showMenu : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7923
			var t = this, p1, p2, e = DOM.get(t.id), m;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7924
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7925
			if (t.isDisabled())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7926
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7927
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7928
			if (!t.isMenuRendered) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7929
				t.renderMenu();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7930
				t.isMenuRendered = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7931
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7932
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7933
			if (t.isMenuVisible)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7934
				return t.hideMenu();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7935
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7936
			p1 = DOM.getPos(t.settings.menu_container);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7937
			p2 = DOM.getPos(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7938
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7939
			m = t.menu;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7940
			m.settings.offset_x = p2.x;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7941
			m.settings.offset_y = p2.y;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7942
			m.settings.vp_offset_x = p2.x;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7943
			m.settings.vp_offset_y = p2.y;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7944
			m.settings.keyboard_focus = t._focused;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7945
			m.showMenu(0, e.clientHeight);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7946
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7947
			Event.add(DOM.doc, 'mousedown', t.hideMenu, t);
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7948
			t.setState('Selected', 1);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7949
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7950
			t.isMenuVisible = 1;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7951
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7952
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7953
		renderMenu : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7954
			var t = this, m;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7955
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7956
			m = t.settings.control_manager.createDropMenu(t.id + '_menu', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7957
				menu_line : 1,
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7958
				'class' : this.classPrefix + 'Menu',
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7959
				icons : t.settings.icons
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7960
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7961
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7962
			m.onHideMenu.add(t.hideMenu, t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7963
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7964
			t.onRenderMenu.dispatch(t, m);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7965
			t.menu = m;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7966
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7967
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7968
		hideMenu : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7969
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7970
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7971
			// Prevent double toogles by canceling the mouse click event to the button
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7972
			if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id || e.id === t.id + '_open';}))
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7973
				return;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7974
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7975
			if (!e || !DOM.getParent(e.target, '.mceMenu')) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7976
				t.setState('Selected', 0);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7977
				Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7978
				if (t.menu)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7979
					t.menu.hideMenu();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7980
			}
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7981
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  7982
			t.isMenuVisible = 0;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7983
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  7984
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7985
		postRender : function() {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7986
			var t = this, s = t.settings;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7987
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7988
			Event.add(t.id, 'click', function() {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7989
				if (!t.isDisabled()) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7990
					if (s.onclick)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7991
						s.onclick(t.value);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7992
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7993
					t.showMenu();
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7994
				}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7995
			});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  7996
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7997
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7998
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  7999
(function(tinymce) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8000
	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8001
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8002
	tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8003
		SplitButton : function(id, s) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8004
			this.parent(id, s);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8005
			this.classPrefix = 'mceSplitButton';
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8006
		},
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8007
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8008
		renderHTML : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8009
			var h, t = this, s = t.settings, h1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8010
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8011
			h = '<tbody><tr>';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8012
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8013
			if (s.image)
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8014
				h1 = DOM.createHTML('img ', {src : s.image, 'class' : 'mceAction ' + s['class']});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8015
			else
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8016
				h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, '');
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8017
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8018
			h += '<td>' + DOM.createHTML('a', {id : t.id + '_action', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8019
	
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8020
			h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']});
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8021
			h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8022
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8023
			h += '</tr></tbody>';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8024
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8025
			return DOM.createHTML('table', {id : t.id, 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', onmousedown : 'return false;', title : s.title}, h);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8026
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8027
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8028
		postRender : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8029
			var t = this, s = t.settings;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8030
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8031
			if (s.onclick) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8032
				Event.add(t.id + '_action', 'click', function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8033
					if (!t.isDisabled())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8034
						s.onclick(t.value);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8035
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8036
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8037
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8038
			Event.add(t.id + '_open', 'click', t.showMenu, t);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8039
			Event.add(t.id + '_open', 'focus', function() {t._focused = 1;});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8040
			Event.add(t.id + '_open', 'blur', function() {t._focused = 0;});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8041
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8042
			// Old IE doesn't have hover on all elements
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8043
			if (tinymce.isIE6 || !DOM.boxModel) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8044
				Event.add(t.id, 'mouseover', function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8045
					if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8046
						DOM.addClass(t.id, 'mceSplitButtonHover');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8047
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8048
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8049
				Event.add(t.id, 'mouseout', function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8050
					if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8051
						DOM.removeClass(t.id, 'mceSplitButtonHover');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8052
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8053
			}
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8054
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8055
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8056
		destroy : function() {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8057
			this.parent();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8058
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8059
			Event.clear(this.id + '_action');
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8060
			Event.clear(this.id + '_open');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8061
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8062
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8063
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8064
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8065
	var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8066
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8067
	tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8068
		ColorSplitButton : function(id, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8069
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8070
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8071
			t.parent(id, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8072
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8073
			t.settings = s = tinymce.extend({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8074
				colors : '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8075
				grid_width : 8,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8076
				default_color : '#888888'
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8077
			}, t.settings);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8078
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  8079
			t.onShowMenu = new tinymce.util.Dispatcher(t);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8080
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  8081
			t.onHideMenu = new tinymce.util.Dispatcher(t);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  8082
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8083
			t.value = s.default_color;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8084
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8085
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8086
		showMenu : function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8087
			var t = this, r, p, e, p2;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8088
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8089
			if (t.isDisabled())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8090
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8091
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8092
			if (!t.isMenuRendered) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8093
				t.renderMenu();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8094
				t.isMenuRendered = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8095
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8096
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8097
			if (t.isMenuVisible)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8098
				return t.hideMenu();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8099
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8100
			e = DOM.get(t.id);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8101
			DOM.show(t.id + '_menu');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8102
			DOM.addClass(e, 'mceSplitButtonSelected');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8103
			p2 = DOM.getPos(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8104
			DOM.setStyles(t.id + '_menu', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8105
				left : p2.x,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8106
				top : p2.y + e.clientHeight,
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8107
				zIndex : 200000
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8108
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8109
			e = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8110
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8111
			Event.add(DOM.doc, 'mousedown', t.hideMenu, t);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8112
			t.onShowMenu.dispatch(t);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8113
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8114
			if (t._focused) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8115
				t._keyHandler = Event.add(t.id + '_menu', 'keydown', function(e) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8116
					if (e.keyCode == 27)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8117
						t.hideMenu();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8118
				});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8119
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8120
				DOM.select('a', t.id + '_menu')[0].focus(); // Select first link
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8121
			}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8122
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8123
			t.isMenuVisible = 1;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8124
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8125
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8126
		hideMenu : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8127
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8128
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8129
			// Prevent double toogles by canceling the mouse click event to the button
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8130
			if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';}))
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8131
				return;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8132
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8133
			if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8134
				DOM.removeClass(t.id, 'mceSplitButtonSelected');
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8135
				Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8136
				Event.remove(t.id + '_menu', 'keydown', t._keyHandler);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8137
				DOM.hide(t.id + '_menu');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8138
			}
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8139
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  8140
			t.onHideMenu.dispatch(t);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  8141
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8142
			t.isMenuVisible = 0;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8143
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8144
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8145
		renderMenu : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8146
			var t = this, m, i = 0, s = t.settings, n, tb, tr, w;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8147
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8148
			w = DOM.add(s.menu_container, 'div', {id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8149
			m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8150
			DOM.add(m, 'span', {'class' : 'mceMenuLine'});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8151
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8152
			n = DOM.add(m, 'table', {'class' : 'mceColorSplitMenu'});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8153
			tb = DOM.add(n, 'tbody');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8154
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8155
			// Generate color grid
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8156
			i = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8157
			each(is(s.colors, 'array') ? s.colors : s.colors.split(','), function(c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8158
				c = c.replace(/^#/, '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8159
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8160
				if (!i--) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8161
					tr = DOM.add(tb, 'tr');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8162
					i = s.grid_width - 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8163
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8164
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8165
				n = DOM.add(tr, 'td');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8166
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8167
				n = DOM.add(n, 'a', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8168
					href : 'javascript:;',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8169
					style : {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8170
						backgroundColor : '#' + c
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8171
					},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8172
					mce_color : '#' + c
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8173
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8174
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8175
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8176
			if (s.more_colors_func) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8177
				n = DOM.add(tb, 'tr');
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8178
				n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'mceMoreColors'});
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8179
				n = DOM.add(n, 'a', {id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8180
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8181
				Event.add(n, 'click', function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8182
					s.more_colors_func.call(s.more_colors_scope || this);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8183
					return Event.cancel(e); // Cancel to fix onbeforeunload problem
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8184
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8185
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8186
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8187
			DOM.addClass(m, 'mceColorSplitMenu');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8188
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8189
			Event.add(t.id + '_menu', 'click', function(e) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8190
				var c;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8191
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8192
				e = e.target;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8193
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8194
				if (e.nodeName == 'A' && (c = e.getAttribute('mce_color')))
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8195
					t.setColor(c);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8196
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8197
				return Event.cancel(e); // Prevent IE auto save warning
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8198
			});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8199
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8200
			return w;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8201
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8202
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8203
		setColor : function(c) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8204
			var t = this;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8205
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8206
			DOM.setStyle(t.id + '_preview', 'backgroundColor', c);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8207
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8208
			t.value = c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8209
			t.hideMenu();
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8210
			t.settings.onselect(c);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8211
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8212
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8213
		postRender : function() {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8214
			var t = this, id = t.id;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8215
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8216
			t.parent();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8217
			DOM.add(id + '_action', 'div', {id : id + '_preview', 'class' : 'mceColorPreview'});
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8218
			DOM.setStyle(t.id + '_preview', 'backgroundColor', t.value);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8219
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8220
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8221
		destroy : function() {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8222
			this.parent();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8223
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8224
			Event.clear(this.id + '_menu');
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8225
			Event.clear(this.id + '_more');
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8226
			DOM.remove(this.id + '_menu');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8227
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8228
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8229
})(tinymce);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8230
tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8231
	renderHTML : function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8232
		var t = this, h = '', c, co, dom = tinymce.DOM, s = t.settings, i, pr, nx, cl;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8233
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8234
		cl = t.controls;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8235
		for (i=0; i<cl.length; i++) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8236
			// Get current control, prev control, next control and if the control is a list box or not
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8237
			co = cl[i];
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8238
			pr = cl[i - 1];
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8239
			nx = cl[i + 1];
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8240
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8241
			// Add toolbar start
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8242
			if (i === 0) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8243
				c = 'mceToolbarStart';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8244
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8245
				if (co.Button)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8246
					c += ' mceToolbarStartButton';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8247
				else if (co.SplitButton)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8248
					c += ' mceToolbarStartSplitButton';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8249
				else if (co.ListBox)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8250
					c += ' mceToolbarStartListBox';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8251
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8252
				h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->'));
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8253
			}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8254
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8255
			// Add toolbar end before list box and after the previous button
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8256
			// This is to fix the o2k7 editor skins
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8257
			if (pr && co.ListBox) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8258
				if (pr.Button || pr.SplitButton)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8259
					h += dom.createHTML('td', {'class' : 'mceToolbarEnd'}, dom.createHTML('span', null, '<!-- IE -->'));
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8260
			}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8261
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8262
			// Render control HTML
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8263
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8264
			// IE 8 quick fix, needed to propertly generate a hit area for anchors
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8265
			if (dom.stdMode)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8266
				h += '<td style="position: relative">' + co.renderHTML() + '</td>';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8267
			else
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8268
				h += '<td>' + co.renderHTML() + '</td>';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8269
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8270
			// Add toolbar start after list box and before the next button
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8271
			// This is to fix the o2k7 editor skins
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8272
			if (nx && co.ListBox) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8273
				if (nx.Button || nx.SplitButton)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8274
					h += dom.createHTML('td', {'class' : 'mceToolbarStart'}, dom.createHTML('span', null, '<!-- IE -->'));
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8275
			}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8276
		}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8277
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8278
		c = 'mceToolbarEnd';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8279
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8280
		if (co.Button)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8281
			c += ' mceToolbarEndButton';
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8282
		else if (co.SplitButton)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8283
			c += ' mceToolbarEndSplitButton';
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8284
		else if (co.ListBox)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8285
			c += ' mceToolbarEndListBox';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8286
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8287
		h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->'));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8288
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8289
		return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || ''}, '<tbody><tr>' + h + '</tr></tbody>');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8290
	}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8291
});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8292
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8293
	var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8294
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8295
	tinymce.create('tinymce.AddOnManager', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8296
		items : [],
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8297
		urls : {},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8298
		lookup : {},
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8299
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8300
		onAdd : new Dispatcher(this),
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8301
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8302
		get : function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8303
			return this.lookup[n];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8304
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8305
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8306
		requireLangPack : function(n) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8307
			var u, s = tinymce.EditorManager.settings;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8308
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8309
			if (s && s.language) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8310
				u = this.urls[n] + '/langs/' + s.language + '.js';
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8311
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8312
				if (!tinymce.dom.Event.domLoaded && !s.strict_mode)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8313
					tinymce.ScriptLoader.load(u);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8314
				else
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8315
					tinymce.ScriptLoader.add(u);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8316
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8317
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8318
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8319
		add : function(id, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8320
			this.items.push(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8321
			this.lookup[id] = o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8322
			this.onAdd.dispatch(this, id, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8323
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8324
			return o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8325
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8326
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8327
		load : function(n, u, cb, s) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8328
			var t = this;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8329
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8330
			if (t.urls[n])
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8331
				return;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8332
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8333
			if (u.indexOf('/') != 0 && u.indexOf('://') == -1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8334
				u = tinymce.baseURL + '/' +  u;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8335
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8336
			t.urls[n] = u.substring(0, u.lastIndexOf('/'));
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8337
			tinymce.ScriptLoader.add(u, cb, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8338
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8339
	});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8340
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8341
	// Create plugin and theme managers
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8342
	tinymce.PluginManager = new tinymce.AddOnManager();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8343
	tinymce.ThemeManager = new tinymce.AddOnManager();
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8344
}(tinymce));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8345
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8346
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8347
	// Shorten names
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8348
	var each = tinymce.each, extend = tinymce.extend, DOM = tinymce.DOM, Event = tinymce.dom.Event, ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, explode = tinymce.explode;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8349
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8350
	tinymce.create('static tinymce.EditorManager', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8351
		editors : {},
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8352
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8353
		i18n : {},
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8354
	
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8355
		activeEditor : null,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8356
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8357
		preInit : function() {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8358
			var t = this, lo = window.location;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8359
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8360
			// Setup some URLs where the editor API is located and where the document is
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8361
			tinymce.documentBaseURL = lo.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8362
			if (!/[\/\\]$/.test(tinymce.documentBaseURL))
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8363
				tinymce.documentBaseURL += '/';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8364
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8365
			tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8366
			tinymce.EditorManager.baseURI = new tinymce.util.URI(tinymce.baseURL);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8367
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8368
			// Add before unload listener
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8369
			// This was required since IE was leaking memory if you added and removed beforeunload listeners
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8370
			// with attachEvent/detatchEvent so this only adds one listener and instances can the attach to the onBeforeUnload event
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8371
			t.onBeforeUnload = new tinymce.util.Dispatcher(t);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8372
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8373
			// Must be on window or IE will leak if the editor is placed in frame or iframe
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8374
			Event.add(window, 'beforeunload', function(e) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8375
				t.onBeforeUnload.dispatch(t, e);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8376
			});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8377
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8378
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8379
		init : function(s) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8380
			var t = this, pl, sl = tinymce.ScriptLoader, c, e, el = [], ed;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8381
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8382
			function execCallback(se, n, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8383
				var f = se[n];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8384
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8385
				if (!f)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8386
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8387
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8388
				if (tinymce.is(f, 'string')) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8389
					s = f.replace(/\.\w+$/, '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8390
					s = s ? tinymce.resolve(s) : 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8391
					f = tinymce.resolve(f);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8392
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8393
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8394
				return f.apply(s || this, Array.prototype.slice.call(arguments, 2));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8395
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8396
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8397
			s = extend({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8398
				theme : "simple",
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8399
				language : "en",
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8400
				strict_loading_mode : document.contentType == 'application/xhtml+xml'
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8401
			}, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8402
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8403
			t.settings = s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8404
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8405
			// If page not loaded and strict mode isn't enabled then load them
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8406
			if (!Event.domLoaded && !s.strict_loading_mode) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8407
				// Load language
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8408
				if (s.language)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8409
					sl.add(tinymce.baseURL + '/langs/' + s.language + '.js');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8410
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8411
				// Load theme
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8412
				if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme])
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8413
					ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8414
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8415
				// Load plugins
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8416
				if (s.plugins) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8417
					pl = explode(s.plugins);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8418
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8419
					// Load rest if plugins
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8420
					each(pl, function(v) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8421
						if (v && v.charAt(0) != '-' && !PluginManager.urls[v]) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8422
							// Skip safari plugin for other browsers
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8423
							if (!tinymce.isWebKit && v == 'safari')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8424
								return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8425
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8426
							PluginManager.load(v, 'plugins/' + v + '/editor_plugin' + tinymce.suffix + '.js');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8427
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8428
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8429
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8430
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8431
				sl.loadQueue();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8432
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8433
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8434
			// Legacy call
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8435
			Event.add(document, 'init', function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8436
				var l, co;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8437
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8438
				execCallback(s, 'onpageload');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8439
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8440
				// Verify that it's a valid browser
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8441
				if (s.browsers) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8442
					l = false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8443
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8444
					each(explode(s.browsers), function(v) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8445
						switch (v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8446
							case 'ie':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8447
							case 'msie':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8448
								if (tinymce.isIE)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8449
									l = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8450
								break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8451
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8452
							case 'gecko':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8453
								if (tinymce.isGecko)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8454
									l = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8455
								break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8456
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8457
							case 'safari':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8458
							case 'webkit':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8459
								if (tinymce.isWebKit)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8460
									l = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8461
								break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8462
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8463
							case 'opera':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8464
								if (tinymce.isOpera)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8465
									l = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8466
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8467
								break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8468
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8469
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8470
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8471
					// Not a valid one
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8472
					if (!l)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8473
						return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8474
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8475
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8476
				switch (s.mode) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8477
					case "exact":
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8478
						l = s.elements || '';
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8479
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8480
						if(l.length > 0) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8481
							each(explode(l), function(v) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8482
								if (DOM.get(v)) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8483
									ed = new tinymce.Editor(v, s);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8484
									el.push(ed);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8485
									ed.render(1);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8486
								} else {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8487
									c = 0;
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8488
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8489
									each(document.forms, function(f) {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8490
										each(f.elements, function(e) {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8491
											if (e.name === v) {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8492
												v = 'mce_editor_' + c;
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8493
												DOM.setAttrib(e, 'id', v);
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8494
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8495
												ed = new tinymce.Editor(v, s);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8496
												el.push(ed);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8497
												ed.render(1);
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8498
											}
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8499
										});
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8500
									});
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8501
								}
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8502
							});
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8503
						}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8504
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8505
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8506
					case "textareas":
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8507
					case "specific_textareas":
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8508
						function hasClass(n, c) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8509
							return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8510
						};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8511
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8512
						each(DOM.select('textarea'), function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8513
							if (s.editor_deselector && hasClass(v, s.editor_deselector))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8514
								return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8515
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8516
							if (!s.editor_selector || hasClass(v, s.editor_selector)) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8517
								// Can we use the name
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8518
								e = DOM.get(v.name);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8519
								if (!v.id && !e)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8520
									v.id = v.name;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8521
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8522
								// Generate unique name if missing or already exists
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8523
								if (!v.id || t.get(v.id))
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8524
									v.id = DOM.uniqueId();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8525
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8526
								ed = new tinymce.Editor(v.id, s);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8527
								el.push(ed);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8528
								ed.render(1);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8529
							}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8530
						});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8531
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8532
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8533
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8534
				// Call onInit when all editors are initialized
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8535
				if (s.oninit) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8536
					l = co = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8537
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8538
					each (el, function(ed) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8539
						co++;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8540
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8541
						if (!ed.initialized) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8542
							// Wait for it
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8543
							ed.onInit.add(function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8544
								l++;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8545
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8546
								// All done
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8547
								if (l == co)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8548
									execCallback(s, 'oninit');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8549
							});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8550
						} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8551
							l++;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8552
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8553
						// All done
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8554
						if (l == co)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8555
							execCallback(s, 'oninit');					
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8556
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8557
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8558
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8559
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8560
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8561
		get : function(id) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8562
			return this.editors[id];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8563
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8564
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8565
		getInstanceById : function(id) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8566
			return this.get(id);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8567
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8568
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8569
		add : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8570
			this.editors[e.id] = e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8571
			this._setActive(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8572
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8573
			return e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8574
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8575
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8576
		remove : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8577
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8578
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8579
			// Not in the collection
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8580
			if (!t.editors[e.id])
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8581
				return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8582
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8583
			delete t.editors[e.id];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8584
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8585
			// Select another editor since the active one was removed
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8586
			if (t.activeEditor == e) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8587
				t._setActive(null);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8588
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8589
				each(t.editors, function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8590
					t._setActive(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8591
					return false; // Break
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8592
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8593
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8594
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8595
			e.destroy();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8596
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8597
			return e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8598
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8599
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8600
		execCommand : function(c, u, v) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8601
			var t = this, ed = t.get(v), w;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8602
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8603
			// Manager commands
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8604
			switch (c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8605
				case "mceFocus":
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8606
					ed.focus();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8607
					return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8608
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8609
				case "mceAddEditor":
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8610
				case "mceAddControl":
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8611
					if (!t.get(v))
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8612
						new tinymce.Editor(v, t.settings).render();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8613
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8614
					return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8615
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8616
				case "mceAddFrameControl":
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8617
					w = v.window;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8618
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8619
					// Add tinyMCE global instance and tinymce namespace to specified window
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8620
					w.tinyMCE = tinyMCE;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8621
					w.tinymce = tinymce;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8622
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8623
					tinymce.DOM.doc = w.document;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8624
					tinymce.DOM.win = w;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8625
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8626
					ed = new tinymce.Editor(v.element_id, v);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8627
					ed.render();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8628
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8629
					// Fix IE memory leaks
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8630
					if (tinymce.isIE) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8631
						function clr() {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8632
							ed.destroy();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8633
							w.detachEvent('onunload', clr);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8634
							w = w.tinyMCE = w.tinymce = null; // IE leak
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8635
						};
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8636
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8637
						w.attachEvent('onunload', clr);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8638
					}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8639
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8640
					v.page_window = null;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8641
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8642
					return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8643
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8644
				case "mceRemoveEditor":
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8645
				case "mceRemoveControl":
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8646
					if (ed)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8647
						ed.remove();
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8648
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8649
					return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8650
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8651
				case 'mceToggleEditor':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8652
					if (!ed) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8653
						t.execCommand('mceAddControl', 0, v);
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  8654
						return true;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8655
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8656
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8657
					if (ed.isHidden())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8658
						ed.show();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8659
					else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8660
						ed.hide();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8661
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  8662
					return true;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8663
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8664
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8665
			// Run command on active editor
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8666
			if (t.activeEditor)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8667
				return t.activeEditor.execCommand(c, u, v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8668
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8669
			return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8670
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8671
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8672
		execInstanceCommand : function(id, c, u, v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8673
			var ed = this.get(id);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8674
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8675
			if (ed)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8676
				return ed.execCommand(c, u, v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8677
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8678
			return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8679
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8680
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8681
		triggerSave : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8682
			each(this.editors, function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8683
				e.save();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8684
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8685
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8686
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8687
		addI18n : function(p, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8688
			var lo, i18n = this.i18n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8689
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8690
			if (!tinymce.is(p, 'string')) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8691
				each(p, function(o, lc) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8692
					each(o, function(o, g) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8693
						each(o, function(o, k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8694
							if (g === 'common')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8695
								i18n[lc + '.' + k] = o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8696
							else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8697
								i18n[lc + '.' + g + '.' + k] = o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8698
						});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8699
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8700
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8701
			} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8702
				each(o, function(o, k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8703
					i18n[p + '.' + k] = o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8704
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8705
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8706
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8707
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8708
		// Private methods
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8709
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8710
		_setActive : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8711
			this.selectedInstance = this.activeEditor = e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8712
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8713
	});
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8714
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8715
	tinymce.EditorManager.preInit();
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8716
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8717
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8718
var tinyMCE = window.tinyMCE = tinymce.EditorManager;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8719
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8720
	var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, Dispatcher = tinymce.util.Dispatcher;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8721
	var each = tinymce.each, isGecko = tinymce.isGecko, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8722
	var is = tinymce.is, ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, EditorManager = tinymce.EditorManager;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8723
	var inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8724
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8725
	tinymce.create('tinymce.Editor', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8726
		Editor : function(id, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8727
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8728
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8729
			t.id = t.editorId = id;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8730
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8731
			t.execCommands = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8732
			t.queryStateCommands = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8733
			t.queryValueCommands = {};
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8734
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8735
			t.isNotDirty = false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8736
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8737
			t.plugins = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8738
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8739
			// Add events to the editor
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8740
			each([
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8741
				'onPreInit',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8742
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8743
				'onBeforeRenderUI',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8744
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8745
				'onPostRender',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8746
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8747
				'onInit',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8748
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8749
				'onRemove',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8750
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8751
				'onActivate',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8752
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8753
				'onDeactivate',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8754
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8755
				'onClick',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8756
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8757
				'onEvent',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8758
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8759
				'onMouseUp',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8760
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8761
				'onMouseDown',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8762
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8763
				'onDblClick',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8764
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8765
				'onKeyDown',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8766
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8767
				'onKeyUp',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8768
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8769
				'onKeyPress',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8770
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8771
				'onContextMenu',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8772
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8773
				'onSubmit',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8774
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8775
				'onReset',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8776
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8777
				'onPaste',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8778
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8779
				'onPreProcess',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8780
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8781
				'onPostProcess',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8782
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8783
				'onBeforeSetContent',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8784
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8785
				'onBeforeGetContent',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8786
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8787
				'onSetContent',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8788
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8789
				'onGetContent',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8790
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8791
				'onLoadContent',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8792
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8793
				'onSaveContent',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8794
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8795
				'onNodeChange',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8796
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8797
				'onChange',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8798
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8799
				'onBeforeExecCommand',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8800
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8801
				'onExecCommand',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8802
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8803
				'onUndo',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8804
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8805
				'onRedo',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8806
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8807
				'onVisualAid',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8808
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8809
				'onSetProgressState'
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8810
			], function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8811
				t[e] = new Dispatcher(t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8812
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8813
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8814
			t.settings = s = extend({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8815
				id : id,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8816
				language : 'en',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8817
				docs_language : 'en',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8818
				theme : 'simple',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8819
				skin : 'default',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8820
				delta_width : 0,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8821
				delta_height : 0,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8822
				popup_css : '',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8823
				plugins : '',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8824
				document_base_url : tinymce.documentBaseURL,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8825
				add_form_submit_trigger : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8826
				submit_patch : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8827
				add_unload_trigger : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8828
				convert_urls : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8829
				relative_urls : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8830
				remove_script_host : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8831
				table_inline_editing : 0,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8832
				object_resizing : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8833
				cleanup : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8834
				accessibility_focus : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8835
				custom_shortcuts : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8836
				custom_undo_redo_keyboard_shortcuts : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8837
				custom_undo_redo_restore_selection : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8838
				custom_undo_redo : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8839
				doctype : '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8840
				visual_table_class : 'mceItemTable',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8841
				visual : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8842
				inline_styles : true,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8843
				convert_fonts_to_spans : true,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8844
				font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8845
				apply_source_formatting : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8846
				directionality : 'ltr',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8847
				forced_root_block : 'p',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8848
				valid_elements : '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big',
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8849
				hidden_input : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8850
				padd_empty_editor : 1,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8851
				render_ui : 1,
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8852
				init_theme : 1,
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8853
				force_p_newlines : 1,
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  8854
				indentation : '30px',
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8855
				keep_styles : 1,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8856
				fix_table_elements : 1,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8857
				removeformat_selector : 'span,b,strong,em,i,font,u,strike'
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8858
			}, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8859
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8860
			t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8861
				base_uri : tinyMCE.baseURI
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8862
			});
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8863
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8864
			t.baseURI = EditorManager.baseURI;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8865
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8866
			// Call setup
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8867
			t.execCallback('setup', t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8868
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8869
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8870
		render : function(nst) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8871
			var t = this, s = t.settings, id = t.id, sl = tinymce.ScriptLoader;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8872
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8873
			// Page is not loaded yet, wait for it
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8874
			if (!Event.domLoaded) {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8875
				Event.add(document, 'init', function() {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8876
					t.render();
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8877
				});
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8878
				return;
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8879
			}
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8880
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8881
			// Force strict loading mode if render us called by user and not internally
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8882
			if (!nst) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8883
				s.strict_loading_mode = 1;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8884
				tinyMCE.settings = s;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8885
			}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8886
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8887
			// Element not found, then skip initialization
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8888
			if (!t.getElement())
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8889
				return;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8890
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8891
			if (s.strict_loading_mode) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8892
				sl.settings.strict_mode = s.strict_loading_mode;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8893
				tinymce.DOM.settings.strict = 1;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8894
			}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8895
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8896
			// Add hidden input for non input elements inside form elements
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8897
			if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form'))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8898
				DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8899
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8900
			if (tinymce.WindowManager)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8901
				t.windowManager = new tinymce.WindowManager(t);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8902
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8903
			if (s.encoding == 'xml') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8904
				t.onGetContent.add(function(ed, o) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  8905
					if (o.save)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8906
						o.content = DOM.encode(o.content);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8907
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8908
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8909
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8910
			if (s.add_form_submit_trigger) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8911
				t.onSubmit.addToTop(function() {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8912
					if (t.initialized) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8913
						t.save();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8914
						t.isNotDirty = 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8915
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8916
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8917
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8918
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8919
			if (s.add_unload_trigger) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8920
				t._beforeUnload = tinyMCE.onBeforeUnload.add(function() {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8921
					if (t.initialized && !t.destroyed && !t.isHidden())
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8922
						t.save({format : 'raw', no_events : true});
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8923
				});
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8924
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8925
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8926
			tinymce.addUnload(t.destroy, t);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8927
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8928
			if (s.submit_patch) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8929
				t.onBeforeRenderUI.add(function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8930
					var n = t.getElement().form;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8931
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8932
					if (!n)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8933
						return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8934
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8935
					// Already patched
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8936
					if (n._mceOldSubmit)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8937
						return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8938
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8939
					// Check page uses id="submit" or name="submit" for it's submit button
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8940
					if (!n.submit.nodeType && !n.submit.length) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8941
						t.formElement = n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8942
						n._mceOldSubmit = n.submit;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8943
						n.submit = function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8944
							// Save all instances
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8945
							EditorManager.triggerSave();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8946
							t.isNotDirty = 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8947
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8948
							return t.formElement._mceOldSubmit(t.formElement);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8949
						};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8950
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8951
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8952
					n = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8953
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8954
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8955
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8956
			// Load scripts
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8957
			function loadScripts() {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8958
				if (s.language)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8959
					sl.add(tinymce.baseURL + '/langs/' + s.language + '.js');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8960
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8961
				if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme])
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8962
					ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8963
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8964
				each(explode(s.plugins), function(p) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  8965
					if (p && p.charAt(0) != '-' && !PluginManager.urls[p]) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8966
						// Skip safari plugin for other browsers
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8967
						if (!isWebKit && p == 'safari')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8968
							return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8969
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8970
						PluginManager.load(p, 'plugins/' + p + '/editor_plugin' + tinymce.suffix + '.js');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8971
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8972
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8973
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8974
				// Init when que is loaded
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8975
				sl.loadQueue(function() {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8976
					if (!t.removed)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  8977
						t.init();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8978
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8979
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8980
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8981
			loadScripts();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8982
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8983
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8984
		init : function() {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  8985
			var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti, u, bi, bc, re;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8986
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8987
			EditorManager.add(t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8988
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8989
			if (s.theme) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8990
				s.theme = s.theme.replace(/-/, '');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8991
				o = ThemeManager.get(s.theme);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8992
				t.theme = new o();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8993
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8994
				if (t.theme.init && s.init_theme)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8995
					t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, ''));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  8996
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8997
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  8998
			// Create all plugins
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  8999
			each(explode(s.plugins.replace(/\-/g, '')), function(p) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9000
				var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9001
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9002
				if (c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9003
					po = new c(t, u);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9004
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9005
					t.plugins[p] = po;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9006
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9007
					if (po.init)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9008
						po.init(t, u);
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  9009
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9010
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9011
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9012
			// Setup popup CSS path(s)
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9013
			if (s.popup_css !== false) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9014
				if (s.popup_css)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9015
					s.popup_css = t.documentBaseURI.toAbsolute(s.popup_css);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9016
				else
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9017
					s.popup_css = t.baseURI.toAbsolute("themes/" + s.theme + "/skins/" + s.skin + "/dialog.css");
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9018
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9019
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9020
			if (s.popup_css_add)
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9021
				s.popup_css += ',' + t.documentBaseURI.toAbsolute(s.popup_css_add);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9022
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9023
			t.controlManager = new tinymce.ControlManager(t);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9024
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9025
			t.undoManager = new tinymce.UndoManager(t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9026
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9027
			// Pass through
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9028
			t.undoManager.onAdd.add(function(um, l) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9029
				if (!l.initial)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9030
					return t.onChange.dispatch(t, l, um);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9031
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9032
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9033
			t.undoManager.onUndo.add(function(um, l) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9034
				return t.onUndo.dispatch(t, l, um);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9035
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9036
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9037
			t.undoManager.onRedo.add(function(um, l) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9038
				return t.onRedo.dispatch(t, l, um);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9039
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9040
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9041
			if (s.custom_undo_redo) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9042
				t.onExecCommand.add(function(ed, cmd, ui, val, a) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9043
					if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9044
						t.undoManager.add();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9045
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9046
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9047
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9048
			t.onExecCommand.add(function(ed, c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9049
				// Don't refresh the select lists until caret move
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9050
				if (!/^(FontName|FontSize)$/.test(c))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9051
					t.nodeChanged();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9052
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9053
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9054
			// Remove ghost selections on images and tables in Gecko
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9055
			if (isGecko) {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9056
				function repaint(a, o) {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9057
					if (!o || !o.initial)
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9058
						t.execCommand('mceRepaint');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9059
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9060
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9061
				t.onUndo.add(repaint);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9062
				t.onRedo.add(repaint);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9063
				t.onSetContent.add(repaint);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9064
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9065
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9066
			// Enables users to override the control factory
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9067
			t.onBeforeRenderUI.dispatch(t, t.controlManager);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9068
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9069
			// Measure box
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9070
			if (s.render_ui) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9071
				w = s.width || e.style.width || e.offsetWidth;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9072
				h = s.height || e.style.height || e.offsetHeight;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9073
				t.orgDisplay = e.style.display;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9074
				re = /^[0-9\.]+(|px)$/i;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9075
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9076
				if (re.test('' + w))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9077
					w = Math.max(parseInt(w) + (o.deltaWidth || 0), 100);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9078
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9079
				if (re.test('' + h))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9080
					h = Math.max(parseInt(h) + (o.deltaHeight || 0), 100);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9081
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9082
				// Render UI
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9083
				o = t.theme.renderUI({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9084
					targetNode : e,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9085
					width : w,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9086
					height : h,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9087
					deltaWidth : s.delta_width,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9088
					deltaHeight : s.delta_height
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9089
				});
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9090
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9091
				t.editorContainer = o.editorContainer;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9092
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9093
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9094
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9095
			// User specified a document.domain value
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9096
			if (document.domain && location.hostname != document.domain)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9097
				tinymce.relaxedDomain = document.domain;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9098
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9099
			// Resize editor
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9100
			DOM.setStyles(o.sizeContainer || o.editorContainer, {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9101
				width : w,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9102
				height : h
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9103
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9104
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9105
			h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : '');
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9106
			if (h < 100)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9107
				h = 100;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9108
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9109
			t.iframeHTML = s.doctype + '<html><head xmlns="http://www.w3.org/1999/xhtml">';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9110
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9111
			// We only need to override paths if we have to
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9112
			// IE has a bug where it remove site absolute urls to relative ones if this is specified
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9113
			if (s.document_base_url != tinymce.documentBaseURL)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9114
				t.iframeHTML += '<base href="' + t.documentBaseURI.getURI() + '" />';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9115
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9116
			t.iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9117
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9118
			if (tinymce.relaxedDomain)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9119
				t.iframeHTML += '<script type="text/javascript">document.domain = "' + tinymce.relaxedDomain + '";</script>';
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9120
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9121
			bi = s.body_id || 'tinymce';
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9122
			if (bi.indexOf('=') != -1) {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9123
				bi = t.getParam('body_id', '', 'hash');
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9124
				bi = bi[t.id] || bi;
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9125
			}
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9126
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9127
			bc = s.body_class || '';
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9128
			if (bc.indexOf('=') != -1) {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9129
				bc = t.getParam('body_class', '', 'hash');
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9130
				bc = bc[t.id] || '';
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9131
			}
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9132
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9133
			t.iframeHTML += '</head><body id="' + bi + '" class="mceContentBody ' + bc + '"></body></html>';
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9134
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9135
			// Domain relaxing enabled, then set document domain
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9136
			if (tinymce.relaxedDomain) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9137
				// We need to write the contents here in IE since multiple writes messes up refresh button and back button
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9138
				if (isIE || (tinymce.isOpera && parseFloat(opera.version()) >= 9.5))
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9139
					u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9140
				else if (tinymce.isOpera)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9141
					u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";document.close();ed.setupIframe();})()';					
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9142
			}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9143
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9144
			// Create iframe
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9145
			n = DOM.add(o.iframeContainer, 'iframe', {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9146
				id : t.id + "_ifr",
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9147
				src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9148
				frameBorder : '0',
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9149
				style : {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9150
					width : '100%',
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9151
					height : h
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9152
				}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9153
			});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9154
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9155
			t.contentAreaContainer = o.iframeContainer;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9156
			DOM.get(o.editorContainer).style.display = t.orgDisplay;
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9157
			DOM.get(t.id).style.display = 'none';
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9158
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9159
			if (!isIE || !tinymce.relaxedDomain)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9160
				t.setupIframe();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9161
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9162
			e = n = o = null; // Cleanup
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9163
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9164
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9165
		setupIframe : function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9166
			var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b;
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9167
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9168
			// Setup iframe body
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9169
			if (!isIE || !tinymce.relaxedDomain) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9170
				d.open();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9171
				d.write(t.iframeHTML);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9172
				d.close();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9173
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9174
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9175
			// Design mode needs to be added here Ctrl+A will fail otherwise
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9176
			if (!isIE) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9177
				try {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9178
					if (!s.readonly)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9179
						d.designMode = 'On';
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9180
				} catch (ex) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9181
					// Will fail on Gecko if the editor is placed in an hidden container element
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9182
					// The design mode will be set ones the editor is focused
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9183
				}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9184
			}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9185
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9186
			// IE needs to use contentEditable or it will display non secure items for HTTPS
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9187
			if (isIE) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9188
				// It will not steal focus if we hide it while setting contentEditable
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9189
				b = t.getBody();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9190
				DOM.hide(b);
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9191
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9192
				if (!s.readonly)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9193
					b.contentEditable = true;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9194
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9195
				DOM.show(b);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9196
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9197
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9198
			t.dom = new tinymce.dom.DOMUtils(t.getDoc(), {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9199
				keep_values : true,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9200
				url_converter : t.convertURL,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9201
				url_converter_scope : t,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9202
				hex_colors : s.force_hex_style_colors,
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9203
				class_filter : s.class_filter,
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9204
				update_styles : 1,
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9205
				fix_ie_paragraphs : 1
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9206
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9207
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9208
			t.serializer = new tinymce.dom.Serializer(extend(s, {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9209
				valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9210
				dom : t.dom
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9211
			}));
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9212
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9213
			t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9214
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9215
			t.forceBlocks = new tinymce.ForceBlocks(t, {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9216
				forced_root_block : s.forced_root_block
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9217
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9218
			t.editorCommands = new tinymce.EditorCommands(t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9219
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9220
			// Pass through
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9221
			t.serializer.onPreProcess.add(function(se, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9222
				return t.onPreProcess.dispatch(t, o, se);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9223
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9224
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9225
			t.serializer.onPostProcess.add(function(se, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9226
				return t.onPostProcess.dispatch(t, o, se);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9227
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9228
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9229
			t.onPreInit.dispatch(t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9230
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9231
			if (!s.gecko_spellcheck)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9232
				t.getBody().spellcheck = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9233
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9234
			if (!s.readonly)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9235
				t._addEvents();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9236
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9237
			t.controlManager.onPostRender.dispatch(t, t.controlManager);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9238
			t.onPostRender.dispatch(t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9239
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9240
			if (s.directionality)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9241
				t.getBody().dir = s.directionality;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9242
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9243
			if (s.nowrap)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9244
				t.getBody().style.whiteSpace = "nowrap";
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9245
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9246
			if (s.custom_elements) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9247
				function handleCustom(ed, o) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9248
					each(explode(s.custom_elements), function(v) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9249
						var n;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9250
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9251
						if (v.indexOf('~') === 0) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9252
							v = v.substring(1);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9253
							n = 'span';
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9254
						} else
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9255
							n = 'div';
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9256
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9257
						o.content = o.content.replace(new RegExp('<(' + v + ')([^>]*)>', 'g'), '<' + n + ' mce_name="$1"$2>');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9258
						o.content = o.content.replace(new RegExp('</(' + v + ')>', 'g'), '</' + n + '>');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9259
					});
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9260
				};
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9261
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9262
				t.onBeforeSetContent.add(handleCustom);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9263
				t.onPostProcess.add(function(ed, o) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9264
					if (o.set)
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9265
						handleCustom(ed, o);
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9266
				});
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9267
			}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9268
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9269
			if (s.handle_node_change_callback) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9270
				t.onNodeChange.add(function(ed, cm, n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9271
					t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed());
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9272
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9273
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9274
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9275
			if (s.save_callback) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9276
				t.onSaveContent.add(function(ed, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9277
					var h = t.execCallback('save_callback', t.id, o.content, t.getBody());
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9278
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9279
					if (h)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9280
						o.content = h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9281
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9282
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9283
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9284
			if (s.onchange_callback) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9285
				t.onChange.add(function(ed, l) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9286
					t.execCallback('onchange_callback', t, l);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9287
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9288
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9289
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9290
			if (s.convert_newlines_to_brs) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9291
				t.onBeforeSetContent.add(function(ed, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9292
					if (o.initial)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9293
						o.content = o.content.replace(/\r?\n/g, '<br />');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9294
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9295
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9296
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9297
			if (s.fix_nesting && isIE) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9298
				t.onBeforeSetContent.add(function(ed, o) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9299
					o.content = t._fixNesting(o.content);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9300
				});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9301
			}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9302
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9303
			if (s.preformatted) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9304
				t.onPostProcess.add(function(ed, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9305
					o.content = o.content.replace(/^\s*<pre.*?>/, '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9306
					o.content = o.content.replace(/<\/pre>\s*$/, '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9307
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9308
					if (o.set)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9309
						o.content = '<pre class="mceItemHidden">' + o.content + '</pre>';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9310
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9311
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9312
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9313
			if (s.verify_css_classes) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9314
				t.serializer.attribValueFilter = function(n, v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9315
					var s, cl;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9316
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9317
					if (n == 'class') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9318
						// Build regexp for classes
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9319
						if (!t.classesRE) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9320
							cl = t.dom.getClasses();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9321
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9322
							if (cl.length > 0) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9323
								s = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9324
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9325
								each (cl, function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9326
									s += (s ? '|' : '') + o['class'];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9327
								});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9328
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9329
								t.classesRE = new RegExp('(' + s + ')', 'gi');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9330
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9331
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9332
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9333
						return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9334
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9336
					return v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9337
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9338
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9339
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9340
			if (s.convert_fonts_to_spans)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9341
				t._convertFonts();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9342
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9343
			if (s.inline_styles)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9344
				t._convertInlineElements();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9345
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9346
			if (s.cleanup_callback) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9347
				t.onBeforeSetContent.add(function(ed, o) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9348
					o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9349
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9350
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9351
				t.onPreProcess.add(function(ed, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9352
					if (o.set)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9353
						t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9354
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9355
					if (o.get)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9356
						t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9357
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9358
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9359
				t.onPostProcess.add(function(ed, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9360
					if (o.set)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9361
						o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9362
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9363
					if (o.get)						
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9364
						o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9365
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9366
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9367
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9368
			if (s.save_callback) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9369
				t.onGetContent.add(function(ed, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9370
					if (o.save)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9371
						o.content = t.execCallback('save_callback', t.id, o.content, t.getBody());
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9372
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9373
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9374
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9375
			if (s.handle_event_callback) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9376
				t.onEvent.add(function(ed, e, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9377
					if (t.execCallback('handle_event_callback', e, ed, o) === false)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9378
						Event.cancel(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9379
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9380
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9381
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9382
			// Add visual aids when new contents is added
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9383
			t.onSetContent.add(function() {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9384
				t.addVisual(t.getBody());
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9385
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9386
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9387
			// Remove empty contents
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9388
			if (s.padd_empty_editor) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9389
				t.onPostProcess.add(function(ed, o) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9390
					o.content = o.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/, '');
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9391
				});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9392
			}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9393
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9394
			if (isGecko) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9395
				// Fix gecko link bug, when a link is placed at the end of block elements there is
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9396
				// no way to move the caret behind the link. This fix adds a bogus br element after the link
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9397
				function fixLinks(ed, o) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9398
					each(ed.dom.select('a'), function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9399
						var pn = n.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9400
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9401
						if (ed.dom.isBlock(pn) && pn.lastChild === n)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9402
							ed.dom.add(pn, 'br', {'mce_bogus' : 1});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9403
					});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9404
				};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9405
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9406
				t.onExecCommand.add(function(ed, cmd) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9407
					if (cmd === 'CreateLink')
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9408
						fixLinks(ed);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9409
				});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9410
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9411
				t.onSetContent.add(t.selection.onSetContent.add(fixLinks));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9412
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9413
				if (!s.readonly) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9414
					try {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9415
						// Design mode must be set here once again to fix a bug where
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9416
						// Ctrl+A/Delete/Backspace didn't work if the editor was added using mceAddControl then removed then added again
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9417
						d.designMode = 'Off';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9418
						d.designMode = 'On';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9419
					} catch (ex) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9420
						// Will fail on Gecko if the editor is placed in an hidden container element
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9421
						// The design mode will be set ones the editor is focused
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9422
					}
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9423
				}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9424
			}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9425
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9426
			// A small timeout was needed since firefox will remove. Bug: #1838304
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9427
			setTimeout(function () {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9428
				if (t.removed)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9429
					return;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9430
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9431
				t.load({initial : true, format : (s.cleanup_on_startup ? 'html' : 'raw')});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9432
				t.startContent = t.getContent({format : 'raw'});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9433
				t.undoManager.add({initial : true});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9434
				t.initialized = true;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9435
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9436
				t.onInit.dispatch(t);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9437
				t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc());
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9438
				t.execCallback('init_instance_callback', t);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9439
				t.focus(true);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9440
				t.nodeChanged({initial : 1});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9441
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9442
				// Load specified content CSS last
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9443
				if (s.content_css) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9444
					tinymce.each(explode(s.content_css), function(u) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9445
						t.dom.loadCSS(t.documentBaseURI.toAbsolute(u));
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9446
					});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9447
				}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9448
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9449
				// Handle auto focus
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9450
				if (s.auto_focus) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9451
					setTimeout(function () {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9452
						var ed = EditorManager.get(s.auto_focus);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9453
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9454
						ed.selection.select(ed.getBody(), 1);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9455
						ed.selection.collapse(1);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9456
						ed.getWin().focus();
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9457
					}, 100);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9458
				}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9459
			}, 1);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9460
	
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9461
			e = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9462
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9463
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9464
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9465
		focus : function(sf) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9466
			var oed, t = this, ce = t.settings.content_editable;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9467
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9468
			if (!sf) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9469
				// Is not content editable or the selection is outside the area in IE
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9470
				// the IE statement is needed to avoid bluring if element selections inside layers since
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9471
				// the layer is like it's own document in IE
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9472
				if (!ce && (!isIE || t.selection.getNode().ownerDocument != t.getDoc()))
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9473
					t.getWin().focus();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9474
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9475
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9476
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9477
			if (EditorManager.activeEditor != t) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9478
				if ((oed = EditorManager.activeEditor) != null)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9479
					oed.onDeactivate.dispatch(oed, t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9480
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9481
				t.onActivate.dispatch(t, oed);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9482
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9483
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9484
			EditorManager._setActive(t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9485
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9486
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9487
		execCallback : function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9488
			var t = this, f = t.settings[n], s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9489
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9490
			if (!f)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9491
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9492
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9493
			// Look through lookup
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9494
			if (t.callbackLookup && (s = t.callbackLookup[n])) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9495
				f = s.func;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9496
				s = s.scope;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9497
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9498
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9499
			if (is(f, 'string')) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9500
				s = f.replace(/\.\w+$/, '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9501
				s = s ? tinymce.resolve(s) : 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9502
				f = tinymce.resolve(f);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9503
				t.callbackLookup = t.callbackLookup || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9504
				t.callbackLookup[n] = {func : f, scope : s};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9505
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9506
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9507
			return f.apply(s || t, Array.prototype.slice.call(arguments, 1));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9508
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9509
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9510
		translate : function(s) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9511
			var c = this.settings.language || 'en', i18n = EditorManager.i18n;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9512
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9513
			if (!s)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9514
				return '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9515
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9516
			return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9517
				return i18n[c + '.' + b] || '{#' + b + '}';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9518
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9519
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9520
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9521
		getLang : function(n, dv) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9522
			return EditorManager.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9523
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9524
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9525
		getParam : function(n, dv, ty) {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9526
			var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o;
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9527
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9528
			if (ty === 'hash') {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9529
				o = {};
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9530
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9531
				if (is(v, 'string')) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9532
					each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9533
						v = v.split('=');
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9534
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9535
						if (v.length > 1)
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9536
							o[tr(v[0])] = tr(v[1]);
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9537
						else
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9538
							o[tr(v[0])] = tr(v);
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9539
					});
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9540
				} else
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9541
					o = v;
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9542
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9543
				return o;
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9544
			}
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9545
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9546
			return v;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9547
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9548
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9549
		nodeChanged : function(o) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9550
			var t = this, s = t.selection, n = s.getNode() || t.getBody();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9551
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9552
			// Fix for bug #1896577 it seems that this can not be fired while the editor is loading
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9553
			if (t.initialized) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9554
				t.onNodeChange.dispatch(
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9555
					t,
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9556
					o ? o.controlManager || t.controlManager : t.controlManager,
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9557
					isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n, // Fix for IE initial state
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9558
					s.isCollapsed(),
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9559
					o
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9560
				);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9561
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9562
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9563
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9564
		addButton : function(n, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9565
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9566
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9567
			t.buttons = t.buttons || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9568
			t.buttons[n] = s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9569
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9570
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9571
		addCommand : function(n, f, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9572
			this.execCommands[n] = {func : f, scope : s || this};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9573
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9574
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9575
		addQueryStateHandler : function(n, f, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9576
			this.queryStateCommands[n] = {func : f, scope : s || this};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9577
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9578
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9579
		addQueryValueHandler : function(n, f, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9580
			this.queryValueCommands[n] = {func : f, scope : s || this};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9581
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9582
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9583
		addShortcut : function(pa, desc, cmd_func, sc) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9584
			var t = this, c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9585
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9586
			if (!t.settings.custom_shortcuts)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9587
				return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9588
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9589
			t.shortcuts = t.shortcuts || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9590
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9591
			if (is(cmd_func, 'string')) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9592
				c = cmd_func;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9593
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9594
				cmd_func = function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9595
					t.execCommand(c, false, null);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9596
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9597
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9598
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9599
			if (is(cmd_func, 'object')) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9600
				c = cmd_func;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9601
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9602
				cmd_func = function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9603
					t.execCommand(c[0], c[1], c[2]);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9604
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9605
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9606
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9607
			each(explode(pa), function(pa) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9608
				var o = {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9609
					func : cmd_func,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9610
					scope : sc || this,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9611
					desc : desc,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9612
					alt : false,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9613
					ctrl : false,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9614
					shift : false
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9615
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9616
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9617
				each(explode(pa, '+'), function(v) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9618
					switch (v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9619
						case 'alt':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9620
						case 'ctrl':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9621
						case 'shift':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9622
							o[v] = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9623
							break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9624
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9625
						default:
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9626
							o.charCode = v.charCodeAt(0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9627
							o.keyCode = v.toUpperCase().charCodeAt(0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9628
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9629
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9630
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9631
				t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9632
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9633
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  9634
			return true;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9635
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9636
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9637
		execCommand : function(cmd, ui, val, a) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9638
			var t = this, s = 0, o, st;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9639
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9640
			if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9641
				t.focus();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9642
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9643
			o = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9644
			t.onBeforeExecCommand.dispatch(t, cmd, ui, val, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9645
			if (o.terminate)
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  9646
				return false;
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
  9647
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9648
			// Command callback
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9649
			if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9650
				t.onExecCommand.dispatch(t, cmd, ui, val, a);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9651
				return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9652
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9653
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9654
			// Registred commands
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9655
			if (o = t.execCommands[cmd]) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9656
				st = o.func.call(o.scope, ui, val);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9657
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9658
				// Fall through on true
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9659
				if (st !== true) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9660
					t.onExecCommand.dispatch(t, cmd, ui, val, a);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9661
					return st;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9662
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9663
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9664
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9665
			// Plugin commands
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9666
			each(t.plugins, function(p) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9667
				if (p.execCommand && p.execCommand(cmd, ui, val)) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9668
					t.onExecCommand.dispatch(t, cmd, ui, val, a);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9669
					s = 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9670
					return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9671
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9672
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9673
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9674
			if (s)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9675
				return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9676
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9677
			// Theme commands
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9678
			if (t.theme && t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9679
				t.onExecCommand.dispatch(t, cmd, ui, val, a);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9680
				return true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9681
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9682
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9683
			// Execute global commands
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9684
			if (tinymce.GlobalCommands.execCommand(t, cmd, ui, val)) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9685
				t.onExecCommand.dispatch(t, cmd, ui, val, a);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9686
				return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9687
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9688
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9689
			// Editor commands
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9690
			if (t.editorCommands.execCommand(cmd, ui, val)) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9691
				t.onExecCommand.dispatch(t, cmd, ui, val, a);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9692
				return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9693
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9694
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9695
			// Browser commands
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9696
			t.getDoc().execCommand(cmd, ui, val);
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9697
			t.onExecCommand.dispatch(t, cmd, ui, val, a);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9698
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9699
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9700
		queryCommandState : function(c) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9701
			var t = this, o, s;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9702
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9703
			// Is hidden then return undefined
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9704
			if (t._isHidden())
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9705
				return;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9706
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9707
			// Registred commands
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9708
			if (o = t.queryStateCommands[c]) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9709
				s = o.func.call(o.scope);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9710
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9711
				// Fall though on true
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9712
				if (s !== true)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9713
					return s;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9714
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9715
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9716
			// Registred commands
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9717
			o = t.editorCommands.queryCommandState(c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9718
			if (o !== -1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9719
				return o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9720
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9721
			// Browser commands
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9722
			try {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9723
				return this.getDoc().queryCommandState(c);
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9724
			} catch (ex) {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9725
				// Fails sometimes see bug: 1896577
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9726
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9727
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9728
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9729
		queryCommandValue : function(c) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9730
			var t = this, o, s;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9731
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9732
			// Is hidden then return undefined
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9733
			if (t._isHidden())
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9734
				return;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9735
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9736
			// Registred commands
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9737
			if (o = t.queryValueCommands[c]) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9738
				s = o.func.call(o.scope);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9739
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9740
				// Fall though on true
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9741
				if (s !== true)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9742
					return s;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
  9743
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9744
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9745
			// Registred commands
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9746
			o = t.editorCommands.queryCommandValue(c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9747
			if (is(o))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9748
				return o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9749
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9750
			// Browser commands
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9751
			try {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9752
				return this.getDoc().queryCommandValue(c);
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9753
			} catch (ex) {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9754
				// Fails sometimes see bug: 1896577
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9755
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9756
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9757
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9758
		show : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9759
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9760
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9761
			DOM.show(t.getContainer());
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9762
			DOM.hide(t.id);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9763
			t.load();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9764
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9765
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9766
		hide : function() {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9767
			var t = this, d = t.getDoc();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9768
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9769
			// Fixed bug where IE has a blinking cursor left from the editor
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9770
			if (isIE && d)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9771
				d.execCommand('SelectAll');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9772
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9773
			// We must save before we hide so Safari doesn't crash
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9774
			t.save();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9775
			DOM.hide(t.getContainer());
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9776
			DOM.setStyle(t.id, 'display', t.orgDisplay);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9777
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9778
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9779
		isHidden : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9780
			return !DOM.isHidden(this.id);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9781
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9782
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9783
		setProgressState : function(b, ti, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9784
			this.onSetProgressState.dispatch(this, b, ti, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9785
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9786
			return b;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9787
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9788
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9789
		load : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9790
			var t = this, e = t.getElement(), h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9791
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9792
			if (e) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9793
				o = o || {};
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9794
				o.load = true;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9795
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
  9796
				// Double encode existing entities in the value
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9797
				h = t.setContent(is(e.value) ? e.value : e.innerHTML, o);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9798
				o.element = e;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9799
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9800
				if (!o.no_events)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9801
					t.onLoadContent.dispatch(t, o);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9802
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9803
				o.element = e = null;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9804
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9805
				return h;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9806
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9807
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9808
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9809
		save : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9810
			var t = this, e = t.getElement(), h, f;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9811
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
  9812
			if (!e || !t.initialized)
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9813
				return;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9814
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9815
			o = o || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9816
			o.save = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9817
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9818
			// Add undo level will trigger onchange event
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9819
			if (!o.no_events) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9820
				t.undoManager.typing = 0;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9821
				t.undoManager.add();
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9822
			}
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9823
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9824
			o.element = e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9825
			h = o.content = t.getContent(o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9826
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9827
			if (!o.no_events)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9828
				t.onSaveContent.dispatch(t, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9829
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9830
			h = o.content;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9831
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9832
			if (!/TEXTAREA|INPUT/i.test(e.nodeName)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9833
				e.innerHTML = h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9834
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9835
				// Update hidden form element
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9836
				if (f = DOM.getParent(t.id, 'form')) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9837
					each(f.elements, function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9838
						if (e.name == t.id) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9839
							e.value = h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9840
							return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9841
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9842
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9843
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9844
			} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9845
				e.value = h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9846
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9847
			o.element = e = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9848
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9849
			return h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9850
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9851
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9852
		setContent : function(h, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9853
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9854
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9855
			o = o || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9856
			o.format = o.format || 'html';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9857
			o.set = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9858
			o.content = h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9859
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9860
			if (!o.no_events)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9861
				t.onBeforeSetContent.dispatch(t, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9862
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9863
			// Padd empty content in Gecko and Safari. Commands will otherwise fail on the content
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9864
			// It will also be impossible to place the caret in the editor unless there is a BR element present
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9865
			if (!tinymce.isIE && (h.length === 0 || /^\s+$/.test(h))) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9866
				o.content = t.dom.setHTML(t.getBody(), '<br mce_bogus="1" />');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9867
				o.format = 'raw';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9868
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9869
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9870
			o.content = t.dom.setHTML(t.getBody(), tinymce.trim(o.content));
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9871
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9872
			if (o.format != 'raw' && t.settings.cleanup) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9873
				o.getInner = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9874
				o.content = t.dom.setHTML(t.getBody(), t.serializer.serialize(t.getBody(), o));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9875
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9876
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9877
			if (!o.no_events)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9878
				t.onSetContent.dispatch(t, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9879
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9880
			return o.content;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9881
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9882
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9883
		getContent : function(o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9884
			var t = this, h;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9885
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9886
			o = o || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9887
			o.format = o.format || 'html';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9888
			o.get = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9889
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9890
			if (!o.no_events)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9891
				t.onBeforeGetContent.dispatch(t, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9892
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9893
			if (o.format != 'raw' && t.settings.cleanup) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9894
				o.getInner = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9895
				h = t.serializer.serialize(t.getBody(), o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9896
			} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9897
				h = t.getBody().innerHTML;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9898
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9899
			h = h.replace(/^\s*|\s*$/g, '');
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9900
			o.content = h;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9901
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9902
			if (!o.no_events)
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
  9903
				t.onGetContent.dispatch(t, o);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9904
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9905
			return o.content;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9906
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9907
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9908
		isDirty : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9909
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9910
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9911
			return tinymce.trim(t.startContent) != tinymce.trim(t.getContent({format : 'raw', no_events : 1})) && !t.isNotDirty;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9912
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9913
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9914
		getContainer : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9915
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9916
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9917
			if (!t.container)
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9918
				t.container = DOM.get(t.editorContainer || t.id + '_parent');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9919
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9920
			return t.container;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9921
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9922
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9923
		getContentAreaContainer : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9924
			return this.contentAreaContainer;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9925
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9926
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9927
		getElement : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9928
			return DOM.get(this.settings.content_element || this.id);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9929
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9930
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9931
		getWin : function() {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9932
			var t = this, e;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9933
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9934
			if (!t.contentWindow) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9935
				e = DOM.get(t.id + "_ifr");
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9936
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9937
				if (e)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9938
					t.contentWindow = e.contentWindow;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9939
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9940
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9941
			return t.contentWindow;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9942
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9943
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9944
		getDoc : function() {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9945
			var t = this, w;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9946
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9947
			if (!t.contentDocument) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
  9948
				w = t.getWin();
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9949
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9950
				if (w)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9951
					t.contentDocument = w.document;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
  9952
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9953
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9954
			return t.contentDocument;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9955
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9956
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9957
		getBody : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9958
			return this.bodyElement || this.getDoc().body;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9959
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9960
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9961
		convertURL : function(u, n, e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9962
			var t = this, s = t.settings;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9963
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9964
			// Use callback instead
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9965
			if (s.urlconverter_callback)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9966
				return t.execCallback('urlconverter_callback', u, e, true, n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9967
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9968
			// Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
  9969
			if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9970
				return u;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9971
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9972
			// Convert to relative
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9973
			if (s.relative_urls)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9974
				return t.documentBaseURI.toRelative(u);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9975
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9976
			// Convert to absolute
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9977
			u = t.documentBaseURI.toAbsolute(u, s.remove_script_host);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9978
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9979
			return u;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9980
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9981
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9982
		addVisual : function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9983
			var t = this, s = t.settings;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9984
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9985
			e = e || t.getBody();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9986
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9987
			if (!is(t.hasVisual))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9988
				t.hasVisual = s.visual;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9989
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9990
			each(t.dom.select('table,a', e), function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9991
				var v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9992
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9993
				switch (e.nodeName) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9994
					case 'TABLE':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9995
						v = t.dom.getAttrib(e, 'border');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9996
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9997
						if (!v || v == '0') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9998
							if (t.hasVisual)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
  9999
								t.dom.addClass(e, s.visual_table_class);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10000
							else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10001
								t.dom.removeClass(e, s.visual_table_class);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10002
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10003
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10004
						return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10005
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10006
					case 'A':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10007
						v = t.dom.getAttrib(e, 'name');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10008
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10009
						if (v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10010
							if (t.hasVisual)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10011
								t.dom.addClass(e, 'mceItemAnchor');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10012
							else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10013
								t.dom.removeClass(e, 'mceItemAnchor');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10014
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10015
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10016
						return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10017
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10018
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10019
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10020
			t.onVisualAid.dispatch(t, e, t.hasVisual);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10021
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10022
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10023
		remove : function() {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10024
			var t = this, e = t.getContainer();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10025
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10026
			t.removed = 1; // Cancels post remove event execution
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10027
			t.hide();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10028
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10029
			t.execCallback('remove_instance_callback', t);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10030
			t.onRemove.dispatch(t);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10031
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10032
			// Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10033
			t.onExecCommand.listeners = [];
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10034
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10035
			EditorManager.remove(t);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10036
			DOM.remove(e);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10037
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10038
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10039
		destroy : function(s) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10040
			var t = this;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10041
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10042
			// One time is enough
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10043
			if (t.destroyed)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10044
				return;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10045
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10046
			if (!s) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10047
				tinymce.removeUnload(t.destroy);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10048
				tinyMCE.onBeforeUnload.remove(t._beforeUnload);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10049
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10050
				// Manual destroy
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10051
				if (t.theme && t.theme.destroy)
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10052
					t.theme.destroy();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10053
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10054
				// Destroy controls, selection and dom
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10055
				t.controlManager.destroy();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10056
				t.selection.destroy();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10057
				t.dom.destroy();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10058
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10059
				// Remove all events
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10060
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10061
				// Don't clear the window or document if content editable
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10062
				// is enabled since other instances might still be present
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10063
				if (!t.settings.content_editable) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10064
					Event.clear(t.getWin());
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10065
					Event.clear(t.getDoc());
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10066
				}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10067
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10068
				Event.clear(t.getBody());
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10069
				Event.clear(t.formElement);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10070
			}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10071
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10072
			if (t.formElement) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10073
				t.formElement.submit = t.formElement._mceOldSubmit;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10074
				t.formElement._mceOldSubmit = null;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10075
			}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10076
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10077
			t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10078
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10079
			if (t.selection)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10080
				t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10081
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10082
			t.destroyed = 1;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10083
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10084
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10085
		// Internal functions
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10086
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10087
		_addEvents : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10088
			// 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10089
			var t = this, i, s = t.settings, lo = {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10090
				mouseup : 'onMouseUp',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10091
				mousedown : 'onMouseDown',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10092
				click : 'onClick',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10093
				keyup : 'onKeyUp',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10094
				keydown : 'onKeyDown',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10095
				keypress : 'onKeyPress',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10096
				submit : 'onSubmit',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10097
				reset : 'onReset',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10098
				contextmenu : 'onContextMenu',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10099
				dblclick : 'onDblClick',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10100
				paste : 'onPaste' // Doesn't work in all browsers yet
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10101
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10102
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10103
			function eventHandler(e, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10104
				var ty = e.type;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10105
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10106
				// Don't fire events when it's removed
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10107
				if (t.removed)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10108
					return;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10109
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10110
				// Generic event handler
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10111
				if (t.onEvent.dispatch(t, e, o) !== false) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10112
					// Specific event handler
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10113
					t[lo[e.fakeType || e.type]].dispatch(t, e, o);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10114
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10115
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10116
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10117
			// Add DOM events
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10118
			each(lo, function(v, k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10119
				switch (k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10120
					case 'contextmenu':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10121
						if (tinymce.isOpera) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10122
							// Fake contextmenu on Opera
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10123
							t.dom.bind(t.getBody(), 'mousedown', function(e) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10124
								if (e.ctrlKey) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10125
									e.fakeType = 'contextmenu';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10126
									eventHandler(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10127
								}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10128
							});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10129
						} else
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10130
							t.dom.bind(t.getBody(), k, eventHandler);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10131
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10132
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10133
					case 'paste':
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10134
						t.dom.bind(t.getBody(), k, function(e) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10135
							eventHandler(e);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10136
						});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10137
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10138
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10139
					case 'submit':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10140
					case 'reset':
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10141
						t.dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10142
						break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10143
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10144
					default:
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10145
						t.dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10146
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10147
			});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10148
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10149
			t.dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10150
				t.focus(true);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10151
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10152
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10153
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10154
			// Fixes bug where a specified document_base_uri could result in broken images
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10155
			// This will also fix drag drop of images in Gecko
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10156
			if (tinymce.isGecko) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10157
				// Convert all images to absolute URLs
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10158
/*				t.onSetContent.add(function(ed, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10159
					each(ed.dom.select('img'), function(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10160
						var v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10161
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10162
						if (v = e.getAttribute('mce_src'))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10163
							e.src = t.documentBaseURI.toAbsolute(v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10164
					})
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10165
				});*/
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10166
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10167
				t.dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10168
					var v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10169
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10170
					e = e.target;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10171
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10172
					if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('mce_src')))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10173
						e.src = t.documentBaseURI.toAbsolute(v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10174
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10175
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10176
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10177
			// Set various midas options in Gecko
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10178
			if (isGecko) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10179
				function setOpts() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10180
					var t = this, d = t.getDoc(), s = t.settings;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10181
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10182
					if (isGecko && !s.readonly) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10183
						if (t._isHidden()) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10184
							try {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10185
								if (!s.content_editable)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10186
									d.designMode = 'On';
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10187
							} catch (ex) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10188
								// Fails if it's hidden
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10189
							}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10190
						}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10191
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10192
						try {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10193
							// Try new Gecko method
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10194
							d.execCommand("styleWithCSS", 0, false);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10195
						} catch (ex) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10196
							// Use old method
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10197
							if (!t._isHidden())
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 10198
								try {d.execCommand("useCSS", 0, true);} catch (ex) {}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10199
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10200
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10201
						if (!s.table_inline_editing)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10202
							try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10203
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10204
						if (!s.object_resizing)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10205
							try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10206
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10207
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10208
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10209
				t.onBeforeExecCommand.add(setOpts);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10210
				t.onMouseDown.add(setOpts);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10211
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10212
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10213
			// Add node change handlers
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10214
			t.onMouseUp.add(t.nodeChanged);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10215
			t.onClick.add(t.nodeChanged);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10216
			t.onKeyUp.add(function(ed, e) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10217
				var c = e.keyCode;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10218
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10219
				if ((c >= 33 && c <= 36) || (c >= 37 && c <= 40) || c == 13 || c == 45 || c == 46 || c == 8 || (tinymce.isMac && (c == 91 || c == 93)) || e.ctrlKey)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10220
					t.nodeChanged();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10221
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10222
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10223
			// Add reset handler
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10224
			t.onReset.add(function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10225
				t.setContent(t.startContent, {format : 'raw'});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10226
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10227
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10228
			// Add shortcuts
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10229
			if (s.custom_shortcuts) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10230
				if (s.custom_undo_redo_keyboard_shortcuts) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10231
					t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10232
					t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10233
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10234
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10235
				// Add default shortcuts for gecko
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10236
				if (isGecko) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10237
					t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10238
					t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10239
					t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10240
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10241
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10242
				// BlockFormat shortcuts keys
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10243
				for (i=1; i<=6; i++)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10244
					t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, '<h' + i + '>']);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10245
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10246
				t.addShortcut('ctrl+7', '', ['FormatBlock', false, '<p>']);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10247
				t.addShortcut('ctrl+8', '', ['FormatBlock', false, '<div>']);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10248
				t.addShortcut('ctrl+9', '', ['FormatBlock', false, '<address>']);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10249
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10250
				function find(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10251
					var v = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10252
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10253
					if (!e.altKey && !e.ctrlKey && !e.metaKey)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10254
						return v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10255
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10256
					each(t.shortcuts, function(o) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10257
						if (tinymce.isMac && o.ctrl != e.metaKey)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10258
							return;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10259
						else if (!tinymce.isMac && o.ctrl != e.ctrlKey)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10260
							return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10261
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10262
						if (o.alt != e.altKey)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10263
							return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10264
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10265
						if (o.shift != e.shiftKey)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10266
							return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10267
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10268
						if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10269
							v = o;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10270
							return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10271
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10272
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10273
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10274
					return v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10275
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10276
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10277
				t.onKeyUp.add(function(ed, e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10278
					var o = find(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10279
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10280
					if (o)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10281
						return Event.cancel(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10282
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10283
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10284
				t.onKeyPress.add(function(ed, e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10285
					var o = find(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10286
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10287
					if (o)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10288
						return Event.cancel(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10289
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10290
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10291
				t.onKeyDown.add(function(ed, e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10292
					var o = find(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10293
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10294
					if (o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10295
						o.func.call(o.scope);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10296
						return Event.cancel(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10297
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10298
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10299
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10300
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10301
			if (tinymce.isIE) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10302
				// Fix so resize will only update the width and height attributes not the styles of an image
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10303
				// It will also block mceItemNoResize items
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10304
				t.dom.bind(t.getDoc(), 'controlselect', function(e) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10305
					var re = t.resizeInfo, cb;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10306
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10307
					e = e.target;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10308
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10309
					// Don't do this action for non image elements
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10310
					if (e.nodeName !== 'IMG')
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10311
						return;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10312
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10313
					if (re)
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10314
						t.dom.unbind(re.node, re.ev, re.cb);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10315
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10316
					if (!t.dom.hasClass(e, 'mceItemNoResize')) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10317
						ev = 'resizeend';
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10318
						cb = t.dom.bind(e, ev, function(e) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10319
							var v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10320
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10321
							e = e.target;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10322
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10323
							if (v = t.dom.getStyle(e, 'width')) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10324
								t.dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, ''));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10325
								t.dom.setStyle(e, 'width', '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10326
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10327
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10328
							if (v = t.dom.getStyle(e, 'height')) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10329
								t.dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, ''));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10330
								t.dom.setStyle(e, 'height', '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10331
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10332
						});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10333
					} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10334
						ev = 'resizestart';
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10335
						cb = t.dom.bind(e, 'resizestart', Event.cancel, Event);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10336
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10337
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10338
					re = t.resizeInfo = {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10339
						node : e,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10340
						ev : ev,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10341
						cb : cb
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10342
					};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10343
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10344
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10345
				t.onKeyDown.add(function(ed, e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10346
					switch (e.keyCode) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10347
						case 8:
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10348
							// Fix IE control + backspace browser bug
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10349
							if (t.selection.getRng().item) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10350
								t.selection.getRng().item(0).removeNode();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10351
								return Event.cancel(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10352
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10353
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10354
				});
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10355
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10356
				/*if (t.dom.boxModel) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10357
					t.getBody().style.height = '100%';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10358
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10359
					Event.add(t.getWin(), 'resize', function(e) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10360
						var docElm = t.getDoc().documentElement;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10361
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10362
						docElm.style.height = (docElm.offsetHeight - 10) + 'px';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10363
					});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10364
				}*/
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10365
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10366
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10367
			if (tinymce.isOpera) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10368
				t.onClick.add(function(ed, e) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10369
					Event.prevent(e);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10370
				});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10371
			}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10372
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10373
			// Add custom undo/redo handlers
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10374
			if (s.custom_undo_redo) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10375
				function addUndo() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10376
					t.undoManager.typing = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10377
					t.undoManager.add();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10378
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10379
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10380
				// Add undo level on editor blur
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10381
				if (tinymce.isIE) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10382
					t.dom.bind(t.getWin(), 'blur', function(e) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10383
						var n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10384
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10385
						// Check added for fullscreen bug
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10386
						if (t.selection) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10387
							n = t.selection.getNode();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10388
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10389
							// Add undo level is selection was lost to another document
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10390
							if (!t.removed && n.ownerDocument && n.ownerDocument != t.getDoc())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10391
								addUndo();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10392
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10393
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10394
				} else {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10395
					t.dom.bind(t.getDoc(), 'blur', function() {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10396
						if (t.selection && !t.removed)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10397
							addUndo();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10398
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10399
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10400
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10401
				t.onMouseDown.add(addUndo);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10402
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10403
				t.onKeyUp.add(function(ed, e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10404
					if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45 || e.ctrlKey) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10405
						t.undoManager.typing = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10406
						t.undoManager.add();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10407
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10408
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10409
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10410
				t.onKeyDown.add(function(ed, e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10411
					// Is caracter positon keys
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10412
					if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10413
						if (t.undoManager.typing) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10414
							t.undoManager.add();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10415
							t.undoManager.typing = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10416
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10417
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10418
						return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10419
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10420
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10421
					if (!t.undoManager.typing) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10422
						t.undoManager.add();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10423
						t.undoManager.typing = 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10424
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10425
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10426
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10427
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10428
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10429
		_convertInlineElements : function() {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10430
			var t = this, s = t.settings, dom = t.dom, v, e, na, st, sp;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10431
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10432
			function convert(ed, o) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10433
				if (!s.inline_styles)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10434
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10435
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10436
				if (o.get) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10437
					each(t.dom.select('table,u,strike', o.node), function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10438
						switch (n.nodeName) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10439
							case 'TABLE':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10440
								if (v = dom.getAttrib(n, 'height')) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10441
									dom.setStyle(n, 'height', v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10442
									dom.setAttrib(n, 'height', '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10443
								}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10444
								break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10445
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10446
							case 'U':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10447
							case 'STRIKE':
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10448
								//sp = dom.create('span', {style : dom.getAttrib(n, 'style')});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10449
								n.style.textDecoration = n.nodeName == 'U' ? 'underline' : 'line-through';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10450
								dom.setAttrib(n, 'mce_style', '');
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10451
								dom.setAttrib(n, 'mce_name', 'span');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10452
								break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10453
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10454
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10455
				} else if (o.set) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10456
					each(t.dom.select('table,span', o.node).reverse(), function(n) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10457
						if (n.nodeName == 'TABLE') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10458
							if (v = dom.getStyle(n, 'height'))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10459
								dom.setAttrib(n, 'height', v.replace(/[^0-9%]+/g, ''));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10460
						} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10461
							// Convert spans to elements
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10462
							if (n.style.textDecoration == 'underline')
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10463
								na = 'u';
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10464
							else if (n.style.textDecoration == 'line-through')
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10465
								na = 'strike';
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10466
							else
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10467
								na = '';
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10468
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10469
							if (na) {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10470
								n.style.textDecoration = '';
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10471
								dom.setAttrib(n, 'mce_style', '');
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10472
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10473
								e = dom.create(na, {
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10474
									style : dom.getAttrib(n, 'style')
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10475
								});
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10477
								dom.replace(e, n, 1);
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10478
							}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10479
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10480
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10481
				}
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10482
			};
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10483
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10484
			t.onPreProcess.add(convert);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10485
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10486
			if (!s.cleanup_on_startup) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10487
				t.onSetContent.add(function(ed, o) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10488
					if (o.initial)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10489
						convert(t, {node : t.getBody(), set : 1});
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10490
				});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10491
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10492
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10493
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10494
		_convertFonts : function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10495
			var t = this, s = t.settings, dom = t.dom, fz, fzn, sl, cl;
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 10496
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 10497
			// No need
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 10498
			if (!s.inline_styles)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 10499
				return;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10500
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10501
			// Font pt values and font size names
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10502
			fz = [8, 10, 12, 14, 18, 24, 36];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10503
			fzn = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large'];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10504
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10505
			if (sl = s.font_size_style_values)
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10506
				sl = explode(sl);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10507
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10508
			if (cl = s.font_size_classes)
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10509
				cl = explode(cl);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10510
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10511
			function process(no) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10512
				var n, sp, nl, x;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10513
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 10514
				// Keep unit tests happy
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10515
				if (!s.inline_styles)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10516
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10517
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10518
				nl = t.dom.select('font', no);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10519
				for (x = nl.length - 1; x >= 0; x--) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10520
					n = nl[x];
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10521
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10522
					sp = dom.create('span', {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10523
						style : dom.getAttrib(n, 'style'),
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10524
						'class' : dom.getAttrib(n, 'class')
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10525
					});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10526
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10527
					dom.setStyles(sp, {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10528
						fontFamily : dom.getAttrib(n, 'face'),
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10529
						color : dom.getAttrib(n, 'color'),
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10530
						backgroundColor : n.style.backgroundColor
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10531
					});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10532
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10533
					if (n.size) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10534
						if (sl)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10535
							dom.setStyle(sp, 'fontSize', sl[parseInt(n.size) - 1]);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10536
						else
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10537
							dom.setAttrib(sp, 'class', cl[parseInt(n.size) - 1]);
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 10538
					}
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10539
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10540
					dom.setAttrib(sp, 'mce_style', '');
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10541
					dom.replace(sp, n, 1);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10542
				}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10543
			};
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10544
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10545
			// Run on cleanup
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10546
			t.onPreProcess.add(function(ed, o) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10547
				if (o.get)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10548
					process(o.node);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10549
			});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10550
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10551
			t.onSetContent.add(function(ed, o) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10552
				if (o.initial)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10553
					process(o.node);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10554
			});
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10555
		},
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10556
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10557
		_isHidden : function() {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10558
			var s;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10559
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10560
			if (!isGecko)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10561
				return 0;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10562
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10563
			// Weird, wheres that cursor selection?
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10564
			s = this.selection.getSel();
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10565
			return (!s || !s.rangeCount || s.rangeCount == 0);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10566
		},
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10567
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 10568
		// Fix for bug #1867292
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10569
		_fixNesting : function(s) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10570
			var d = [], i;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10571
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10572
			s = s.replace(/<(\/)?([^\s>]+)[^>]*?>/g, function(a, b, c) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10573
				var e;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10574
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10575
				// Handle end element
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10576
				if (b === '/') {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10577
					if (!d.length)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10578
						return '';
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10579
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10580
					if (c !== d[d.length - 1].tag) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10581
						for (i=d.length - 1; i>=0; i--) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10582
							if (d[i].tag === c) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10583
								d[i].close = 1;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10584
								break;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10585
							}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10586
						}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10587
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10588
						return '';
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10589
					} else {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10590
						d.pop();
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10591
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10592
						if (d.length && d[d.length - 1].close) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10593
							a = a + '</' + d[d.length - 1].tag + '>';
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10594
							d.pop();
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10595
						}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10596
					}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10597
				} else {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10598
					// Ignore these
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10599
					if (/^(br|hr|input|meta|img|link|param)$/i.test(c))
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10600
						return a;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10601
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10602
					// Ignore closed ones
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10603
					if (/\/>$/.test(a))
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10604
						return a;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10605
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10606
					d.push({tag : c}); // Push start element
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10607
				}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10608
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10609
				return a;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10610
			});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10611
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10612
			// End all open tags
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10613
			for (i=d.length - 1; i>=0; i--)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10614
				s += '</' + d[i].tag + '>';
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10615
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10616
			return s;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10617
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10618
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10619
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10620
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10621
	var each = tinymce.each, isIE = tinymce.isIE, isGecko = tinymce.isGecko, isOpera = tinymce.isOpera, isWebKit = tinymce.isWebKit;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10622
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10623
	tinymce.create('tinymce.EditorCommands', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10624
		EditorCommands : function(ed) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10625
			this.editor = ed;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10626
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10627
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10628
		execCommand : function(cmd, ui, val) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10629
			var t = this, ed = t.editor, f;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10630
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10631
			switch (cmd) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10632
				// Ignore these
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10633
				case 'mceResetDesignMode':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10634
				case 'mceBeginUndoLevel':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10635
					return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10636
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10637
				// Ignore these
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10638
				case 'unlink':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10639
					t.UnLink();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10640
					return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10641
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10642
				// Bundle these together
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10643
				case 'JustifyLeft':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10644
				case 'JustifyCenter':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10645
				case 'JustifyRight':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10646
				case 'JustifyFull':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10647
					t.mceJustify(cmd, cmd.substring(7).toLowerCase());
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10648
					return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10649
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10650
				default:
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10651
					f = this[cmd];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10652
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10653
					if (f) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10654
						f.call(this, ui, val);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10655
						return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10656
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10657
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10658
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10659
			return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10660
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10661
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10662
		Indent : function() {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10663
			var ed = this.editor, d = ed.dom, s = ed.selection, e, iv, iu;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10664
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10665
			// Setup indent level
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10666
			iv = ed.settings.indentation;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10667
			iu = /[a-z%]+$/i.exec(iv);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10668
			iv = parseInt(iv);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10669
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10670
			if (ed.settings.inline_styles && (!this.queryStateInsertUnorderedList() && !this.queryStateInsertOrderedList())) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10671
				each(s.getSelectedBlocks(), function(e) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10672
					d.setStyle(e, 'paddingLeft', (parseInt(e.style.paddingLeft || 0) + iv) + iu);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10673
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10674
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10675
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10676
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10677
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10678
			ed.getDoc().execCommand('Indent', false, null);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10679
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10680
			if (isIE) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10681
				d.getParent(s.getNode(), function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10682
					if (n.nodeName == 'BLOCKQUOTE') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10683
						n.dir = n.style.cssText = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10684
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10685
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10686
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10687
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10688
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10689
		Outdent : function() {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10690
			var ed = this.editor, d = ed.dom, s = ed.selection, e, v, iv, iu;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10691
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10692
			// Setup indent level
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10693
			iv = ed.settings.indentation;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10694
			iu = /[a-z%]+$/i.exec(iv);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10695
			iv = parseInt(iv);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10696
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10697
			if (ed.settings.inline_styles && (!this.queryStateInsertUnorderedList() && !this.queryStateInsertOrderedList())) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10698
				each(s.getSelectedBlocks(), function(e) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10699
					v = Math.max(0, parseInt(e.style.paddingLeft || 0) - iv);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 10700
					d.setStyle(e, 'paddingLeft', v ? v + iu : '');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10701
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10702
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10703
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10704
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10705
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10706
			ed.getDoc().execCommand('Outdent', false, null);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10707
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10708
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10709
/*
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10710
		mceSetAttribute : function(u, v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10711
			var ed = this.editor, d = ed.dom, e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10712
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10713
			if (e = d.getParent(ed.selection.getNode(), d.isBlock))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10714
				d.setAttrib(e, v.name, v.value);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10715
		},
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10716
*/
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10717
		mceSetContent : function(u, v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10718
			this.editor.setContent(v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10719
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10720
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10721
		mceToggleVisualAid : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10722
			var ed = this.editor;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10723
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10724
			ed.hasVisual = !ed.hasVisual;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10725
			ed.addVisual();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10726
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10727
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10728
		mceReplaceContent : function(u, v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10729
			var s = this.editor.selection;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10730
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10731
			s.setContent(v.replace(/\{\$selection\}/g, s.getContent({format : 'text'})));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10732
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10733
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10734
		mceInsertLink : function(u, v) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10735
			var ed = this.editor, s = ed.selection, e = ed.dom.getParent(s.getNode(), 'a');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10736
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10737
			if (tinymce.is(v, 'string'))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10738
				v = {href : v};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10739
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10740
			function set(e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10741
				each(v, function(v, k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10742
					ed.dom.setAttrib(e, k, v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10743
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10744
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10745
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10746
			if (!e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10747
				ed.execCommand('CreateLink', false, 'javascript:mctmp(0);');
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10748
				each(ed.dom.select('a[href=javascript:mctmp(0);]'), function(e) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10749
					set(e);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10750
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10751
			} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10752
				if (v.href)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10753
					set(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10754
				else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10755
					ed.dom.remove(e, 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10756
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10757
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10758
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10759
		UnLink : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10760
			var ed = this.editor, s = ed.selection;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10761
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10762
			if (s.isCollapsed())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10763
				s.select(s.getNode());
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10764
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10765
			ed.getDoc().execCommand('unlink', false, null);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10766
			s.collapse(0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10767
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10768
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10769
		FontName : function(u, v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10770
			var t = this, ed = t.editor, s = ed.selection, e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10771
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10772
			if (!v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10773
				if (s.isCollapsed())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10774
					s.select(s.getNode());
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10775
			} else {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10776
				if (ed.settings.convert_fonts_to_spans)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10777
					t._applyInlineStyle('span', {style : {fontFamily : v}});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10778
				else
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10779
					ed.getDoc().execCommand('FontName', false, v);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10780
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10781
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10782
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10783
		FontSize : function(u, v) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10784
			var ed = this.editor, s = ed.settings, fc, fs;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10785
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10786
			// Use style options instead
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10787
			if (s.convert_fonts_to_spans && v >= 1 && v <= 7) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10788
				fs = tinymce.explode(s.font_size_style_values);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10789
				fc = tinymce.explode(s.font_size_classes);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10790
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10791
				if (fc)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10792
					v = fc[v - 1] || v;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10793
				else
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10794
					v = fs[v - 1] || v;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10795
			}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10796
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10797
			if (v >= 1 && v <= 7)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10798
				ed.getDoc().execCommand('FontSize', false, v);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10799
			else
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10800
				this._applyInlineStyle('span', {style : {fontSize : v}});
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10801
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10802
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10803
		queryCommandValue : function(c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10804
			var f = this['queryValue' + c];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10805
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10806
			if (f)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10807
				return f.call(this, c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10808
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10809
			return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10810
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10811
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10812
		queryCommandState : function(cmd) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10813
			var f;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10814
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10815
			switch (cmd) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10816
				// Bundle these together
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10817
				case 'JustifyLeft':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10818
				case 'JustifyCenter':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10819
				case 'JustifyRight':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10820
				case 'JustifyFull':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10821
					return this.queryStateJustify(cmd, cmd.substring(7).toLowerCase());
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10822
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10823
				default:
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10824
					if (f = this['queryState' + cmd])
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10825
						return f.call(this, cmd);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10826
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10827
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10828
			return -1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10829
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10830
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10831
		_queryState : function(c) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10832
			try {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10833
				return this.editor.getDoc().queryCommandState(c);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10834
			} catch (ex) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10835
				// Ignore exception
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10836
			}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10837
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10838
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10839
		_queryVal : function(c) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10840
			try {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10841
				return this.editor.getDoc().queryCommandValue(c);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10842
			} catch (ex) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10843
				// Ignore exception
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10844
			}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10845
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10846
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10847
		queryValueFontSize : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10848
			var ed = this.editor, v = 0, p;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10849
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10850
			if (p = ed.dom.getParent(ed.selection.getNode(), 'span'))
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10851
				v = p.style.fontSize;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10852
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10853
			if (!v && (isOpera || isWebKit)) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10854
				if (p = ed.dom.getParent(ed.selection.getNode(), 'font'))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10855
					v = p.size;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10856
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10857
				return v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10858
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10859
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10860
			return v || this._queryVal('FontSize');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10861
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10862
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10863
		queryValueFontName : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10864
			var ed = this.editor, v = 0, p;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10865
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10866
			if (p = ed.dom.getParent(ed.selection.getNode(), 'font'))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10867
				v = p.face;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10868
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10869
			if (p = ed.dom.getParent(ed.selection.getNode(), 'span'))
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10870
				v = p.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase();
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10871
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10872
			if (!v)
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 10873
				v = this._queryVal('FontName');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10874
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10875
			return v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10876
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10877
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10878
		mceJustify : function(c, v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10879
			var ed = this.editor, se = ed.selection, n = se.getNode(), nn = n.nodeName, bl, nb, dom = ed.dom, rm;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10880
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10881
			if (ed.settings.inline_styles && this.queryStateJustify(c, v))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10882
				rm = 1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10883
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10884
			bl = dom.getParent(n, ed.dom.isBlock);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10885
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10886
			if (nn == 'IMG') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10887
				if (v == 'full')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10888
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10889
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10890
				if (rm) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 10891
					if (v == 'center')
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10892
						dom.setStyle(bl || n.parentNode, 'textAlign', '');
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 10893
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10894
					dom.setStyle(n, 'float', '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10895
					this.mceRepaint();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10896
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10897
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10898
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10899
				if (v == 'center') {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 10900
					// Do not change table elements
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10901
					if (bl && /^(TD|TH)$/.test(bl.nodeName))
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 10902
						bl = 0;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 10903
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10904
					if (!bl || bl.childNodes.length > 1) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10905
						nb = dom.create('p');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10906
						nb.appendChild(n.cloneNode(false));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10907
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10908
						if (bl)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10909
							dom.insertAfter(nb, bl);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10910
						else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10911
							dom.insertAfter(nb, n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10912
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10913
						dom.remove(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10914
						n = nb.firstChild;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10915
						bl = nb;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10916
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10917
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10918
					dom.setStyle(bl, 'textAlign', v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10919
					dom.setStyle(n, 'float', '');
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 10920
				} else {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10921
					dom.setStyle(n, 'float', v);
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 10922
					dom.setStyle(bl || n.parentNode, 'textAlign', '');
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 10923
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10924
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10925
				this.mceRepaint();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10926
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10927
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10928
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10929
			// Handle the alignment outselfs, less quirks in all browsers
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10930
			if (ed.settings.inline_styles && ed.settings.forced_root_block) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10931
				if (rm)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10932
					v = '';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10933
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 10934
				each(se.getSelectedBlocks(dom.getParent(se.getStart(), dom.isBlock), dom.getParent(se.getEnd(), dom.isBlock)), function(e) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10935
					dom.setAttrib(e, 'align', '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10936
					dom.setStyle(e, 'textAlign', v == 'full' ? 'justify' : v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10937
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10938
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10939
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10940
			} else if (!rm)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10941
				ed.getDoc().execCommand(c, false, null);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10942
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10943
			if (ed.settings.inline_styles) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10944
				if (rm) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10945
					dom.getParent(ed.selection.getNode(), function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10946
						if (n.style && n.style.textAlign)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10947
							dom.setStyle(n, 'textAlign', '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10948
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10949
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10950
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10951
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10952
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10953
				each(dom.select('*'), function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10954
					var v = n.align;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10955
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10956
					if (v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10957
						if (v == 'full')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10958
							v = 'justify';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10959
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10960
						dom.setStyle(n, 'textAlign', v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10961
						dom.setAttrib(n, 'align', '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10962
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10963
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10964
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10965
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10966
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10967
		mceSetCSSClass : function(u, v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10968
			this.mceSetStyleInfo(0, {command : 'setattrib', name : 'class', value : v});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10969
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10970
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10971
		getSelectedElement : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10972
			var t = this, ed = t.editor, dom = ed.dom, se = ed.selection, r = se.getRng(), r1, r2, sc, ec, so, eo, e, sp, ep, re;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10973
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10974
			if (se.isCollapsed() || r.item)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10975
				return se.getNode();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10976
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10977
			// Setup regexp
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10978
			re = ed.settings.merge_styles_invalid_parents;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10979
			if (tinymce.is(re, 'string'))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10980
				re = new RegExp(re, 'i');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10981
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10982
			if (isIE) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10983
				r1 = r.duplicate();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10984
				r1.collapse(true);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10985
				sc = r1.parentElement();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10986
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10987
				r2 = r.duplicate();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10988
				r2.collapse(false);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10989
				ec = r2.parentElement();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10990
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10991
				if (sc != ec) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10992
					r1.move('character', 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10993
					sc = r1.parentElement();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10994
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10995
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10996
				if (sc == ec) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10997
					r1 = r.duplicate();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10998
					r1.moveToElementText(sc);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 10999
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11000
					if (r1.compareEndPoints('StartToStart', r) == 0 && r1.compareEndPoints('EndToEnd', r) == 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11001
						return re && re.test(sc.nodeName) ? null : sc;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11002
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11003
			} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11004
				function getParent(n) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11005
					return dom.getParent(n, '*');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11006
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11007
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11008
				sc = r.startContainer;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11009
				ec = r.endContainer;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11010
				so = r.startOffset;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11011
				eo = r.endOffset;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11012
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11013
				if (!r.collapsed) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11014
					if (sc == ec) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11015
						if (so - eo < 2) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11016
							if (sc.hasChildNodes()) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11017
								sp = sc.childNodes[so];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11018
								return re && re.test(sp.nodeName) ? null : sp;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11019
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11020
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11021
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11022
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11023
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11024
				if (sc.nodeType != 3 || ec.nodeType != 3)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11025
					return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11026
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11027
				if (so == 0) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11028
					sp = getParent(sc);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11029
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11030
					if (sp && sp.firstChild != sc)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11031
						sp = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11032
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11033
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11034
				if (so == sc.nodeValue.length) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11035
					e = sc.nextSibling;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11036
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11037
					if (e && e.nodeType == 1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11038
						sp = sc.nextSibling;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11039
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11040
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11041
				if (eo == 0) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11042
					e = ec.previousSibling;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11043
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11044
					if (e && e.nodeType == 1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11045
						ep = e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11046
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11047
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11048
				if (eo == ec.nodeValue.length) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11049
					ep = getParent(ec);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11050
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11051
					if (ep && ep.lastChild != ec)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11052
						ep = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11053
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11054
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11055
				// Same element
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11056
				if (sp == ep)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11057
					return re && sp && re.test(sp.nodeName) ? null : sp;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11058
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11059
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11060
			return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11061
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11062
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11063
		mceSetStyleInfo : function(u, v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11064
			var t = this, ed = t.editor, d = ed.getDoc(), dom = ed.dom, e, b, s = ed.selection, nn = v.wrapper || 'span', b = s.getBookmark(), re;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11065
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11066
			function set(n, e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11067
				if (n.nodeType == 1) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11068
					switch (v.command) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11069
						case 'setattrib':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11070
							return dom.setAttrib(n, v.name, v.value);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11071
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11072
						case 'setstyle':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11073
							return dom.setStyle(n, v.name, v.value);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11074
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11075
						case 'removeformat':
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11076
							return dom.setAttrib(n, 'class', '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11077
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11078
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11079
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11080
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11081
			// Setup regexp
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11082
			re = ed.settings.merge_styles_invalid_parents;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11083
			if (tinymce.is(re, 'string'))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11084
				re = new RegExp(re, 'i');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11085
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11086
			// Set style info on selected element
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11087
			if ((e = t.getSelectedElement()) && !ed.settings.force_span_wrappers)
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11088
				set(e, 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11089
			else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11090
				// Generate wrappers and set styles on them
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11091
				d.execCommand('FontName', false, '__');
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11092
				each(dom.select('span,font'), function(n) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11093
					var sp, e;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11094
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11095
					if (dom.getAttrib(n, 'face') == '__' || n.style.fontFamily === '__') {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11096
						sp = dom.create(nn, {mce_new : '1'});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11097
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11098
						set(sp);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11099
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11100
						each (n.childNodes, function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11101
							sp.appendChild(n.cloneNode(true));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11102
						});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11103
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11104
						dom.replace(sp, n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11105
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11106
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11107
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11108
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11109
			// Remove wrappers inside new ones
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11110
			each(dom.select(nn).reverse(), function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11111
				var p = n.parentNode;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11112
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11113
				// Check if it's an old span in a new wrapper
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11114
				if (!dom.getAttrib(n, 'mce_new')) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11115
					// Find new wrapper
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11116
					p = dom.getParent(n, '*[mce_new]');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11117
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11118
					if (p)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11119
						dom.remove(n, 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11120
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11121
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11122
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11123
			// Merge wrappers with parent wrappers
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11124
			each(dom.select(nn).reverse(), function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11125
				var p = n.parentNode;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11126
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11127
				if (!p || !dom.getAttrib(n, 'mce_new'))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11128
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11129
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11130
				if (ed.settings.force_span_wrappers && p.nodeName != 'SPAN')
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11131
					return;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11132
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11133
				// Has parent of the same type and only child
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11134
				if (p.nodeName == nn.toUpperCase() && p.childNodes.length == 1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11135
					return dom.remove(p, 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11136
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11137
				// Has parent that is more suitable to have the class and only child
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11138
				if (n.nodeType == 1 && (!re || !re.test(p.nodeName)) && p.childNodes.length == 1) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11139
					set(p); // Set style info on parent instead
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11140
					dom.setAttrib(n, 'class', '');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11141
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11142
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11143
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11144
			// Remove empty wrappers
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11145
			each(dom.select(nn).reverse(), function(n) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11146
				if (dom.getAttrib(n, 'mce_new') || (dom.getAttribs(n).length <= 1 && n.className === '')) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11147
					if (!dom.getAttrib(n, 'class') && !dom.getAttrib(n, 'style'))
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11148
						return dom.remove(n, 1);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11149
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11150
					dom.setAttrib(n, 'mce_new', ''); // Remove mce_new marker
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11151
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11152
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11153
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11154
			s.moveToBookmark(b);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11155
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11156
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11157
		queryStateJustify : function(c, v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11158
			var ed = this.editor, n = ed.selection.getNode(), dom = ed.dom;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11159
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11160
			if (n && n.nodeName == 'IMG') {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11161
				if (dom.getStyle(n, 'float') == v)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11162
					return 1;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11163
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11164
				return n.parentNode.style.textAlign == v;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11165
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11166
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11167
			n = dom.getParent(ed.selection.getStart(), function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11168
				return n.nodeType == 1 && n.style.textAlign;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11169
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11170
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11171
			if (v == 'full')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11172
				v = 'justify';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11173
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11174
			if (ed.settings.inline_styles)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11175
				return (n && n.style.textAlign == v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11176
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11177
			return this._queryState(c);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11178
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11179
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11180
		ForeColor : function(ui, v) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11181
			var ed = this.editor;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11182
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11183
			if (ed.settings.convert_fonts_to_spans) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11184
				this._applyInlineStyle('span', {style : {color : v}});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11185
				return;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11186
			} else
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11187
				ed.getDoc().execCommand('ForeColor', false, v);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11188
		},
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11189
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11190
		HiliteColor : function(ui, val) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11191
			var t = this, ed = t.editor, d = ed.getDoc();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11192
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11193
			if (ed.settings.convert_fonts_to_spans) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11194
				this._applyInlineStyle('span', {style : {backgroundColor : val}});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11195
				return;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11196
			}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11197
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11198
			function set(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11199
				if (!isGecko)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11200
					return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11201
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
 11202
				try {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11203
					// Try new Gecko method
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11204
					d.execCommand("styleWithCSS", 0, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11205
				} catch (ex) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11206
					// Use old
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11207
					d.execCommand("useCSS", 0, !s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11208
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11209
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11210
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11211
			if (isGecko || isOpera) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11212
				set(true);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11213
				d.execCommand('hilitecolor', false, val);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11214
				set(false);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11215
			} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11216
				d.execCommand('BackColor', false, val);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11217
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11218
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11219
		FormatBlock : function(ui, val) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11220
			var t = this, ed = t.editor, s = ed.selection, dom = ed.dom, bl, nb, b;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11221
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11222
			function isBlock(n) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11223
				return /^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(n.nodeName);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11224
			};
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11225
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11226
			bl = dom.getParent(s.getNode(), function(n) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11227
				return isBlock(n);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11228
			});
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11229
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11230
			// IE has an issue where it removes the parent div if you change format on the paragrah in <div><p>Content</p></div>
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11231
			// FF and Opera doesn't change parent DIV elements if you switch format
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11232
			if (bl) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11233
				if ((isIE && isBlock(bl.parentNode)) || bl.nodeName == 'DIV') {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11234
					// Rename block element
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11235
					nb = ed.dom.create(val);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11236
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11237
					each(dom.getAttribs(bl), function(v) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11238
						dom.setAttrib(nb, v.nodeName, dom.getAttrib(bl, v.nodeName));
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11239
					});
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11240
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11241
					b = s.getBookmark();
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11242
					dom.replace(nb, bl, 1);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11243
					s.moveToBookmark(b);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11244
					ed.nodeChanged();
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11245
					return;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11246
				}
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11247
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11248
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11249
			val = ed.settings.forced_root_block ? (val || '<p>') : val;
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11250
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11251
			if (val.indexOf('<') == -1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11252
				val = '<' + val + '>';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11253
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11254
			if (tinymce.isGecko)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11255
				val = val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi, '$1');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11256
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11257
			ed.getDoc().execCommand('FormatBlock', false, val);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11258
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11259
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11260
		mceCleanup : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11261
			var ed = this.editor, s = ed.selection, b = s.getBookmark();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11262
			ed.setContent(ed.getContent());
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11263
			s.moveToBookmark(b);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11264
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11265
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11266
		mceRemoveNode : function(ui, val) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11267
			var ed = this.editor, s = ed.selection, b, n = val || s.getNode();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11268
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11269
			// Make sure that the body node isn't removed
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11270
			if (n == ed.getBody())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11271
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11272
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11273
			b = s.getBookmark();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11274
			ed.dom.remove(n, 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11275
			s.moveToBookmark(b);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11276
			ed.nodeChanged();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11277
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11278
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11279
		mceSelectNodeDepth : function(ui, val) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11280
			var ed = this.editor, s = ed.selection, c = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11281
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11282
			ed.dom.getParent(s.getNode(), function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11283
				if (n.nodeType == 1 && c++ == val) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11284
					s.select(n);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11285
					ed.nodeChanged();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11286
					return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11287
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11288
			}, ed.getBody());
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11289
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11290
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11291
		mceSelectNode : function(u, v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11292
			this.editor.selection.select(v);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11293
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11294
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11295
		mceInsertContent : function(ui, val) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11296
			this.editor.selection.setContent(val);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11297
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11298
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11299
		mceInsertRawHTML : function(ui, val) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11300
			var ed = this.editor;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11301
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11302
			ed.selection.setContent('tiny_mce_marker');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11303
			ed.setContent(ed.getContent().replace(/tiny_mce_marker/g, val));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11304
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11305
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11306
		mceRepaint : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11307
			var s, b, e = this.editor;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11308
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11309
			if (tinymce.isGecko) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11310
				try {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11311
					s = e.selection;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11312
					b = s.getBookmark(true);
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11313
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11314
					if (s.getSel())
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11315
						s.getSel().selectAllChildren(e.getBody());
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11316
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11317
					s.collapse(true);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11318
					s.moveToBookmark(b);
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
 11319
				} catch (ex) {
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
 11320
					// Ignore
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
 11321
				}
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
 11322
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11323
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11324
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11325
		queryStateUnderline : function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11326
			var ed = this.editor, n = ed.selection.getNode();
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11327
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11328
			if (n && n.nodeName == 'A')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11329
				return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11330
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11331
			return this._queryState('Underline');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11332
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11333
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11334
		queryStateOutdent : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11335
			var ed = this.editor, n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11336
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11337
			if (ed.settings.inline_styles) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11338
				if ((n = ed.dom.getParent(ed.selection.getStart(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11339
					return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11340
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11341
				if ((n = ed.dom.getParent(ed.selection.getEnd(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11342
					return true;
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11343
			}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11344
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11345
			return this.queryStateInsertUnorderedList() || this.queryStateInsertOrderedList() || (!ed.settings.inline_styles && !!ed.dom.getParent(ed.selection.getNode(), 'BLOCKQUOTE'));
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11346
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11347
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11348
		queryStateInsertUnorderedList : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11349
			return this.editor.dom.getParent(this.editor.selection.getNode(), 'UL');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11350
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11351
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11352
		queryStateInsertOrderedList : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11353
			return this.editor.dom.getParent(this.editor.selection.getNode(), 'OL');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11354
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11355
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11356
		queryStatemceBlockQuote : function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11357
			return !!this.editor.dom.getParent(this.editor.selection.getStart(), function(n) {return n.nodeName === 'BLOCKQUOTE';});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11358
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11359
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11360
		_applyInlineStyle : function(na, at, op) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11361
			var t = this, ed = t.editor, dom = ed.dom, bm, lo = {}, kh, found;
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11362
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11363
			na = na.toUpperCase();
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11364
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11365
			if (op && op.check_classes && at['class'])
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11366
				op.check_classes.push(at['class']);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11367
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11368
			function removeEmpty() {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11369
				each(dom.select(na).reverse(), function(n) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11370
					var c = 0;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11371
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11372
					// Check if there is any attributes
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11373
					each(dom.getAttribs(n), function(an) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11374
						if (an.nodeName.substring(0, 1) != '_' && dom.getAttrib(n, an.nodeName) != '') {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11375
							//console.log(dom.getOuterHTML(n), dom.getAttrib(n, an.nodeName));
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11376
							c++;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11377
						}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11378
					});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11379
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11380
					// No attributes then remove the element and keep the children
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11381
					if (c == 0)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11382
						dom.remove(n, 1);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11383
				});
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11384
			};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11385
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11386
			function replaceFonts() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11387
				var bm;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11388
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11389
				each(dom.select('span,font'), function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11390
					if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11391
						if (!bm)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11392
							bm = ed.selection.getBookmark();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11393
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11394
						at._mce_new = '1';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11395
						dom.replace(dom.create(na, at), n, 1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11396
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11397
				});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11398
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11399
				// Remove redundant elements
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11400
				each(dom.select(na + '[_mce_new]'), function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11401
					function removeStyle(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11402
						if (n.nodeType == 1) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11403
							each(at.style, function(v, k) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11404
								dom.setStyle(n, k, '');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11405
							});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11406
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11407
							// Remove spans with the same class or marked classes
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11408
							if (at['class'] && n.className && op) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11409
								each(op.check_classes, function(c) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11410
									if (dom.hasClass(n, c))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11411
										dom.removeClass(n, c);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11412
								});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11413
							}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11414
						}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11415
					};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11416
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11417
					// Remove specified style information from child elements
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11418
					each(dom.select(na, n), removeStyle);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11419
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11420
					// Remove the specified style information on parent if current node is only child (IE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11421
					if (n.parentNode && n.parentNode.nodeType == 1 && n.parentNode.childNodes.length == 1)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11422
						removeStyle(n.parentNode);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11423
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11424
					// Remove the child elements style info if a parent already has it
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11425
					dom.getParent(n.parentNode, function(pn) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11426
						if (pn.nodeType == 1) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11427
							if (at.style) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11428
								each(at.style, function(v, k) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11429
									var sv;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11430
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11431
									if (!lo[k] && (sv = dom.getStyle(pn, k))) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11432
										if (sv === v)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11433
											dom.setStyle(n, k, '');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11434
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11435
										lo[k] = 1;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11436
									}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11437
								});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11438
							}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11439
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11440
							// Remove spans with the same class or marked classes
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11441
							if (at['class'] && pn.className && op) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11442
								each(op.check_classes, function(c) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11443
									if (dom.hasClass(pn, c))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11444
										dom.removeClass(n, c);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11445
								});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11446
							}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11447
						}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11448
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11449
						return false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11450
					});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11451
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11452
					n.removeAttribute('_mce_new');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11453
				});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11454
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11455
				removeEmpty();
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11456
				ed.selection.moveToBookmark(bm);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11457
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11458
				return !!bm;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11459
			};
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11460
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11461
			// Create inline elements
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11462
			ed.focus();
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11463
			ed.getDoc().execCommand('FontName', false, 'mceinline');
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11464
			replaceFonts();
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11465
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11466
			if (kh = t._applyInlineStyle.keyhandler) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11467
				ed.onKeyUp.remove(kh);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11468
				ed.onKeyPress.remove(kh);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11469
				ed.onKeyDown.remove(kh);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11470
				ed.onSetContent.remove(t._applyInlineStyle.chandler);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11471
			}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11472
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11473
			if (ed.selection.isCollapsed()) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11474
				// IE will format the current word so this code can't be executed on that browser
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11475
				if (!isIE) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11476
					each(dom.getParents(ed.selection.getNode(), 'span'), function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11477
						each(at.style, function(v, k) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11478
							var kv;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11479
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11480
							if (kv = dom.getStyle(n, k)) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11481
								if (kv == v) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11482
									dom.setStyle(n, k, '');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11483
									found = 2;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11484
									return false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11485
								}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11486
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11487
								found = 1;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11488
								return false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11489
							}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11490
						});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11491
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11492
						if (found)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11493
							return false;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11494
					});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11495
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11496
					if (found == 2) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11497
						bm = ed.selection.getBookmark();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11498
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11499
						removeEmpty();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11500
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11501
						ed.selection.moveToBookmark(bm);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11502
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11503
						// Node change needs to be detached since the onselect event
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11504
						// for the select box will run the onclick handler after onselect call. Todo: Add a nicer fix!
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11505
						window.setTimeout(function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11506
							ed.nodeChanged();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11507
						}, 1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11508
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11509
						return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11510
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11511
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11512
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11513
				// Start collecting styles
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11514
				t._pendingStyles = tinymce.extend(t._pendingStyles || {}, at.style);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11515
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11516
				t._applyInlineStyle.chandler = ed.onSetContent.add(function() {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11517
					delete t._pendingStyles;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11518
				});
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11519
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11520
				t._applyInlineStyle.keyhandler = kh = function(e) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11521
					// Use pending styles
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11522
					if (t._pendingStyles) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11523
						at.style = t._pendingStyles;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11524
						delete t._pendingStyles;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11525
					}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11526
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11527
					if (replaceFonts()) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11528
						ed.onKeyDown.remove(t._applyInlineStyle.keyhandler);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11529
						ed.onKeyPress.remove(t._applyInlineStyle.keyhandler);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11530
					}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11531
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11532
					if (e.type == 'keyup')
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11533
						ed.onKeyUp.remove(t._applyInlineStyle.keyhandler);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11534
				};
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11535
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11536
				ed.onKeyDown.add(kh);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11537
				ed.onKeyPress.add(kh);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11538
				ed.onKeyUp.add(kh);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11539
			} else
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11540
				t._pendingStyles = 0;
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
 11541
		}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11542
	});
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11543
})(tinymce);(function(tinymce) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11544
	tinymce.create('tinymce.UndoManager', {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11545
		index : 0,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11546
		data : null,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11547
		typing : 0,
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11548
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11549
		UndoManager : function(ed) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11550
			var t = this, Dispatcher = tinymce.util.Dispatcher;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11551
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11552
			t.editor = ed;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11553
			t.data = [];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11554
			t.onAdd = new Dispatcher(this);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11555
			t.onUndo = new Dispatcher(this);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11556
			t.onRedo = new Dispatcher(this);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11557
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11558
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11559
		add : function(l) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11560
			var t = this, i, ed = t.editor, b, s = ed.settings, la;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11561
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11562
			l = l || {};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11563
			l.content = l.content || ed.getContent({format : 'raw', no_events : 1});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11564
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11565
			// Add undo level if needed
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11566
			l.content = l.content.replace(/^\s*|\s*$/g, '');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11567
			la = t.data[t.index > 0 && (t.index == 0 || t.index == t.data.length) ? t.index - 1 : t.index];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11568
			if (!l.initial && la && l.content == la.content)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11569
				return null;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11570
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11571
			// Time to compress
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11572
			if (s.custom_undo_redo_levels) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11573
				if (t.data.length > s.custom_undo_redo_levels) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11574
					for (i = 0; i < t.data.length - 1; i++)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11575
						t.data[i] = t.data[i + 1];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11576
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11577
					t.data.length--;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11578
					t.index = t.data.length;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11579
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11580
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11581
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11582
			if (s.custom_undo_redo_restore_selection && !l.initial)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11583
				l.bookmark = b = l.bookmark || ed.selection.getBookmark();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11584
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11585
			if (t.index < t.data.length)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11586
				t.index++;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11587
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11588
			// Only initial marked undo levels should be allowed as first item
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11589
			// This to workaround a bug with Firefox and the blur event
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11590
			if (t.data.length === 0 && !l.initial)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11591
				return null;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11592
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11593
			// Add level
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11594
			t.data.length = t.index + 1;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11595
			t.data[t.index++] = l;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11596
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11597
			if (l.initial)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11598
				t.index = 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11599
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11600
			// Set initial bookmark use first real undo level
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11601
			if (t.data.length == 2 && t.data[0].initial)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11602
				t.data[0].bookmark = b;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11603
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11604
			t.onAdd.dispatch(t, l);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11605
			ed.isNotDirty = 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11606
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11607
			//console.dir(t.data);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11608
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11609
			return l;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11610
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11611
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11612
		undo : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11613
			var t = this, ed = t.editor, l = l, i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11614
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11615
			if (t.typing) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11616
				t.add();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11617
				t.typing = 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11618
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11619
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11620
			if (t.index > 0) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11621
				// If undo on last index then take snapshot
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11622
				if (t.index == t.data.length && t.index > 1) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11623
					i = t.index;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11624
					t.typing = 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11625
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11626
					if (!t.add())
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11627
						t.index = i;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11628
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11629
					--t.index;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11630
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11631
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11632
				l = t.data[--t.index];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11633
				ed.setContent(l.content, {format : 'raw'});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11634
				ed.selection.moveToBookmark(l.bookmark);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11635
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11636
				t.onUndo.dispatch(t, l);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11637
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11638
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11639
			return l;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11640
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11641
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11642
		redo : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11643
			var t = this, ed = t.editor, l = null;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11644
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11645
			if (t.index < t.data.length - 1) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11646
				l = t.data[++t.index];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11647
				ed.setContent(l.content, {format : 'raw'});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11648
				ed.selection.moveToBookmark(l.bookmark);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11649
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11650
				t.onRedo.dispatch(t, l);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11651
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11652
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11653
			return l;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11654
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11655
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11656
		clear : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11657
			var t = this;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11658
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11659
			t.data = [];
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11660
			t.index = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11661
			t.typing = 0;
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11662
			t.add({initial : true});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11663
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11664
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11665
		hasUndo : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11666
			return this.index != 0 || this.typing;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11667
		},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11668
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11669
		hasRedo : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11670
			return this.index < this.data.length - 1;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11671
		}
1
fe660c52c48f Adding /includes
dan@scribus.fuhry.local.fuhry.local
parents:
diff changeset
 11672
	});
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11673
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11674
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11675
	// Shorten names
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11676
	var Event, isIE, isGecko, isOpera, each, extend;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11677
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11678
	Event = tinymce.dom.Event;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11679
	isIE = tinymce.isIE;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11680
	isGecko = tinymce.isGecko;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11681
	isOpera = tinymce.isOpera;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11682
	each = tinymce.each;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11683
	extend = tinymce.extend;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11684
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11685
	// Checks if the selection/caret is at the end of the specified block element
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11686
	function isAtEnd(rng, par) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11687
		var rng2 = par.ownerDocument.createRange();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11688
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11689
		rng2.setStart(rng.endContainer, rng.endOffset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11690
		rng2.setEndAfter(par);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11691
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11692
		// Get number of characters to the right of the cursor if it's zero then we are at the end and need to merge the next block element
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11693
		return rng2.cloneContents().textContent.length == 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11694
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11695
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11696
	function isEmpty(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11697
		n = n.innerHTML;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11698
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11699
		n = n.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi, '-'); // Keep these convert them to - chars
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11700
		n = n.replace(/<[^>]+>/g, ''); // Remove all tags
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11701
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11702
		return n.replace(/[ \t\r\n]+/g, '') == '';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11703
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11704
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11705
	tinymce.create('tinymce.ForceBlocks', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11706
		ForceBlocks : function(ed) {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 11707
			var t = this, s = ed.settings, elm;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11708
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11709
			t.editor = ed;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11710
			t.dom = ed.dom;
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11711
			elm = (s.forced_root_block || 'p').toLowerCase();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11712
			s.element = elm.toUpperCase();
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11713
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11714
			ed.onPreInit.add(t.setup, t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11715
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11716
			t.reOpera = new RegExp('(\\u00a0|&#160;|&nbsp;)<\/' + elm + '>', 'gi');
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11717
			t.rePadd = new RegExp('<p( )([^>]+)><\\\/p>|<p( )([^>]+)\\\/>|<p( )([^>]+)>\\s+<\\\/p>|<p><\\\/p>|<p\\\/>|<p>\\s+<\\\/p>'.replace(/p/g, elm), 'gi');
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11718
			t.reNbsp2BR1 = new RegExp('<p( )([^>]+)>[\\s\\u00a0]+<\\\/p>|<p>[\\s\\u00a0]+<\\\/p>'.replace(/p/g, elm), 'gi');
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11719
			t.reNbsp2BR2 = new RegExp('<%p()([^>]+)>(&nbsp;|&#160;)<\\\/%p>|<%p>(&nbsp;|&#160;)<\\\/%p>'.replace(/%p/g, elm), 'gi');
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11720
			t.reBR2Nbsp = new RegExp('<p( )([^>]+)>\\s*<br \\\/>\\s*<\\\/p>|<p>\\s*<br \\\/>\\s*<\\\/p>'.replace(/p/g, elm), 'gi');
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11721
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11722
			function padd(ed, o) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11723
				if (isOpera)
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11724
					o.content = o.content.replace(t.reOpera, '</' + elm + '>');
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11725
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11726
				o.content = o.content.replace(t.rePadd, '<' + elm + '$1$2$3$4$5$6>\u00a0</' + elm + '>');
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11727
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11728
				if (!isIE && !isOpera && o.set) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11729
					// Use &nbsp; instead of BR in padded paragraphs
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11730
					o.content = o.content.replace(t.reNbsp2BR1, '<' + elm + '$1$2><br /></' + elm + '>');
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 11731
					o.content = o.content.replace(t.reNbsp2BR2, '<' + elm + '$1$2><br /></' + elm + '>');
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11732
				} else
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11733
					o.content = o.content.replace(t.reBR2Nbsp, '<' + elm + '$1$2>\u00a0</' + elm + '>');
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11734
			};
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11735
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11736
			ed.onBeforeSetContent.add(padd);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11737
			ed.onPostProcess.add(padd);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11738
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11739
			if (s.forced_root_block) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11740
				ed.onInit.add(t.forceRoots, t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11741
				ed.onSetContent.add(t.forceRoots, t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11742
				ed.onBeforeGetContent.add(t.forceRoots, t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11743
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11744
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11745
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11746
		setup : function() {
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 11747
			var t = this, ed = t.editor, s = ed.settings;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11748
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11749
			// Force root blocks when typing and when getting output
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11750
			if (s.forced_root_block) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11751
				ed.onKeyUp.add(t.forceRoots, t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11752
				ed.onPreProcess.add(t.forceRoots, t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11753
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11754
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11755
			if (s.force_br_newlines) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11756
				// Force IE to produce BRs on enter
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11757
				if (isIE) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11758
					ed.onKeyPress.add(function(ed, e) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11759
						var n, s = ed.selection;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11760
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11761
						if (e.keyCode == 13 && s.getNode().nodeName != 'LI') {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11762
							s.setContent('<br id="__" /> ', {format : 'raw'});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11763
							n = ed.dom.get('__');
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11764
							n.removeAttribute('id');
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11765
							s.select(n);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11766
							s.collapse();
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11767
							return Event.cancel(e);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11768
						}
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11769
					});
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11770
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11771
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11772
				return;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11773
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11774
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11775
			if (!isIE && s.force_p_newlines) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11776
/*				ed.onPreProcess.add(function(ed, o) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11777
					each(ed.dom.select('br', o.node), function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11778
						var p = n.parentNode;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11779
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11780
						// Replace <p><br /></p> with <p>&nbsp;</p>
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11781
						if (p && p.nodeName == 'p' && (p.childNodes.length == 1 || p.lastChild == n)) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11782
							p.replaceChild(ed.getDoc().createTextNode('\u00a0'), n);
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11783
						}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11784
					});
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11785
				});*/
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11786
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11787
				ed.onKeyPress.add(function(ed, e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11788
					if (e.keyCode == 13 && !e.shiftKey) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11789
						if (!t.insertPara(e))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11790
							Event.cancel(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11791
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11792
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11793
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11794
				if (isGecko) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11795
					ed.onKeyDown.add(function(ed, e) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11796
						if ((e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11797
							t.backspaceDelete(e, e.keyCode == 8);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11798
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11799
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11800
			}
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11801
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11802
			function ren(rn, na) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11803
				var ne = ed.dom.create(na);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11804
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11805
				each(rn.attributes, function(a) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11806
					if (a.specified && a.nodeValue)
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11807
						ne.setAttribute(a.nodeName.toLowerCase(), a.nodeValue);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11808
				});
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11809
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11810
				each(rn.childNodes, function(n) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11811
					ne.appendChild(n.cloneNode(true));
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11812
				});
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11813
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11814
				rn.parentNode.replaceChild(ne, rn);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11815
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11816
				return ne;
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11817
			};
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11818
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11819
			// Padd empty inline elements within block elements
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11820
			// For example: <p><strong><em></em></strong></p> becomes <p><strong><em>&nbsp;</em></strong></p>
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11821
			ed.onPreProcess.add(function(ed, o) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11822
				each(ed.dom.select('p,h1,h2,h3,h4,h5,h6,div', o.node), function(p) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11823
					if (isEmpty(p)) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11824
						each(ed.dom.select('span,em,strong,b,i', o.node), function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11825
							if (!n.hasChildNodes()) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11826
								n.appendChild(ed.getDoc().createTextNode('\u00a0'));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11827
								return false; // Break the loop one padding is enough
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11828
							}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11829
						});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11830
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11831
				});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11832
			});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11833
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11834
			// IE specific fixes
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11835
			if (isIE) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11836
				// Replaces IE:s auto generated paragraphs with the specified element name
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11837
				if (s.element != 'P') {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11838
					ed.onKeyPress.add(function(ed, e) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11839
						t.lastElm = ed.selection.getNode().nodeName;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11840
					});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11841
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11842
					ed.onKeyUp.add(function(ed, e) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11843
						var bl, sel = ed.selection, n = sel.getNode(), b = ed.getBody();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11844
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11845
						if (b.childNodes.length === 1 && n.nodeName == 'P') {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11846
							n = ren(n, s.element);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11847
							sel.select(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11848
							sel.collapse();
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11849
							ed.nodeChanged();
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11850
						} else if (e.keyCode == 13 && !e.shiftKey && t.lastElm != 'P') {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11851
							bl = ed.dom.getParent(n, 'p');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11852
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11853
							if (bl) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11854
								ren(bl, s.element);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11855
								ed.nodeChanged();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11856
							}
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11857
						}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11858
					});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11859
				}
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 11860
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11861
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11862
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11863
		find : function(n, t, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11864
			var ed = this.editor, w = ed.getDoc().createTreeWalker(n, 4, null, false), c = -1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11865
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11866
			while (n = w.nextNode()) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11867
				c++;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11868
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11869
				// Index by node
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11870
				if (t == 0 && n == s)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11871
					return c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11872
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11873
				// Node by index
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11874
				if (t == 1 && c == s)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11875
					return n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11876
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11877
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11878
			return -1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11879
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11880
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11881
		forceRoots : function(ed, e) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11882
			var t = this, ed = t.editor, b = ed.getBody(), d = ed.getDoc(), se = ed.selection, s = se.getSel(), r = se.getRng(), si = -2, ei, so, eo, tr, c = -0xFFFFFF;
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11883
			var nx, bl, bp, sp, le, nl = b.childNodes, i, n, eid;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11884
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11885
			// Fix for bug #1863847
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11886
			//if (e && e.keyCode == 13)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11887
			//	return true;
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11888
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11889
			// Wrap non blocks into blocks
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11890
			for (i = nl.length - 1; i >= 0; i--) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11891
				nx = nl[i];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11892
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11893
				// Is text or non block element
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11894
				if (nx.nodeType === 3 || (!t.dom.isBlock(nx) && nx.nodeType !== 8 && !/^(script|mce:script|style|mce:style)$/i.test(nx.nodeName))) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11895
					if (!bl) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11896
						// Create new block but ignore whitespace
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11897
						if (nx.nodeType != 3 || /[^\s]/g.test(nx.nodeValue)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11898
							// Store selection
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11899
							if (si == -2 && r) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11900
								if (!isIE) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11901
									// If selection is element then mark it
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11902
									if (r.startContainer.nodeType == 1 && (n = r.startContainer.childNodes[r.startOffset]) && n.nodeType == 1) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11903
										// Save the id of the selected element
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11904
										eid = n.getAttribute("id");
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11905
										n.setAttribute("id", "__mce");
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11906
									} else {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11907
										// If element is inside body, might not be the case in contentEdiable mode
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11908
										if (ed.dom.getParent(r.startContainer, function(e) {return e === b;})) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11909
											so = r.startOffset;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11910
											eo = r.endOffset;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11911
											si = t.find(b, 0, r.startContainer);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11912
											ei = t.find(b, 0, r.endContainer);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11913
										}
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11914
									}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11915
								} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11916
									tr = d.body.createTextRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11917
									tr.moveToElementText(b);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11918
									tr.collapse(1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11919
									bp = tr.move('character', c) * -1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11920
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11921
									tr = r.duplicate();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11922
									tr.collapse(1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11923
									sp = tr.move('character', c) * -1;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11924
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11925
									tr = r.duplicate();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11926
									tr.collapse(0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11927
									le = (tr.move('character', c) * -1) - sp;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11928
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11929
									si = sp - bp;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11930
									ei = le;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11931
								}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11932
							}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11933
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11934
							// Uses replaceChild instead of cloneNode since it removes selected attribute from option elements on IE
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11935
							// See: http://support.microsoft.com/kb/829907
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 11936
							bl = ed.dom.create(ed.settings.forced_root_block);
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11937
							nx.parentNode.replaceChild(bl, nx);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 11938
							bl.appendChild(nx);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11939
						}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11940
					} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11941
						if (bl.hasChildNodes())
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11942
							bl.insertBefore(nx, bl.firstChild);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11943
						else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11944
							bl.appendChild(nx);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11945
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11946
				} else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11947
					bl = null; // Time to create new block
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11948
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11949
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11950
			// Restore selection
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11951
			if (si != -2) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11952
				if (!isIE) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 11953
					bl = b.getElementsByTagName(ed.settings.element)[0];
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11954
					r = d.createRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11955
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11956
					// Select last location or generated block
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11957
					if (si != -1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11958
						r.setStart(t.find(b, 1, si), so);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11959
					else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11960
						r.setStart(bl, 0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11961
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11962
					// Select last location or generated block
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11963
					if (ei != -1)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11964
						r.setEnd(t.find(b, 1, ei), eo);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11965
					else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11966
						r.setEnd(bl, 0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11967
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11968
					if (s) {
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11969
						s.removeAllRanges();
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11970
						s.addRange(r);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 11971
					}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11972
				} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11973
					try {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11974
						r = s.createRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11975
						r.moveToElementText(b);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11976
						r.collapse(1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11977
						r.moveStart('character', si);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11978
						r.moveEnd('character', ei);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11979
						r.select();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11980
					} catch (ex) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11981
						// Ignore
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11982
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11983
				}
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11984
			} else if (!isIE && (n = ed.dom.get('__mce'))) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11985
				// Restore the id of the selected element
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11986
				if (eid)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11987
					n.setAttribute('id', eid);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11988
				else
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11989
					n.removeAttribute('id');
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11990
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11991
				// Move caret before selected element
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11992
				r = d.createRange();
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11993
				r.setStartBefore(n);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11994
				r.setEndBefore(n);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 11995
				se.setRng(r);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11996
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11997
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11998
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 11999
		getParentBlock : function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12000
			var d = this.dom;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12001
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12002
			return d.getParent(n, d.isBlock);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12003
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12004
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12005
		insertPara : function(e) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12006
			var t = this, ed = t.editor, dom = ed.dom, d = ed.getDoc(), se = ed.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body;
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12007
			var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12008
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12009
			// If root blocks are forced then use Operas default behavior since it's really good
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12010
// Removed due to bug: #1853816
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12011
//			if (se.forced_root_block && isOpera)
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12012
//				return true;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12013
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12014
			// Setup before range
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12015
			rb = d.createRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12016
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12017
			// If is before the first block element and in body, then move it into first block element
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12018
			rb.setStart(s.anchorNode, s.anchorOffset);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12019
			rb.collapse(true);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12020
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12021
			// Setup after range
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12022
			ra = d.createRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12023
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12024
			// If is before the first block element and in body, then move it into first block element
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12025
			ra.setStart(s.focusNode, s.focusOffset);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12026
			ra.collapse(true);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12027
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12028
			// Setup start/end points
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12029
			dir = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12030
			sn = dir ? s.anchorNode : s.focusNode;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12031
			so = dir ? s.anchorOffset : s.focusOffset;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12032
			en = dir ? s.focusNode : s.anchorNode;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12033
			eo = dir ? s.focusOffset : s.anchorOffset;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12034
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12035
			// If selection is in empty table cell
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12036
			if (sn === en && /^(TD|TH)$/.test(sn.nodeName)) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12037
				if (sn.firstChild.nodeName == 'BR')
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12038
					dom.remove(sn.firstChild); // Remove BR
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12039
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12040
				// Create two new block elements
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12041
				if (sn.childNodes.length == 0) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12042
					ed.dom.add(sn, se.element, null, '<br />');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12043
					aft = ed.dom.add(sn, se.element, null, '<br />');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12044
				} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12045
					n = sn.innerHTML;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12046
					sn.innerHTML = '';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12047
					ed.dom.add(sn, se.element, null, n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12048
					aft = ed.dom.add(sn, se.element, null, '<br />');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12049
				}
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12050
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12051
				// Move caret into the last one
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12052
				r = d.createRange();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12053
				r.selectNodeContents(aft);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12054
				r.collapse(1);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12055
				ed.selection.setRng(r);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12056
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12057
				return false;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12058
			}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12059
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12060
			// If the caret is in an invalid location in FF we need to move it into the first block
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12061
			if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12062
				sn = en = sn.firstChild;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12063
				so = eo = 0;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12064
				rb = d.createRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12065
				rb.setStart(sn, 0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12066
				ra = d.createRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12067
				ra.setStart(en, 0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12068
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12069
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12070
			// Never use body as start or end node
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12071
			sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12072
			sn = sn.nodeName == "BODY" ? sn.firstChild : sn;
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12073
			en = en.nodeName == "HTML" ? d.body : en; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12074
			en = en.nodeName == "BODY" ? en.firstChild : en;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12075
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12076
			// Get start and end blocks
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12077
			sb = t.getParentBlock(sn);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12078
			eb = t.getParentBlock(en);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12079
			bn = sb ? sb.nodeName : se.element; // Get block name to create
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12080
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12081
			// Return inside list use default browser behavior
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12082
			if (t.dom.getParent(sb, 'ol,ul,pre'))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12083
				return true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12084
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12085
			// If caption or absolute layers then always generate new blocks within
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12086
			if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12087
				bn = se.element;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12088
				sb = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12089
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12090
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12091
			// If caption or absolute layers then always generate new blocks within
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12092
			if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12093
				bn = se.element;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12094
				eb = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12095
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12096
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12097
			// Use P instead
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12098
			if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(dom.getStyle(sb, 'float', 1)))) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12099
				bn = se.element;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12100
				sb = eb = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12101
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12102
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12103
			// Setup new before and after blocks
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12104
			bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12105
			aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12106
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12107
			// Remove id from after clone
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12108
			aft.removeAttribute('id');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12109
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12110
			// Is header and cursor is at the end, then force paragraph under
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12111
			if (/^(H[1-6])$/.test(bn) && isAtEnd(r, sb))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12112
				aft = ed.dom.create(se.element);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12113
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12114
			// Find start chop node
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12115
			n = sc = sn;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12116
			do {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12117
				if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12118
					break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12119
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12120
				sc = n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12121
			} while ((n = n.previousSibling ? n.previousSibling : n.parentNode));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12122
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12123
			// Find end chop node
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12124
			n = ec = en;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12125
			do {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12126
				if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12127
					break;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12128
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12129
				ec = n;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12130
			} while ((n = n.nextSibling ? n.nextSibling : n.parentNode));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12131
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12132
			// Place first chop part into before block element
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12133
			if (sc.nodeName == bn)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12134
				rb.setStart(sc, 0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12135
			else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12136
				rb.setStartBefore(sc);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12137
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12138
			rb.setEnd(sn, so);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12139
			bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12140
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12141
			// Place secnd chop part within new block element
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12142
			try {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12143
				ra.setEndAfter(ec);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12144
			} catch(ex) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12145
				//console.debug(s.focusNode, s.focusOffset);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12146
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12147
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12148
			ra.setStart(en, eo);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12149
			aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12150
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12151
			// Create range around everything
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12152
			r = d.createRange();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12153
			if (!sc.previousSibling && sc.parentNode.nodeName == bn) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12154
				r.setStartBefore(sc.parentNode);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12155
			} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12156
				if (rb.startContainer.nodeName == bn && rb.startOffset == 0)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12157
					r.setStartBefore(rb.startContainer);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12158
				else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12159
					r.setStart(rb.startContainer, rb.startOffset);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12160
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12161
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12162
			if (!ec.nextSibling && ec.parentNode.nodeName == bn)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12163
				r.setEndAfter(ec.parentNode);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12164
			else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12165
				r.setEnd(ra.endContainer, ra.endOffset);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12166
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12167
			// Delete and replace it with new block elements
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12168
			r.deleteContents();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12169
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12170
			if (isOpera)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12171
				ed.getWin().scrollTo(0, vp.y);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12172
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12173
			// Never wrap blocks in blocks
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12174
			if (bef.firstChild && bef.firstChild.nodeName == bn)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12175
				bef.innerHTML = bef.firstChild.innerHTML;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12176
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12177
			if (aft.firstChild && aft.firstChild.nodeName == bn)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12178
				aft.innerHTML = aft.firstChild.innerHTML;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12179
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12180
			// Padd empty blocks
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12181
			if (isEmpty(bef))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12182
				bef.innerHTML = '<br />';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12183
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12184
			function appendStyles(e, en) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12185
				var nl = [], nn, n, i;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12186
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12187
				e.innerHTML = '';
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12188
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12189
				// Make clones of style elements
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12190
				if (se.keep_styles) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12191
					n = en;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12192
					do {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12193
						// We only want style specific elements
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12194
						if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12195
							nn = n.cloneNode(false);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12196
							dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12197
							nl.push(nn);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12198
						}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12199
					} while (n = n.parentNode);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12200
				}
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12201
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12202
				// Append style elements to aft
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12203
				if (nl.length > 0) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12204
					for (i = nl.length - 1, nn = e; i >= 0; i--)
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12205
						nn = nn.appendChild(nl[i]);
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12206
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12207
					// Padd most inner style element
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12208
					nl[0].innerHTML = isOpera ? '&nbsp;' : '<br />'; // Extra space for Opera so that the caret can move there
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12209
					return nl[0]; // Move caret to most inner element
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12210
				} else
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12211
					e.innerHTML = isOpera ? '&nbsp;' : '<br />'; // Extra space for Opera so that the caret can move there
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12212
			};
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12213
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12214
			// Fill empty afterblook with current style
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12215
			if (isEmpty(aft))
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12216
				car = appendStyles(aft, en);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12217
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12218
			// Opera needs this one backwards for older versions
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12219
			if (isOpera && parseFloat(opera.version()) < 9.5) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12220
				r.insertNode(bef);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12221
				r.insertNode(aft);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12222
			} else {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12223
				r.insertNode(aft);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12224
				r.insertNode(bef);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12225
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12226
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12227
			// Normalize
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12228
			aft.normalize();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12229
			bef.normalize();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12230
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12231
			function first(n) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12232
				return d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false).nextNode() || n;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12233
			};
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12234
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12235
			// Move cursor and scroll into view
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12236
			r = d.createRange();
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12237
			r.selectNodeContents(isGecko ? first(car || aft) : car || aft);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12238
			r.collapse(1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12239
			s.removeAllRanges();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12240
			s.addRange(r);
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12241
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12242
			// scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12243
			y = ed.dom.getPos(aft).y;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12244
			ch = aft.clientHeight;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12245
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12246
			// Is element within viewport
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12247
			if (y < vp.y || y + ch > vp.y + vp.h) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12248
				ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12249
				//console.debug('SCROLL!', 'vp.y: ' + vp.y, 'y' + y, 'vp.h' + vp.h, 'clientHeight' + aft.clientHeight, 'yyy: ' + (y < vp.y ? y : y - vp.h + aft.clientHeight));
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12250
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12251
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12252
			return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12253
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12254
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12255
		backspaceDelete : function(e, bs) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12256
			var t = this, ed = t.editor, b = ed.getBody(), dom = ed.dom, n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n, w, tn;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12257
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12258
			/*
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12259
			var par, rng, nextBlock;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12260
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12261
			// Delete key will not merge paragraphs on Gecko so we need to do this manually
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12262
			// Hitting the delete key at the following caret position doesn't merge the elements <p>A|</p><p>B</p>
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12263
			// This logic will merge them into this: <p>A|B</p>
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12264
			if (e.keyCode == 46) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12265
				if (r.collapsed) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12266
					par = dom.getParent(sc, 'p,h1,h2,h3,h4,h5,h6,div');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12267
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12268
					if (par) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12269
						rng = dom.createRng();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12270
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12271
						rng.setStart(sc, r.startOffset);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12272
						rng.setEndAfter(par);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12273
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12274
						// Get number of characters to the right of the cursor if it's zero then we are at the end and need to merge the next block element
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12275
						if (dom.getOuterHTML(rng.cloneContents()).replace(/<[^>]+>/g, '').length == 0) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12276
							nextBlock = dom.getNext(par, 'p,h1,h2,h3,h4,h5,h6,div');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12277
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12278
							// Copy all children from next sibling block and remove it
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12279
							if (nextBlock) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12280
								each(nextBlock.childNodes, function(node) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12281
									par.appendChild(node.cloneNode(true));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12282
								});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12283
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12284
								dom.remove(nextBlock);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12285
							}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12286
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12287
							// Block the default even since the Gecko team might eventually fix this
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12288
							// We will remove this logic once they do we can't feature detect this one
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12289
							e.preventDefault();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12290
							return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12291
						}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12292
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12293
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12294
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12295
			*/
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12296
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12297
			// The caret sometimes gets stuck in Gecko if you delete empty paragraphs
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12298
			// This workaround removes the element by hand and moves the caret to the previous element
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12299
			if (sc && ed.dom.isBlock(sc) && !/^(TD|TH)$/.test(sc.nodeName) && bs) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12300
				if (sc.childNodes.length == 0 || (sc.childNodes.length == 1 && sc.firstChild.nodeName == 'BR')) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12301
					// Find previous block element
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12302
					n = sc;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12303
					while ((n = n.previousSibling) && !ed.dom.isBlock(n)) ;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12304
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 12305
					if (n) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12306
						if (sc != b.firstChild) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12307
							// Find last text node
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12308
							w = ed.dom.doc.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12309
							while (tn = w.nextNode())
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12310
								n = tn;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12311
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12312
							// Place caret at the end of last text node
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12313
							r = ed.getDoc().createRange();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12314
							r.setStart(n, n.nodeValue ? n.nodeValue.length : 0);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12315
							r.setEnd(n, n.nodeValue ? n.nodeValue.length : 0);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12316
							se.setRng(r);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12317
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12318
							// Remove the target container
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12319
							ed.dom.remove(sc);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12320
						}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12321
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12322
						return Event.cancel(e);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12323
					}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12324
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12325
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12326
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12327
			// Gecko generates BR elements here and there, we don't like those so lets remove them
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12328
			function handler(e) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12329
				var pr;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12330
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12331
				e = e.target;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12332
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12333
				// A new BR was created in a block element, remove it
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12334
				if (e && e.parentNode && e.nodeName == 'BR' && (n = t.getParentBlock(e))) {
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12335
					pr = e.previousSibling;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12336
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12337
					Event.remove(b, 'DOMNodeInserted', handler);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12338
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12339
					// Is there whitespace at the end of the node before then we might need the pesky BR
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12340
					// to place the caret at a correct location see bug: #2013943
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12341
					if (pr && pr.nodeType == 3 && /\s+$/.test(pr.nodeValue))
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12342
						return;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12343
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12344
					// Only remove BR elements that got inserted in the middle of the text
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12345
					if (e.previousSibling || e.nextSibling)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12346
						ed.dom.remove(e);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12347
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12348
			};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12349
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12350
			// Listen for new nodes
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12351
			Event._add(b, 'DOMNodeInserted', handler);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12352
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12353
			// Remove listener
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12354
			window.setTimeout(function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12355
				Event._remove(b, 'DOMNodeInserted', handler);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12356
			}, 1);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12357
		}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12358
	});
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12359
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12360
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12361
	// Shorten names
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12362
	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12363
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12364
	tinymce.create('tinymce.ControlManager', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12365
		ControlManager : function(ed, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12366
			var t = this, i;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12367
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12368
			s = s || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12369
			t.editor = ed;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12370
			t.controls = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12371
			t.onAdd = new tinymce.util.Dispatcher(t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12372
			t.onPostRender = new tinymce.util.Dispatcher(t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12373
			t.prefix = s.prefix || ed.id + '_';
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12374
			t._cls = {};
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12375
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12376
			t.onPostRender.add(function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12377
				each(t.controls, function(c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12378
					c.postRender();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12379
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12380
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12381
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12382
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12383
		get : function(id) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12384
			return this.controls[this.prefix + id] || this.controls[id];
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12385
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12386
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12387
		setActive : function(id, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12388
			var c = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12389
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12390
			if (c = this.get(id))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12391
				c.setActive(s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12392
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12393
			return c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12394
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12395
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12396
		setDisabled : function(id, s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12397
			var c = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12398
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12399
			if (c = this.get(id))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12400
				c.setDisabled(s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12401
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12402
			return c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12403
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12404
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12405
		add : function(c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12406
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12407
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12408
			if (c) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12409
				t.controls[c.id] = c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12410
				t.onAdd.dispatch(c, t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12411
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12412
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12413
			return c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12414
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12415
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12416
		createControl : function(n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12417
			var c, t = this, ed = t.editor;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12418
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12419
			each(ed.plugins, function(p) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12420
				if (p.createControl) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12421
					c = p.createControl(n, t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12422
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12423
					if (c)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12424
						return false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12425
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12426
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12427
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12428
			switch (n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12429
				case "|":
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12430
				case "separator":
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12431
					return t.createSeparator();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12432
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12433
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12434
			if (!c && ed.buttons && (c = ed.buttons[n]))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12435
				return t.createButton(n, c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12436
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12437
			return t.add(c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12438
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12439
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12440
		createDropMenu : function(id, s, cc) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12441
			var t = this, ed = t.editor, c, bm, v, cls;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12442
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12443
			s = extend({
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12444
				'class' : 'mceDropDown',
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12445
				constrain : ed.settings.constrain_menus
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12446
			}, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12447
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12448
			s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin';
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 12449
			if (v = ed.getParam('skin_variant'))
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 12450
				s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12451
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12452
			id = t.prefix + id;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12453
			cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12454
			c = t.controls[id] = new cls(id, s);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12455
			c.onAddItem.add(function(c, o) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12456
				var s = o.settings;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12457
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12458
				s.title = ed.getLang(s.title, s.title);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12459
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12460
				if (!s.onclick) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12461
					s.onclick = function(v) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12462
						ed.execCommand(s.cmd, s.ui || false, s.value);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12463
					};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12464
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12465
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12466
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12467
			ed.onRemove.add(function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12468
				c.destroy();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12469
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12470
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12471
			// Fix for bug #1897785, #1898007
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12472
			if (tinymce.isIE) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12473
				c.onShowMenu.add(function() {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12474
					// IE 8 needs focus in order to store away a range with the current collapsed caret location
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12475
					ed.focus();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12476
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12477
					bm = ed.selection.getBookmark(1);
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12478
				});
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12479
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12480
				c.onHideMenu.add(function() {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12481
					if (bm) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12482
						ed.selection.moveToBookmark(bm);
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12483
						bm = 0;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12484
					}
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12485
				});
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12486
			}
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12487
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12488
			return t.add(c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12489
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12490
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12491
		createListBox : function(id, s, cc) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12492
			var t = this, ed = t.editor, cmd, c, cls;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12493
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12494
			if (t.get(id))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12495
				return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12496
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12497
			s.title = ed.translate(s.title);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12498
			s.scope = s.scope || ed;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12499
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12500
			if (!s.onselect) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12501
				s.onselect = function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12502
					ed.execCommand(s.cmd, s.ui || false, v || s.value);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12503
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12504
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12505
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12506
			s = extend({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12507
				title : s.title,
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 12508
				'class' : 'mce_' + id,
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12509
				scope : s.scope,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12510
				control_manager : t
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12511
			}, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12512
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12513
			id = t.prefix + id;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12514
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12515
			if (ed.settings.use_native_selects)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12516
				c = new tinymce.ui.NativeListBox(id, s);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12517
			else {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12518
				cls = cc || t._cls.listbox || tinymce.ui.ListBox;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12519
				c = new cls(id, s);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12520
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12521
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12522
			t.controls[id] = c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12523
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12524
			// Fix focus problem in Safari
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12525
			if (tinymce.isWebKit) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12526
				c.onPostRender.add(function(c, n) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12527
					// Store bookmark on mousedown
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12528
					Event.add(n, 'mousedown', function() {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12529
						ed.bookmark = ed.selection.getBookmark(1);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12530
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12531
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12532
					// Restore on focus, since it might be lost
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12533
					Event.add(n, 'focus', function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12534
						ed.selection.moveToBookmark(ed.bookmark);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12535
						ed.bookmark = null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12536
					});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12537
				});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12538
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12539
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12540
			if (c.hideMenu)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12541
				ed.onMouseDown.add(c.hideMenu, c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12542
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12543
			return t.add(c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12544
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12545
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12546
		createButton : function(id, s, cc) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12547
			var t = this, ed = t.editor, o, c, cls;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12548
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12549
			if (t.get(id))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12550
				return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12551
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12552
			s.title = ed.translate(s.title);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12553
			s.label = ed.translate(s.label);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12554
			s.scope = s.scope || ed;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12555
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12556
			if (!s.onclick && !s.menu_button) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12557
				s.onclick = function() {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12558
					ed.execCommand(s.cmd, s.ui || false, s.value);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12559
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12560
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12561
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12562
			s = extend({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12563
				title : s.title,
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 12564
				'class' : 'mce_' + id,
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12565
				unavailable_prefix : ed.getLang('unavailable', ''),
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12566
				scope : s.scope,
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12567
				control_manager : t
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12568
			}, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12569
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12570
			id = t.prefix + id;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12571
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12572
			if (s.menu_button) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12573
				cls = cc || t._cls.menubutton || tinymce.ui.MenuButton;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12574
				c = new cls(id, s);
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12575
				ed.onMouseDown.add(c.hideMenu, c);
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12576
			} else {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12577
				cls = t._cls.button || tinymce.ui.Button;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12578
				c = new cls(id, s);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12579
			}
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12580
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12581
			return t.add(c);
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12582
		},
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12583
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12584
		createMenuButton : function(id, s, cc) {
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12585
			s = s || {};
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12586
			s.menu_button = 1;
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12587
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12588
			return this.createButton(id, s, cc);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12589
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12590
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12591
		createSplitButton : function(id, s, cc) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12592
			var t = this, ed = t.editor, cmd, c, cls;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12593
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12594
			if (t.get(id))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12595
				return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12596
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12597
			s.title = ed.translate(s.title);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12598
			s.scope = s.scope || ed;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12599
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12600
			if (!s.onclick) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12601
				s.onclick = function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12602
					ed.execCommand(s.cmd, s.ui || false, v || s.value);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12603
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12604
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12605
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12606
			if (!s.onselect) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12607
				s.onselect = function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12608
					ed.execCommand(s.cmd, s.ui || false, v || s.value);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12609
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12610
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12611
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12612
			s = extend({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12613
				title : s.title,
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 12614
				'class' : 'mce_' + id,
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12615
				scope : s.scope,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12616
				control_manager : t
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12617
			}, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12618
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12619
			id = t.prefix + id;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12620
			cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12621
			c = t.add(new cls(id, s));
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12622
			ed.onMouseDown.add(c.hideMenu, c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12623
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12624
			return c;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12625
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12626
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12627
		createColorSplitButton : function(id, s, cc) {
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12628
			var t = this, ed = t.editor, cmd, c, cls, bm;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12629
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12630
			if (t.get(id))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12631
				return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12632
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12633
			s.title = ed.translate(s.title);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12634
			s.scope = s.scope || ed;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12635
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12636
			if (!s.onclick) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12637
				s.onclick = function(v) {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12638
					if (tinymce.isIE)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12639
						bm = ed.selection.getBookmark(1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12640
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12641
					ed.execCommand(s.cmd, s.ui || false, v || s.value);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12642
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12643
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12644
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12645
			if (!s.onselect) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12646
				s.onselect = function(v) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12647
					ed.execCommand(s.cmd, s.ui || false, v || s.value);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12648
				};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12649
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12650
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12651
			s = extend({
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12652
				title : s.title,
476
f26a69c40431 Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
Dan
parents: 459
diff changeset
 12653
				'class' : 'mce_' + id,
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12654
				'menu_class' : ed.getParam('skin') + 'Skin',
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12655
				scope : s.scope,
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12656
				more_colors_title : ed.getLang('more_colors')
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12657
			}, s);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12658
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12659
			id = t.prefix + id;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12660
			cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12661
			c = new cls(id, s);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12662
			ed.onMouseDown.add(c.hideMenu, c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12663
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12664
			// Remove the menu element when the editor is removed
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12665
			ed.onRemove.add(function() {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12666
				c.destroy();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12667
			});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12668
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12669
			// Fix for bug #1897785, #1898007
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12670
			if (tinymce.isIE) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12671
				c.onShowMenu.add(function() {
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12672
					// IE 8 needs focus in order to store away a range with the current collapsed caret location
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12673
					ed.focus();
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12674
					bm = ed.selection.getBookmark(1);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12675
				});
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12676
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12677
				c.onHideMenu.add(function() {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12678
					if (bm) {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12679
						ed.selection.moveToBookmark(bm);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12680
						bm = 0;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12681
					}
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12682
				});
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12683
			}
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12684
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12685
			return t.add(c);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12686
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12687
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12688
		createToolbar : function(id, s, cc) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12689
			var c, t = this, cls;
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12690
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12691
			id = t.prefix + id;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12692
			cls = cc || t._cls.toolbar || tinymce.ui.Toolbar;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12693
			c = new cls(id, s);
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12694
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12695
			if (t.get(id))
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12696
				return null;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12697
395
fa4c5ecb7c9a Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents: 335
diff changeset
 12698
			return t.add(c);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12699
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12700
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12701
		createSeparator : function(cc) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12702
			var cls = cc || this._cls.separator || tinymce.ui.Separator;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12703
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12704
			return new cls();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12705
		},
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12706
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12707
		setControlType : function(n, c) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12708
			return this._cls[n.toLowerCase()] = c;
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12709
		},
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12710
	
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12711
		destroy : function() {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12712
			each(this.controls, function(c) {
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12713
				c.destroy();
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12714
			});
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12715
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12716
			this.controls = null;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12717
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12718
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12719
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12720
(function(tinymce) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12721
	var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12722
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12723
	tinymce.create('tinymce.WindowManager', {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12724
		WindowManager : function(ed) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12725
			var t = this;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12726
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12727
			t.editor = ed;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12728
			t.onOpen = new Dispatcher(t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12729
			t.onClose = new Dispatcher(t);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12730
			t.params = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12731
			t.features = {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12732
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12733
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12734
		open : function(s, p) {
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12735
			var t = this, f = '', x, y, mo = t.editor.settings.dialog_type == 'modal', w, sw, sh, vp = tinymce.DOM.getViewPort(), u;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12736
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12737
			// Default some options
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12738
			s = s || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12739
			p = p || {};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12740
			sw = isOpera ? vp.w : screen.width; // Opera uses windows inside the Opera window
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12741
			sh = isOpera ? vp.h : screen.height;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12742
			s.name = s.name || 'mc_' + new Date().getTime();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12743
			s.width = parseInt(s.width || 320);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12744
			s.height = parseInt(s.height || 240);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12745
			s.resizable = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12746
			s.left = s.left || parseInt(sw / 2.0) - (s.width / 2.0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12747
			s.top = s.top || parseInt(sh / 2.0) - (s.height / 2.0);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12748
			p.inline = false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12749
			p.mce_width = s.width;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12750
			p.mce_height = s.height;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12751
			p.mce_auto_focus = s.auto_focus;
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12752
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12753
			if (mo) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12754
				if (isIE) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12755
					s.center = true;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12756
					s.help = false;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12757
					s.dialogWidth = s.width + 'px';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12758
					s.dialogHeight = s.height + 'px';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12759
					s.scroll = s.scrollbars || false;
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 543
diff changeset
 12760
				}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12761
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12762
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12763
			// Build features string
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12764
			each(s, function(v, k) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12765
				if (tinymce.is(v, 'boolean'))
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12766
					v = v ? 'yes' : 'no';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12767
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12768
				if (!/^(name|url)$/.test(k)) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12769
					if (isIE && mo)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12770
						f += (f ? ';' : '') + k + ':' + v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12771
					else
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12772
						f += (f ? ',' : '') + k + '=' + v;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12773
				}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12774
			});
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12775
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12776
			t.features = s;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12777
			t.params = p;
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12778
			t.onOpen.dispatch(t, s, p);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12779
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12780
			u = s.url || s.file;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12781
			u = tinymce._addVer(u);
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12782
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12783
			try {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12784
				if (isIE && mo) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12785
					w = 1;
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12786
					window.showModalDialog(u, window, f);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12787
				} else
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12788
					w = window.open(u, s.name, f);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12789
			} catch (ex) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12790
				// Ignore
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12791
			}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12792
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12793
			if (!w)
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12794
				alert(t.editor.getLang('popup_blocked'));
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12795
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12796
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12797
		close : function(w) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12798
			w.close();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12799
			this.onClose.dispatch(this);
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12800
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12801
459
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12802
		createInstance : function(cl, a, b, c, d, e) {
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12803
			var f = tinymce.resolve(cl);
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12804
31c23016ab62 Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents: 395
diff changeset
 12805
			return new f(a, b, c, d, e);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12806
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12807
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12808
		confirm : function(t, cb, s, w) {
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12809
			w = w || window;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12810
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12811
			cb.call(s || this, w.confirm(this._decode(this.editor.getLang(t, t))));
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12812
		},
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12813
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12814
		alert : function(tx, cb, s, w) {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12815
			var t = this;
778
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12816
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12817
			w = w || window;
57ce13805b6f Upgraded TinyMCE to version 3.2.1.1
Dan
parents: 588
diff changeset
 12818
			w.alert(t._decode(t.editor.getLang(tx, tx)));
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12819
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12820
			if (cb)
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 476
diff changeset
 12821
				cb.call(s || t);
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12822
		},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12823
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12824
		// Internal functions
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12825
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12826
		_decode : function(s) {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12827
			return tinymce.DOM.decode(s).replace(/\\n/g, '\n');
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12828
		}
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12829
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12830
}(tinymce));(function(tinymce) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12831
	tinymce.CommandManager = function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12832
		var execCommands = {}, queryStateCommands = {}, queryValueCommands = {};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12833
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12834
		function add(collection, cmd, func, scope) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12835
			if (typeof(cmd) == 'string')
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12836
				cmd = [cmd];
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12837
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12838
			tinymce.each(cmd, function(cmd) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12839
				collection[cmd.toLowerCase()] = {func : func, scope : scope};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12840
			});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12841
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12842
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12843
		tinymce.extend(this, {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12844
			add : function(cmd, func, scope) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12845
				add(execCommands, cmd, func, scope);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12846
			},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12847
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12848
			addQueryStateHandler : function(cmd, func, scope) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12849
				add(queryStateCommands, cmd, func, scope);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12850
			},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12851
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12852
			addQueryValueHandler : function(cmd, func, scope) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12853
				add(queryValueCommands, cmd, func, scope);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12854
			},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12855
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12856
			execCommand : function(scope, cmd, ui, value, args) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12857
				if (cmd = execCommands[cmd.toLowerCase()]) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12858
					if (cmd.func.call(scope || cmd.scope, ui, value, args) !== false)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12859
						return true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12860
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12861
			},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12862
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12863
			queryCommandValue : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12864
				if (cmd = queryValueCommands[cmd.toLowerCase()])
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12865
					return cmd.func.call(scope || cmd.scope, ui, value, args);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12866
			},
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12867
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12868
			queryCommandState : function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12869
				if (cmd = queryStateCommands[cmd.toLowerCase()])
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12870
					return cmd.func.call(scope || cmd.scope, ui, value, args);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12871
			}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents: 117
diff changeset
 12872
		});
1193
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12873
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12874
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12875
	tinymce.GlobalCommands = new tinymce.CommandManager();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12876
})(tinymce);(function(tinymce) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12877
	function processRange(dom, start, end, callback) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12878
		var ancestor, n, startPoint, endPoint, sib;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12879
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12880
		function findEndPoint(n, c) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12881
			do {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12882
				if (n.parentNode == c)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12883
					return n;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12884
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12885
				n = n.parentNode;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12886
			} while(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12887
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12888
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12889
		function process(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12890
			callback(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12891
			tinymce.walk(n, callback, 'childNodes');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12892
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12893
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12894
		// Find common ancestor and end points
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12895
		ancestor = dom.findCommonAncestor(start, end);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12896
		startPoint = findEndPoint(start, ancestor) || start;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12897
		endPoint = findEndPoint(end, ancestor) || end;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12898
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12899
		// Process left leaf
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12900
		for (n = start; n && n != startPoint; n = n.parentNode) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12901
			for (sib = n.nextSibling; sib; sib = sib.nextSibling)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12902
				process(sib);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12903
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12904
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12905
		// Process middle from start to end point
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12906
		if (startPoint != endPoint) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12907
			for (n = startPoint.nextSibling; n && n != endPoint; n = n.nextSibling)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12908
				process(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12909
		} else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12910
			process(startPoint);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12911
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12912
		// Process right leaf
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12913
		for (n = end; n && n != endPoint; n = n.parentNode) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12914
			for (sib = n.previousSibling; sib; sib = sib.previousSibling)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12915
				process(sib);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12916
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12917
	};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12918
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12919
	tinymce.GlobalCommands.add('RemoveFormat', function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12920
		var ed = this, dom = ed.dom, s = ed.selection, r = s.getRng(1), nodes = [], bm, start, end, sc, so, ec, eo, n;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12921
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12922
		function findFormatRoot(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12923
			var sp;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12924
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12925
			dom.getParent(n, function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12926
				if (dom.is(n, ed.getParam('removeformat_selector')))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12927
					sp = n;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12928
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12929
				return dom.isBlock(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12930
			}, ed.getBody());
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12931
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12932
			return sp;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12933
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12934
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12935
		function collect(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12936
			if (dom.is(n, ed.getParam('removeformat_selector')))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12937
				nodes.push(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12938
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12939
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12940
		function walk(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12941
			collect(n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12942
			tinymce.walk(n, collect, 'childNodes');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12943
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12944
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12945
		bm = s.getBookmark();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12946
		sc = r.startContainer;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12947
		ec = r.endContainer;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12948
		so = r.startOffset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12949
		eo = r.endOffset;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12950
		sc = sc.nodeType == 1 ? sc.childNodes[Math.min(so, sc.childNodes.length - 1)] : sc;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12951
		ec = ec.nodeType == 1 ? ec.childNodes[Math.min(so == eo ? eo : eo - 1, ec.childNodes.length - 1)] : ec;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12952
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12953
		// Same container
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12954
		if (sc == ec) { // TEXT_NODE
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12955
			start = findFormatRoot(sc);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12956
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12957
			// Handle single text node
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12958
			if (sc.nodeType == 3) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12959
				if (start && start.nodeType == 1) { // ELEMENT
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12960
					n = sc.splitText(so);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12961
					n.splitText(eo - so);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12962
					dom.split(start, n);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12963
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12964
					s.moveToBookmark(bm);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12965
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12966
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12967
				return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12968
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12969
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12970
			// Handle single element
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12971
			walk(dom.split(start, sc) || sc);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12972
		} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12973
			// Find start/end format root
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12974
			start = findFormatRoot(sc);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12975
			end = findFormatRoot(ec);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12976
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12977
			// Split start text node
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12978
			if (start) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12979
				if (sc.nodeType == 3) { // TEXT
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12980
					// Since IE doesn't support white space nodes in the DOM we need to
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12981
					// add this invisible character so that the splitText function can split the contents
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12982
					if (so == sc.nodeValue.length)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12983
						sc.nodeValue += '\uFEFF'; // Yet another pesky IE fix
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12984
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12985
					sc = sc.splitText(so);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12986
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12987
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12988
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12989
			// Split end text node
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12990
			if (end) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12991
				if (ec.nodeType == 3) // TEXT
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12992
					ec.splitText(eo);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12993
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12994
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12995
			// If the start and end format root is the same then we need to wrap
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12996
			// the end node in a span since the split calls might change the reference
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12997
			// Example: <p><b><em>x[yz<span>---</span>12]3</em></b></p>
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12998
			if (start && start == end)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 12999
				dom.replace(dom.create('span', {id : '__end'}, ec.cloneNode(true)), ec);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13000
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13001
			// Split all start containers down to the format root
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13002
			if (start)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13003
				start = dom.split(start, sc);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13004
			else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13005
				start = sc;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13006
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13007
			// If there is a span wrapper use that one instead
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13008
			if (n = dom.get('__end')) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13009
				ec = n;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13010
				end = findFormatRoot(ec);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13011
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13012
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13013
			// Split all end containers down to the format root
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13014
			if (end)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13015
				end = dom.split(end, ec);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13016
			else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13017
				end = ec;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13018
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13019
			// Collect nodes in between
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13020
			processRange(dom, start, end, collect);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13021
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13022
			// Remove invisible character for IE workaround if we find it
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13023
			if (sc.nodeValue == '\uFEFF')
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13024
				sc.nodeValue = '';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13025
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13026
			// Process start/end container elements
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13027
			walk(ec);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13028
			walk(sc);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13029
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13030
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13031
		// Remove all collected nodes
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13032
		tinymce.each(nodes, function(n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13033
			dom.remove(n, 1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13034
		});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13035
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13036
		// Remove leftover wrapper
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13037
		dom.remove('__end', 1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13038
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13039
		s.moveToBookmark(bm);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13040
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13041
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13042
(function(tinymce) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13043
	tinymce.GlobalCommands.add('mceBlockQuote', function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13044
		var ed = this, s = ed.selection, dom = ed.dom, sb, eb, n, bm, bq, r, bq2, i, nl;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13045
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13046
		function getBQ(e) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13047
			return dom.getParent(e, function(n) {return n.nodeName === 'BLOCKQUOTE';});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13048
		};
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13049
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13050
		// Get start/end block
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13051
		sb = dom.getParent(s.getStart(), dom.isBlock);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13052
		eb = dom.getParent(s.getEnd(), dom.isBlock);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13053
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13054
		// Remove blockquote(s)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13055
		if (bq = getBQ(sb)) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13056
			if (sb != eb || sb.childNodes.length > 1 || (sb.childNodes.length == 1 && sb.firstChild.nodeName != 'BR'))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13057
				bm = s.getBookmark();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13058
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13059
			// Move all elements after the end block into new bq
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13060
			if (getBQ(eb)) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13061
				bq2 = bq.cloneNode(false);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13062
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13063
				while (n = eb.nextSibling)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13064
					bq2.appendChild(n.parentNode.removeChild(n));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13065
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13066
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13067
			// Add new bq after
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13068
			if (bq2)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13069
				dom.insertAfter(bq2, bq);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13070
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13071
			// Move all selected blocks after the current bq
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13072
			nl = s.getSelectedBlocks(sb, eb);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13073
			for (i = nl.length - 1; i >= 0; i--) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13074
				dom.insertAfter(nl[i], bq);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13075
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13076
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13077
			// Empty bq, then remove it
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13078
			if (/^\s*$/.test(bq.innerHTML))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13079
				dom.remove(bq, 1); // Keep children so boomark restoration works correctly
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13080
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13081
			// Empty bq, then remote it
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13082
			if (bq2 && /^\s*$/.test(bq2.innerHTML))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13083
				dom.remove(bq2, 1); // Keep children so boomark restoration works correctly
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13084
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13085
			if (!bm) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13086
				// Move caret inside empty block element
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13087
				if (!tinymce.isIE) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13088
					r = ed.getDoc().createRange();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13089
					r.setStart(sb, 0);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13090
					r.setEnd(sb, 0);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13091
					s.setRng(r);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13092
				} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13093
					s.select(sb);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13094
					s.collapse(0);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13095
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13096
					// IE misses the empty block some times element so we must move back the caret
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13097
					if (dom.getParent(s.getStart(), dom.isBlock) != sb) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13098
						r = s.getRng();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13099
						r.move('character', -1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13100
						r.select();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13101
					}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13102
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13103
			} else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13104
				ed.selection.moveToBookmark(bm);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13105
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13106
			return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13107
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13108
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13109
		// Since IE can start with a totally empty document we need to add the first bq and paragraph
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13110
		if (tinymce.isIE && !sb && !eb) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13111
			ed.getDoc().execCommand('Indent');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13112
			n = getBQ(s.getNode());
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13113
			n.style.margin = n.dir = ''; // IE adds margin and dir to bq
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13114
			return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13115
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13116
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13117
		if (!sb || !eb)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13118
			return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13119
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13120
		// If empty paragraph node then do not use bookmark
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13121
		if (sb != eb || sb.childNodes.length > 1 || (sb.childNodes.length == 1 && sb.firstChild.nodeName != 'BR'))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13122
			bm = s.getBookmark();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13123
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13124
		// Move selected block elements into a bq
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13125
		tinymce.each(s.getSelectedBlocks(getBQ(s.getStart()), getBQ(s.getEnd())), function(e) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13126
			// Found existing BQ add to this one
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13127
			if (e.nodeName == 'BLOCKQUOTE' && !bq) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13128
				bq = e;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13129
				return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13130
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13131
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13132
			// No BQ found, create one
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13133
			if (!bq) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13134
				bq = dom.create('blockquote');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13135
				e.parentNode.insertBefore(bq, e);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13136
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13137
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13138
			// Add children from existing BQ
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13139
			if (e.nodeName == 'BLOCKQUOTE' && bq) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13140
				n = e.firstChild;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13141
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13142
				while (n) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13143
					bq.appendChild(n.cloneNode(true));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13144
					n = n.nextSibling;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13145
				}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13146
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13147
				dom.remove(e);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13148
				return;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13149
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13150
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13151
			// Add non BQ element to BQ
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13152
			bq.appendChild(dom.remove(e));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13153
		});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13154
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13155
		if (!bm) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13156
			// Move caret inside empty block element
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13157
			if (!tinymce.isIE) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13158
				r = ed.getDoc().createRange();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13159
				r.setStart(sb, 0);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13160
				r.setEnd(sb, 0);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13161
				s.setRng(r);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13162
			} else {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13163
				s.select(sb);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13164
				s.collapse(1);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13165
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13166
		} else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13167
			s.moveToBookmark(bm);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13168
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13169
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13170
(function(tinymce) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13171
	tinymce.each(['Cut', 'Copy', 'Paste'], function(cmd) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13172
		tinymce.GlobalCommands.add(cmd, function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13173
			var ed = this, doc = ed.getDoc();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13174
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13175
			try {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13176
				doc.execCommand(cmd, false, null);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13177
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13178
				// On WebKit the command will just be ignored if it's not enabled
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13179
				if (!doc.queryCommandEnabled(cmd))
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13180
					throw 'Error';
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13181
			} catch (ex) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13182
				if (tinymce.isGecko) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13183
					ed.windowManager.confirm(ed.getLang('clipboard_msg'), function(s) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13184
						if (s)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13185
							open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13186
					});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13187
				} else
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13188
					ed.windowManager.alert(ed.getLang('clipboard_no_support'));
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13189
			}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13190
		});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13191
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13192
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13193
(function(tinymce) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13194
	tinymce.GlobalCommands.add('InsertHorizontalRule', function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13195
		if (tinymce.isOpera)
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13196
			return this.getDoc().execCommand('InsertHorizontalRule', false, '');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13197
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13198
		this.selection.setContent('<hr />');
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13199
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13200
})(tinymce);
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13201
(function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13202
	var cmds = tinymce.GlobalCommands;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13203
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13204
	cmds.add(['mceEndUndoLevel', 'mceAddUndoLevel'], function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13205
		this.undoManager.add();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13206
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13207
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13208
	cmds.add('Undo', function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13209
		var ed = this;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13210
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13211
		if (ed.settings.custom_undo_redo) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13212
			ed.undoManager.undo();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13213
			ed.nodeChanged();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13214
			return true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13215
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13216
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13217
		return false; // Run browser command
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13218
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13219
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13220
	cmds.add('Redo', function() {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13221
		var ed = this;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13222
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13223
		if (ed.settings.custom_undo_redo) {
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13224
			ed.undoManager.redo();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13225
			ed.nodeChanged();
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13226
			return true;
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13227
		}
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13228
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13229
		return false; // Run browser command
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13230
	});
e3b94bd055dc TinyMCE: Bumped to v3.2.7
Dan
parents: 778
diff changeset
 13231
})();