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);
7 /* hide all the labels. */
8 $("#sone #create-sone label").hide();
10 /* now hide the “advanced” section. */
11 advancedSection = $("#sone #create-sone .advanced");
12 advancedSection.hide();
14 /* show a checkbox instead. */
15 checkboxSection = $("<div></div>");
16 checkbox = $("<input type=\"checkbox\" />").click(function() {
18 advancedSection.show();
19 $("#sone #create-sone button[name=create-random]").hide();
21 advancedSection.hide();
22 $("#sone #create-sone button[name=create-random]").show();
25 checkboxSection.append(checkbox).append("Show advanced settings");
26 advancedSection.before(checkboxSection);
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>"/>
37 <button type="submit" name="create-random" value="1"><%= Page.Login.CreateSone.Button.CreateRandom|l10n|html></button>
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>" />
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>" />
49 <button type="submit" name="create-from-uri" value="1"><%= Page.Login.CreateSone.Button.CreateFromURI|l10n|html></button>