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

Last change on this file since 854 was 854, checked in by gocher, 12 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
RevLine 
[191]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">
[236]9var fields = null;
[191]10var type;
11function Init() {
12  __dlg_translate("Forms");
[854]13  __dlg_init();
14  var param = window.dialogArguments;
[191]15  type = param.f_type;
[854]16  document.getElementById("f_type").innerHTML = Xinha._lc('Form Element: INPUT', "Forms") + '(' + type + ')';
[236]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";
[191]21  switch (type) {
[236]22    case "text":
23    case "password":
[254]24      fields = ["f_name", "f_value", "f_readOnly", "f_disabled", "f_tabindex", "f_accesskey", "f_size", "f_maxLength"];
[236]25      height = 350;
26      document.getElementById("txt").style.display = "block";
27      break;
28    case "checkbox":
[854]29    case "radio":
[236]30      fields = ["f_name", "f_value", "f_checked", "f_disabled", "f_tabindex", "f_accesskey"];
31      document.getElementById("chk").style.display = "block";
32      height = 280;
[191]33      break;
[854]34    case "button":
[236]35      fields = ["f_name", "f_value", "f_disabled", "f_onclick", "f_tabindex", "f_accesskey"];
36      document.getElementById("btn").style.display = "block";
37      height = 300;
[854]38      break;
39    case "file":
[236]40      fields = ["f_name", "f_disabled", "f_tabindex", "f_accesskey"];
41      document.getElementById("f_value").disabled = true;
42      height = 280;
43      break;
[854]44    case "image":
[236]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;
[191]50    case "reset":
51    case "submit":
[236]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;
[191]62  }
[236]63  for (var i in fields) {
[854]64    switch (fields[i]) {
65    case "f_readOnly":
[236]66    case "f_disabled":
67    case "f_checked":
[254]68      document.getElementById(fields[i]).checked = (param[fields[i]]==fields[i].substring(2,20)) || (param[fields[i]] == true); break;
[236]69    default:
70      document.getElementById(fields[i]).value = param[fields[i]]; break;
71    }
72  }
73  window.resizeTo(320,height);
[854]74  document.getElementById("f_name").focus();
[419]75}
[191]76
77function onOK() {
[854]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  }
[236]84  // pass data back to the calling window
85  var param = new Object();
86  for (var i in fields) {
87    switch (fields[i]) {
[254]88    case "f_readOnly":
[236]89    case "f_disabled":
90    case "f_checked":
[854]91      if(Xinha.is_ie)
[254]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;
[236]96    default:
97      param[fields[i]] = document.getElementById(fields[i]).value; break;
98    }
99  }
[191]100  __dlg_close(param);
101  return false;
[419]102}
[191]103
104function onCancel() {
[854]105  __dlg_close(null);
106  return false;
[419]107}
[191]108</script>
109
110</head>
111
[239]112<body class="dialog" onload="Init()">
[191]113  <div id="f_type" class="title"></div>
114  <form action="" method="get">
[236]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 />
[854]124
[191]125  <div id="chk">
126    <div class="fr">Checked</div>
[236]127      <input name="checked" id="f_checked" type="checkbox" />
128    <p />
[854]129  </div>
130
[236]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>
[254]140    <input type="checkbox" name="readOnly" id="f_readOnly" value="readOnly" />
[236]141    <p />
[854]142
143    <fieldset>
144    <legend>Dimensions</legend>
[236]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>
[254]150      <input type="text" name="maxLength" id="f_maxLength" size="5"     title="Maximum number of characters accepted" />
[236]151      <div class="space"></div>
[854]152    </fieldset>
[191]153  </div>
[236]154  <div id="btn">
[854]155    <fieldset>
156    <legend> Button Script</legend>
157      <div class="space"></div>
[236]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>
[854]161    </fieldset>
[236]162  </div>
[854]163  <div id="img">
164    <fieldset>
165    <legend>Image source</legend>
166      <div class="space"></div>
[236]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>
[854]170    </fieldset>
[191]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>
[854]175  </div>
[191]176</form>
177
178</body>
[854]179</html>
Note: See TracBrowser for help on using the repository browser.