File:
[LON-CAPA] /
loncom /
html /
htmlarea /
popups /
Attic /
link.html
Revision
1.1:
download - view:
text,
annotated -
select for diffs
Tue Jun 1 23:46:11 2004 UTC (20 years, 2 months ago) by
www
Branches:
MAIN
CVS tags:
version_2_5_X,
version_2_5_99_0,
version_2_5_2,
version_2_5_1,
version_2_5_0,
version_2_4_X,
version_2_4_99_0,
version_2_4_2,
version_2_4_1,
version_2_4_0,
version_2_3_X,
version_2_3_99_0,
version_2_3_2,
version_2_3_1,
version_2_3_0,
version_2_2_X,
version_2_2_99_1,
version_2_2_99_0,
version_2_2_2,
version_2_2_1,
version_2_2_0,
version_2_1_X,
version_2_1_99_3,
version_2_1_99_2,
version_2_1_99_1,
version_2_1_99_0,
version_2_1_3,
version_2_1_2,
version_2_1_1,
version_2_1_0,
version_2_0_X,
version_2_0_99_1,
version_2_0_2,
version_2_0_1,
version_2_0_0,
version_1_99_3,
version_1_99_2,
version_1_99_1_tmcc,
version_1_99_1,
version_1_99_0_tmcc,
version_1_99_0,
version_1_3_X,
version_1_3_3,
version_1_3_2,
version_1_3_1,
version_1_3_0,
version_1_2_X,
version_1_2_99_1,
version_1_2_99_0,
version_1_2_1,
version_1_2_0,
version_1_1_99_5,
version_1_1_99_4,
version_1_1_99_3,
version_1_1_99_2,
version_1_1_99_1,
version_1_1_99_0,
HEAD
Next version HTMLArea.
1: <html>
2:
3: <head>
4: <title>Insert/Modify Link</title>
5: <script type="text/javascript" src="popup.js"></script>
6: <script type="text/javascript">
7: window.resizeTo(400, 200);
8:
9: I18N = window.opener.HTMLArea.I18N.dialogs;
10:
11: function i18n(str) {
12: return (I18N[str] || str);
13: };
14:
15: function onTargetChanged() {
16: var f = document.getElementById("f_other_target");
17: if (this.value == "_other") {
18: f.style.visibility = "visible";
19: f.select();
20: f.focus();
21: } else f.style.visibility = "hidden";
22: };
23:
24: function Init() {
25: __dlg_translate(I18N);
26: __dlg_init();
27: var param = window.dialogArguments;
28: var target_select = document.getElementById("f_target");
29: if (param) {
30: document.getElementById("f_href").value = param["f_href"];
31: document.getElementById("f_title").value = param["f_title"];
32: comboSelectValue(target_select, param["f_target"]);
33: if (target_select.value != param.f_target) {
34: var opt = document.createElement("option");
35: opt.value = param.f_target;
36: opt.innerHTML = opt.value;
37: target_select.appendChild(opt);
38: opt.selected = true;
39: }
40: }
41: var opt = document.createElement("option");
42: opt.value = "_other";
43: opt.innerHTML = i18n("Other");
44: target_select.appendChild(opt);
45: target_select.onchange = onTargetChanged;
46: document.getElementById("f_href").focus();
47: document.getElementById("f_href").select();
48: };
49:
50: function onOK() {
51: var required = {
52: "f_href": i18n("You must enter the URL where this link points to")
53: };
54: for (var i in required) {
55: var el = document.getElementById(i);
56: if (!el.value) {
57: alert(required[i]);
58: el.focus();
59: return false;
60: }
61: }
62: // pass data back to the calling window
63: var fields = ["f_href", "f_title", "f_target" ];
64: var param = new Object();
65: for (var i in fields) {
66: var id = fields[i];
67: var el = document.getElementById(id);
68: param[id] = el.value;
69: }
70: if (param.f_target == "_other")
71: param.f_target = document.getElementById("f_other_target").value;
72: __dlg_close(param);
73: return false;
74: };
75:
76: function onCancel() {
77: __dlg_close(null);
78: return false;
79: };
80:
81: </script>
82:
83: <style type="text/css">
84: html, body {
85: background: ButtonFace;
86: color: ButtonText;
87: font: 11px Tahoma,Verdana,sans-serif;
88: margin: 0px;
89: padding: 0px;
90: }
91: body { padding: 5px; }
92: table {
93: font: 11px Tahoma,Verdana,sans-serif;
94: }
95: select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
96: button { width: 70px; }
97: table .label { text-align: right; width: 8em; }
98:
99: .title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
100: border-bottom: 1px solid black; letter-spacing: 2px;
101: }
102:
103: #buttons {
104: margin-top: 1em; border-top: 1px solid #999;
105: padding: 2px; text-align: right;
106: }
107: </style>
108:
109: </head>
110:
111: <body onload="Init()">
112: <div class="title">Insert/Modify Link</div>
113:
114: <table border="0" style="width: 100%;">
115: <tr>
116: <td class="label">URL:</td>
117: <td><input type="text" id="f_href" style="width: 100%" /></td>
118: </tr>
119: <tr>
120: <td class="label">Title (tooltip):</td>
121: <td><input type="text" id="f_title" style="width: 100%" /></td>
122: </tr>
123: <tr>
124: <td class="label">Target:</td>
125: <td><select id="f_target">
126: <option value="">None (use implicit)</option>
127: <option value="_blank">New window (_blank)</option>
128: <option value="_self">Same frame (_self)</option>
129: <option value="_top">Top frame (_top)</option>
130: </select>
131: <input type="text" name="f_other_target" id="f_other_target" size="10" style="visibility: hidden" />
132: </td>
133: </tr>
134: </table>
135:
136: <div id="buttons">
137: <button type="button" name="ok" onclick="return onOK();">OK</button>
138: <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
139: </div>
140:
141: </body>
142: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>