* Added "rtehtmlarea" as a system extension
[Packages/TYPO3.CMS.git] / typo3 / sysext / rtehtmlarea / htmlarea / popups / link.html
1 <html class="popupwin">
2 <head>
3 <title>Insert/Modify Link</title>
4 <script type="text/javascript" src="popup.js"></script>
5 <script type="text/javascript">
6 HTMLArea = window.opener.HTMLArea;
7 _editor_CSS = window.opener._editor_CSS;
8 __dlg_loadStyle(_editor_CSS);
9 var i18n = HTMLArea.I18N.dialogs;
10
11 function onTargetChanged() {
12 var f = document.getElementById("f_other_target");
13 if (this.value == "_other") {
14 f.style.visibility = "visible";
15 f.select();
16 f.focus();
17 } else {
18 f.style.visibility = "hidden";
19 }
20 };
21
22 function Init() {
23 __dlg_translate(i18n);
24 __dlg_init();
25 var param = window.dialogArguments;
26 var target_select = document.getElementById("f_target");
27 if (param) {
28 document.getElementById("f_href").value = param["f_href"];
29 document.getElementById("f_title").value = param["f_title"];
30 comboSelectValue(target_select, param["f_target"]);
31 if (target_select.value != param.f_target) {
32 var opt = document.createElement("option");
33 opt.value = param.f_target;
34 opt.innerHTML = opt.value;
35 target_select.appendChild(opt);
36 opt.selected = true;
37 }
38 }
39 var opt = document.createElement("option");
40 opt.value = "_other";
41 opt.innerHTML = i18n["target_other"];
42 target_select.appendChild(opt);
43 target_select.onchange = onTargetChanged;
44 document.getElementById("f_href").focus();
45 document.getElementById("f_href").select();
46 };
47
48 function onOK() {
49 var required = { "f_href" : i18n["link_url_required"] };
50 for (var i in required) {
51 var el = document.getElementById(i);
52 if (!el.value) {
53 alert(required[i]);
54 el.focus();
55 return false;
56 }
57 }
58 // pass data back to the calling window
59 var fields = ["f_href", "f_title", "f_target" ];
60 var param = new Object();
61 for (var i in fields) {
62 var id = fields[i];
63 var el = document.getElementById(id);
64 param[id] = el.value;
65 }
66 if (param.f_target == "_other") param.f_target = document.getElementById("f_other_target").value;
67 __dlg_close(param);
68 return false;
69 };
70
71 function onCancel() {
72 __dlg_close(null);
73 return false;
74 };
75 </script>
76 </head>
77 <body class="popupwin" onload="Init()">
78 <div id="content">
79 <div class="title">Insert/Modify Link</div>
80 <form action="" method="get">
81 <label for="f_href" class="field">URL:</label>
82 <input type="text" id="f_href" size="65" title="link_href_tooltip" />
83 <div class="space"></div>
84 <label for="f_title" class="field">Title (tooltip):</label>
85 <input type="text" id="f_title" size="65" title="link_title_tooltip" />
86 <div class="space"></div>
87 <label for="f_target" class="field">Target:</label>
88 <select id="f_target" title="link_target_tooltip">
89 <option value="">target_none</option>
90 <option value="_blank">target_blank</option>
91 <option value="_self">target_self</option>
92 <option value="_top">target_top</option>
93 </select>
94 <input type="text" name="f_other_target" id="f_other_target" size="10" style="visibility: hidden" />
95 <div class="buttons">
96 <button type="button" name="ok" onclick="return onOK();">OK</button>
97 <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
98 </div>
99 </form>
100 </div>
101 </body>
102 </html>