PageRenderTime 102ms CodeModel.GetById 61ms app.highlight 4ms RepoModel.GetById 36ms app.codeStats 0ms

/static/scripts/tiny_mce/plugins/paste/js/pasteword.js

http://n23.googlecode.com/
JavaScript | 56 lines | 40 code | 14 blank | 2 comment | 6 complexity | 5760c35f976c0b076df0c043e3842de7 MD5 | raw file
 1tinyMCEPopup.requireLangPack();
 2
 3function saveContent() {
 4	var html = document.getElementById("frmData").contentWindow.document.body.innerHTML;
 5
 6	if (html == ''){
 7		tinyMCEPopup.close();
 8		return false;
 9	}
10
11	tinyMCEPopup.execCommand('mcePasteWord', false, html);
12	tinyMCEPopup.close();
13}
14
15function onLoadInit() {
16	tinyMCEPopup.resizeToInnerSize();
17
18	// Fix for endless reloading in FF
19	window.setTimeout(createIFrame, 10);
20}
21
22function createIFrame() {
23	document.getElementById('iframecontainer').innerHTML = '<iframe id="frmData" name="frmData" class="sourceIframe" src="blank.htm" height="280" width="400" frameborder="0" style="background-color:#FFFFFF; width:100%;" dir="ltr" wrap="soft"></iframe>';
24}
25
26var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
27
28function initIframe(doc) {
29	var dir = tinyMCEPopup.editor.settings.directionality;
30
31	doc.body.dir = dir;
32
33	// Remove Gecko spellchecking
34	if (tinymce.isGecko)
35		doc.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");
36
37	resizeInputs();
38}
39
40function resizeInputs() {
41	if (!tinymce.isIE) {
42		wHeight = self.innerHeight - 80;
43		wWidth = self.innerWidth - 18;
44	} else {
45		wHeight = document.body.clientHeight - 80;
46		wWidth = document.body.clientWidth - 18;
47	}
48
49	var elm = document.getElementById('frmData');
50	if (elm) {
51		elm.style.height = Math.abs(wHeight) + 'px';
52		elm.style.width  = Math.abs(wWidth) + 'px';
53	}
54}
55
56tinyMCEPopup.onInit.add(onLoadInit);