File: popup.htm

package info (click to toggle)
tinymce2 2.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 3,192 kB
  • ctags: 1,107
  • sloc: makefile: 59; sh: 7
file content (48 lines) | stat: -rw-r--r-- 1,524 bytes parent folder | download | duplicates (7)
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
44
45
46
47
48
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>{$lang_template_title}</title>
	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
	<script language="javascript" type="text/javascript">
	<!--
		function init() {
			var inst = tinyMCE.selectedInstance;
			var elm = inst.getFocusElement();

			alert("Got a window argument from plugin: " + tinyMCE.getWindowArg('some_custom_arg'));

			// Set the form item value to the selected node element name
			document.forms[0].nodename.value = elm.nodeName;
		}

		function insertSomething() {
			// Execute the mceTemplate command without UI this time
			tinyMCEPopup.execCommand('mceTemplate');

			// Close the dialog
			tinyMCEPopup.close();
		}
	//-->
	</script>
	<base target="_self" />
</head>
<body onload="tinyMCEPopup.executeOnLoad('init();');"> 
	<form onsubmit="insert();return false;">
		<h3>{$lang_template_title}</h3>

		<!-- Gets filled with the selected elements name -->
		<div style="margin-top: 10px; margin-bottom: 10px">
			The selected element name: <input type="text" name="nodename" />
		</div>

		<div class="mceActionPanel">
			<div style="float: left">
				<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertSomething();" />
			</div>

			<div style="float: right">
				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
			</div>
		</div>
	</form>
</body> 
</html>