Merge branch 'master' into next
[Sone.git] / src / main / resources / templates / include / createSone.html
1 <script language="javascript">
2         $(document).ready(function() {
3                 registerInputTextareaSwap("#sone #create-sone input[name=name]", "WebInterface.DefaultText.CreateSoneName", "name", false, true);
4                 registerInputTextareaSwap("#sone #create-sone input[name=insert-uri]", "WebInterface.DefaultText.CreateSoneInsertURI", "insert-uri", true, true);
5                 registerInputTextareaSwap("#sone #create-sone input[name=request-uri]", "WebInterface.DefaultText.CreateSoneRequestURI", "request-uri", true, true);
6
7                 /* hide all the labels. */
8                 $("#sone #create-sone label").hide();
9
10                 /* now hide the “advanced” section. */
11                 advancedSection = $("#sone #create-sone .advanced");
12                 advancedSection.hide();
13
14                 /* show a checkbox instead. */
15                 checkboxSection = $("<div></div>");
16                 checkbox = $("<input type=\"checkbox\" />").click(function() {
17                         if (this.checked) {
18                                 advancedSection.show();
19                                 $("#sone #create-sone button[name=create-random]").hide();
20                         } else {
21                                 advancedSection.hide();
22                                 $("#sone #create-sone button[name=create-random]").show();
23                         }
24                 })
25                 checkboxSection.append(checkbox).append("Show advanced settings");
26                 advancedSection.before(checkboxSection);
27         });
28 </script>
29
30 <form id="create-sone" action="createSone.html" method="post">
31         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
32         <div<%if errorName> class="error"<%/if>>
33                 <label for="name"><%= Page.Login.CreateSone.Label.Name|l10n|html></label>
34                 <input type="text" name="name" value="<% name|html>"/>
35         </div>
36         <div>
37                 <button type="submit" name="create-random" value="1"><%= Page.Login.CreateSone.Button.CreateRandom|l10n|html></button>
38         </div>
39         <div class="advanced">
40                 <div<%if errorUri> class="error"<%/if>>
41                         <label for="insert-uri"><%= Page.Login.CreateSone.Label.InsertURI|l10n|html></label>
42                         <input type="text" name="insert-uri" value="<% insertUri|html>" />
43                 </div>
44                 <div<%if errorUri> class="error"<%/if>>
45                         <label for="request-uri"><%= Page.Login.CreateSone.Label.RequestURI|l10n|html></label>
46                         <input type="text" name="request-uri" value="<% requestUri|html>" />
47                 </div>
48                 <div>
49                         <button type="submit" name="create-from-uri" value="1"><%= Page.Login.CreateSone.Button.CreateFromURI|l10n|html></button>
50                 </div>
51         </div>
52 </form>