Blame view

js/_tiny_mce/plugins/advhr/jscripts/rule.js 1.1 KB
42868d70   andryeyev   Создал GIT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  function init() {
  	tinyMCEPopup.resizeToInnerSize();
  
  	var formObj = document.forms[0];
  	formObj.width.value  = tinyMCE.getWindowArg('width');
  	formObj.size.value   = tinyMCE.getWindowArg('size');
  	formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('mceDo'),'Insert',true);
  	if (tinyMCE.getWindowArg('noshade')) {
  		formObj.noshade.checked = true;
  	}
  	if (tinyMCE.getWindowArg('width').lastIndexOf('%')!=-1) {
  		formObj.width2.value = "%";
  		formObj.width.value  = formObj.width.value.substring(0,formObj.width.value.length-1);
  	}
  }
  
  function insertHR() {
  	var formObj = document.forms[0];
  	var width   = formObj.width.value;
  	var size    = formObj.size.value;
  	var html = '<hr';
  	if (size!='' && size!=0) {
  		html += ' size="' + size + '"';
  	}
  	if (width!='' && width!=0) {
  		html += ' width="' + width;
  		if (formObj.width2.value=='%') {
  			html += '%';
  		}
  		html += '"';
  	}
  	if (formObj.noshade.checked==true) {
  		html += ' noshade="noshade"';
  	}
  	html += ' />';
  
  	tinyMCEPopup.execCommand("mceInsertContent", true, html);
  	tinyMCEPopup.close();
  }
  
  function cancelAction() {
  	tinyMCEPopup.close();
  }