app/tiny_mce/plugins/paste/js/pastetext.js
author Todd Larsen <tlarsen@google.com>
Tue, 16 Sep 2008 16:49:25 +0000
changeset 154 d2377425d3f2
parent 126 app/soc/content/js/tiny_mce/plugins/paste/js/pastetext.js@6186c115a210
permissions -rwxr-xr-x
Move third-party TinyMCE out of soc/content/js and into the application image root, like other third-party code. Update the app.yaml.template to add /tiny_mce as a source of static content.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
126
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     1
tinyMCEPopup.requireLangPack();
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     2
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     3
function saveContent() {
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     4
	if (document.forms[0].htmlSource.value == '') {
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     5
		tinyMCEPopup.close();
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     6
		return false;
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     7
	}
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     8
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     9
	tinyMCEPopup.execCommand('mcePasteText', false, {
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    10
		html : document.forms[0].htmlSource.value,
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    11
		linebreaks : document.forms[0].linebreaks.checked
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    12
	});
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    13
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    14
	tinyMCEPopup.close();
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    15
}
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    16
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    17
function onLoadInit() {
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    18
	tinyMCEPopup.resizeToInnerSize();
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    19
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    20
	// Remove Gecko spellchecking
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    21
	if (tinymce.isGecko)
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    22
		document.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    23
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    24
	resizeInputs();
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    25
}
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    26
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    27
var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    28
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    29
function resizeInputs() {
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    30
	if (!tinymce.isIE) {
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    31
		wHeight = self.innerHeight-80;
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    32
		wWidth = self.innerWidth-17;
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    33
	} else {
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    34
		wHeight = document.body.clientHeight-80;
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    35
		wWidth = document.body.clientWidth-17;
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    36
	}
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    37
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    38
	document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    39
	document.forms[0].htmlSource.style.width  = Math.abs(wWidth) + 'px';
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    40
}
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    41
6186c115a210 Added TinyMCE to Melange in soc/content/js
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    42
tinyMCEPopup.onInit.add(onLoadInit);