tinymce/3rdparty/plugins/table/js/merge_cells.js
author Dan Fuhry <dan@enanocms.org>
Thu, 02 Jun 2011 06:24:03 -0400
changeset 0 c78d206bf01c
permissions -rw-r--r--
First commit... it works I guess
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     1
tinyMCEPopup.requireLangPack();
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     2
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     3
function init() {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     4
	var f = document.forms[0], v;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     5
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     6
	tinyMCEPopup.resizeToInnerSize();
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     7
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     8
	f.numcols.value = tinyMCEPopup.getWindowArg('numcols', 1);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
     9
	f.numrows.value = tinyMCEPopup.getWindowArg('numrows', 1);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    10
}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    11
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    12
function mergeCells() {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    13
	var args = [], f = document.forms[0];
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    14
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    15
	tinyMCEPopup.restoreSelection();
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    16
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    17
	if (!AutoValidator.validate(f)) {
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    18
		tinyMCEPopup.alert(tinyMCEPopup.getLang('invalid_data'));
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    19
		return false;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    20
	}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    21
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    22
	args["numcols"] = f.numcols.value;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    23
	args["numrows"] = f.numrows.value;
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    24
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    25
	tinyMCEPopup.execCommand("mceTableMergeCells", false, args);
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    26
	tinyMCEPopup.close();
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    27
}
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    28
c78d206bf01c First commit... it works I guess
Dan Fuhry <dan@enanocms.org>
parents:
diff changeset
    29
tinyMCEPopup.onInit.add(init);