includes/clientside/tinymce/plugins/advhr/js/rule.js
author Dan
Mon, 01 Feb 2010 02:15:04 -0500
changeset 1216 4125e19d3b27
parent 543 dffcbfbc4e59
permissions -rw-r--r--
Fixed more places where author_uid wasn't right.
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:
diff changeset
     1
var AdvHRDialog = {
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
     2
	init : 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:
diff changeset
     3
		var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), 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:
diff changeset
     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:
diff changeset
     5
		w = dom.getAttrib(n, 'width');
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
     6
		f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
     7
		f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
     8
		f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
     9
		selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : '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:
diff changeset
    10
	},
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
    11
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
    12
	update : function() {
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
    13
		var ed = tinyMCEPopup.editor, h, f = document.forms[0], 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:
diff changeset
    14
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
    15
		h = '<hr';
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
    16
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
    17
		if (f.size.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:
diff changeset
    18
			h += ' size="' + f.size.value + '"';
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
    19
			st += ' height:' + f.size.value + 'px;';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
    20
		}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
    21
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
    22
		if (f.width.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:
diff changeset
    23
			h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
    24
			st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
    25
		}
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
    26
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
    27
		if (f.noshade.checked) {
335
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
    28
			h += ' noshade="noshade"';
543
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
    29
			st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
    30
		}
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
    31
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
    32
		if (ed.settings.inline_styles)
dffcbfbc4e59 Upgraded TinyMCE to version 3.0.8
Dan
parents: 335
diff changeset
    33
			h += ' style="' + tinymce.trim(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:
diff changeset
    34
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
    35
		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:
diff changeset
    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:
diff changeset
    37
		ed.execCommand("mceInsertContent", false, 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:
diff changeset
    38
		tinyMCEPopup.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:
diff changeset
    39
	}
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
    40
};
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
    41
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
    42
tinyMCEPopup.requireLangPack();
67bd3121a12e Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff changeset
    43
tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);