PageRenderTime 33ms CodeModel.GetById 30ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/static/scripts/tiny_mce/plugins/table/js/merge_cells.js

http://n23.googlecode.com/
JavaScript | 29 lines | 20 code | 9 blank | 0 comment | 1 complexity | de411e8969e91ababf874765d8ffa201 MD5 | raw file
 1tinyMCEPopup.requireLangPack();
 2
 3function init() {
 4	var f = document.forms[0], v;
 5
 6	tinyMCEPopup.resizeToInnerSize();
 7
 8	f.numcols.value = tinyMCEPopup.getWindowArg('numcols', 1);
 9	f.numrows.value = tinyMCEPopup.getWindowArg('numcols', 1);
10}
11
12function mergeCells() {
13	var args = [], f = document.forms[0];
14
15	tinyMCEPopup.restoreSelection();
16
17	if (!AutoValidator.validate(f)) {
18		alert(tinyMCEPopup.getLang('invalid_data'));
19		return false;
20	}
21
22	args["numcols"] = f.numcols.value;
23	args["numrows"] = f.numrows.value;
24
25	tinyMCEPopup.execCommand("mceTableMergeCells", false, args);
26	tinyMCEPopup.close();
27}
28
29tinyMCEPopup.onInit.add(init);