+<script language="javascript">
+ $(document).ready(function() {
+ registerInputTextareaSwap("#sone #create-sone input[name=name]", "WebInterface.DefaultText.CreateSoneName", "name", false, true);
+ registerInputTextareaSwap("#sone #create-sone input[name=insert-uri]", "WebInterface.DefaultText.CreateSoneInsertURI", "insert-uri", true, true);
+ registerInputTextareaSwap("#sone #create-sone input[name=request-uri]", "WebInterface.DefaultText.CreateSoneRequestURI", "request-uri", true, true);
+
+ /* hide all the labels. */
+ $("#sone #create-sone label").hide();
+
+ /* now hide the “advanced” section. */
+ advancedSection = $("#sone #create-sone .advanced");
+ advancedSection.hide();
+
+ /* show a checkbox instead. */
+ checkboxSection = $("<div></div>");
+ checkbox = $("<input type=\"checkbox\" />").click(function() {
+ if (this.checked) {
+ advancedSection.show();
+ $("#sone #create-sone button[name=create-random]").hide();
+ } else {
+ advancedSection.hide();
+ $("#sone #create-sone button[name=create-random]").show();
+ }
+ })
+ checkboxSection.append(checkbox).append("Show advanced settings");
+ advancedSection.before(checkboxSection);
+ });
+</script>
+
<form id="create-sone" action="createSone.html" method="post">
<input type="hidden" name="formPassword" value="<% formPassword|html>" />
<div<%if errorName> class="error"<%/if>>
<input type="text" name="name" value="<% name|html>"/>
</div>
<div>
- <label for="document-name"><%= Page.Login.CreateSone.Label.DocumentName|l10n|html></label>
- <input type="text" name="document-name" value="<% documentName|html>" />
- </div>
- <div>
<button type="submit" name="create-random" value="1"><%= Page.Login.CreateSone.Button.CreateRandom|l10n|html></button>
</div>
- <div<%if errorUri> class="error"<%/if>>
- <label for="insert-uri"><%= Page.Login.CreateSone.Label.RequestURI|l10n|html></label>
- <input type="text" name="insert-uri" value="<% insertUri|html>" />
- </div>
- <div<%if errorUri> class="error"<%/if>>
- <label for="insert-uri"><%= Page.Login.CreateSone.Label.InsertURI|l10n|html></label>
- <input type="text" name="insert-uri" value="<% requestUri|html>" />
- </div>
- <div>
- <button type="submit" name="create-from-uri" value="1"><%= Page.Login.CreateSone.Button.CreateFromURI|l10n|html></button>
+ <div class="advanced">
+ <div<%if errorUri> class="error"<%/if>>
+ <label for="insert-uri"><%= Page.Login.CreateSone.Label.RequestURI|l10n|html></label>
+ <input type="text" name="insert-uri" value="<% insertUri|html>" />
+ </div>
+ <div<%if errorUri> class="error"<%/if>>
+ <label for="insert-uri"><%= Page.Login.CreateSone.Label.InsertURI|l10n|html></label>
+ <input type="text" name="insert-uri" value="<% requestUri|html>" />
+ </div>
+ <div>
+ <button type="submit" name="create-from-uri" value="1"><%= Page.Login.CreateSone.Button.CreateFromURI|l10n|html></button>
+ </div>
</div>
</form>