source: trunk/plugins/Forms/popups/input.html @ 967

Last change on this file since 967 was 854, checked in by gocher, 13 years ago

change htmlarea to Xinha in plugin Forms and some formating

  • Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
File size: 5.6 KB
Line 
1<html>
2
3<head>
4  <title>Insert/Edit Form Element INPUT</title>
5  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
6  <script type="text/javascript" src="../../../popups/popup.js"></script>
7
8<script type="text/javascript">
9var fields = null;
10var type;
11function Init() {
12  __dlg_translate("Forms");
13  __dlg_init();
14  var param = window.dialogArguments;
15  type = param.f_type;
16  document.getElementById("f_type").innerHTML = Xinha._lc('Form Element: INPUT', "Forms") + '(' + type + ')';
17  document.getElementById("txt").style.display = "none";
18  document.getElementById("chk").style.display = "none";
19  document.getElementById("btn").style.display = "none";
20  document.getElementById("img").style.display = "none";
21  switch (type) {
22    case "text":
23    case "password":
24      fields = ["f_name", "f_value", "f_readOnly", "f_disabled", "f_tabindex", "f_accesskey", "f_size", "f_maxLength"];
25      height = 350;
26      document.getElementById("txt").style.display = "block";
27      break;
28    case "checkbox":
29    case "radio":
30      fields = ["f_name", "f_value", "f_checked", "f_disabled", "f_tabindex", "f_accesskey"];
31      document.getElementById("chk").style.display = "block";
32      height = 280;
33      break;
34    case "button":
35      fields = ["f_name", "f_value", "f_disabled", "f_onclick", "f_tabindex", "f_accesskey"];
36      document.getElementById("btn").style.display = "block";
37      height = 300;
38      break;
39    case "file":
40      fields = ["f_name", "f_disabled", "f_tabindex", "f_accesskey"];
41      document.getElementById("f_value").disabled = true;
42      height = 280;
43      break;
44    case "image":
45      fields = ["f_name", "f_disabled", "f_tabindex", "f_accesskey", "f_src"];
46      document.getElementById("img").style.display = "block";
47      document.getElementById("f_value").disabled = true;
48      height = 300;
49      break;
50    case "reset":
51    case "submit":
52      fields = ["f_name", "f_value", "f_disabled", "f_tabindex", "f_accesskey"];
53      height =260;
54      break;
55    case "hidden":
56      fields = ["f_name", "f_value"];
57      document.getElementById("f_disabled").disabled = true;
58      document.getElementById("f_tabindex").disabled = true;
59      document.getElementById("f_accesskey").disabled = true;
60      height =260;
61      break;
62  }
63  for (var i in fields) {
64    switch (fields[i]) {
65    case "f_readOnly":
66    case "f_disabled":
67    case "f_checked":
68      document.getElementById(fields[i]).checked = (param[fields[i]]==fields[i].substring(2,20)) || (param[fields[i]] == true); break;
69    default:
70      document.getElementById(fields[i]).value = param[fields[i]]; break;
71    }
72  }
73  window.resizeTo(320,height);
74  document.getElementById("f_name").focus();
75}
76
77function onOK() {
78  var el = document.getElementById("f_name");
79  if (!el.value) {
80    alert(Xinha._lc("You must enter a Name","Forms"));
81    el.focus();
82    return false;
83  }
84  // pass data back to the calling window
85  var param = new Object();
86  for (var i in fields) {
87    switch (fields[i]) {
88    case "f_readOnly":
89    case "f_disabled":
90    case "f_checked":
91      if(Xinha.is_ie)
92        param[fields[i]] = (document.getElementById(fields[i]).checked)?true:"";
93      else
94        param[fields[i]] = (document.getElementById(fields[i]).checked)?fields[i].substring(2,20):"";
95      break;
96    default:
97      param[fields[i]] = document.getElementById(fields[i]).value; break;
98    }
99  }
100  __dlg_close(param);
101  return false;
102}
103
104function onCancel() {
105  __dlg_close(null);
106  return false;
107}
108</script>
109
110</head>
111
112<body class="dialog" onload="Init()">
113  <div id="f_type" class="title"></div>
114  <form action="" method="get">
115    <div class="fr">Name/ID:</div>
116    <input type="text" name="name" id="f_name" title="Name of the form input" />
117    <p />
118    <div class="fr">Value:</div>
119    <input type="text" name="value" id="f_value" title="Value of the form input" />
120    <p />
121    <div class="fr">Disabled</div>
122    <input type="checkbox" name="disabled" id="f_disabled" value="disabled" />
123    <p />
124
125  <div id="chk">
126    <div class="fr">Checked</div>
127      <input name="checked" id="f_checked" type="checkbox" />
128    <p />
129  </div>
130
131    <div class="fr">Tab Index:</div>
132    <input type="text" name="tabindex" id="f_tabindex" />
133    <p />
134    <div class="fr">Access Key:</div>
135    <input type="text" name="accesskey" id="f_accesskey" />
136    <p />
137
138  <div id="txt">
139    <div class="fr">Read Only</div>
140    <input type="checkbox" name="readOnly" id="f_readOnly" value="readOnly" />
141    <p />
142
143    <fieldset>
144    <legend>Dimensions</legend>
145      <div class="space"></div>
146      <div class="fr">Size:</div>
147      <input type="text" name="size" id="f_size" size="5" title="Size of text box in characters" />
148      <div class="space"></div>
149      <div class="fr">Max length:</div>
150      <input type="text" name="maxLength" id="f_maxLength" size="5"     title="Maximum number of characters accepted" />
151      <div class="space"></div>
152    </fieldset>
153  </div>
154  <div id="btn">
155    <fieldset>
156    <legend> Button Script</legend>
157      <div class="space"></div>
158      <div class="fr">'onClick'=</div>
159      <input type="text" name="onClick" id="f_onclick" title="Javascript for button click" />
160      <div class="space"></div>
161    </fieldset>
162  </div>
163  <div id="img">
164    <fieldset>
165    <legend>Image source</legend>
166      <div class="space"></div>
167      <div class="fr">Image URL:</div>
168      <input type="text" name="src" id="f_src" title="URL of image" />
169      <div class="space"></div>
170    </fieldset>
171  </div>
172  <div id="buttons">
173    <button type="button" name="ok" onclick="return onOK();">OK</button>
174    <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
175  </div>
176</form>
177
178</body>
179</html>
Note: See TracBrowser for help on using the repository browser.