Put Sone loading into its own include file.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 21 Oct 2010 11:07:38 +0000 (13:07 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 21 Oct 2010 11:07:38 +0000 (13:07 +0200)
src/main/resources/i18n/sone.en.properties
src/main/resources/static/css/sone.css
src/main/resources/templates/include/loadSone.html [new file with mode: 0644]
src/main/resources/templates/login.html

index bdb95f4..8f26721 100644 (file)
@@ -162,7 +162,9 @@ View.Post.Reply.DeleteLink=Delete
 WebInterface.DefaultText.StatusUpdate=What’s on your mind?
 WebInterface.DefaultText.CreateSoneName=The name of your Sone
 WebInterface.DefaultText.CreateSoneDocumentName=The document name of your Sone (e.g. the “foo” in USK@…/foo/0)
-WebInterface.DefaultText.CreateSoneInsertURI=The Insert Key of your Sone
 WebInterface.DefaultText.CreateSoneRequestURI=The Request Key of your Sone
+WebInterface.DefaultText.CreateSoneInsertURI=The Insert Key of your Sone
+WebInterface.DefaultText.LoadSoneRequestURI=The Request Key of the Sone
+WebInterface.DefaultText.LoadSoneInsertURI=The Insert Key of the Sone
 WebInterface.DefaultText.Reply=Write a Reply…
 WebInterface.DefaultText.SoneRequestURI=Sone Request Key
index 3d0ac5c..1d426ed 100644 (file)
@@ -320,11 +320,7 @@ textarea {
        border-top: none;
 }
 
-#sone #add-sone textarea {
-       height: 1.5em;
-}
-
-#sone #create-sone textarea {
+#sone #add-sone textarea, #sone #create-sone textarea, #sone #load-sone textarea {
        height: 1.5em;
 }
 
diff --git a/src/main/resources/templates/include/loadSone.html b/src/main/resources/templates/include/loadSone.html
new file mode 100644 (file)
index 0000000..b90475a
--- /dev/null
@@ -0,0 +1,25 @@
+<script language="javascript">
+       $(document).ready(function() {
+               registerInputTextareaSwap("#sone #load-sone input[name=request-uri]", "WebInterface.DefaultText.LoadSoneRequestURI", "request-uri", false);
+               registerInputTextareaSwap("#sone #load-sone input[name=insert-uri]", "WebInterface.DefaultText.LoadSoneInsertURI", "insert-uri", false);
+
+               /* hide all the labels. */
+               $("#sone #load-sone label").hide();
+       });
+</script>
+
+<form id="load-sone" action="loadSone.html" method="post">
+       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+       <input type="hidden" name="returnPage" value="<% request.uri|html>" />
+       <div>
+               <label for="request-uri"><%= Page.Login.LoadSone.Label.RequestURI|l10n|html></label>
+               <input type="text" name="request-uri" />
+       </div>
+       <div>
+               <label for="insert-uri"><%= Page.Login.LoadSone.Label.InsertURI|l10n|html></label>
+               <input type="text" name="insert-uri" />
+       </div>
+       <div>
+               <button type="submit"><%= Page.Login.LoadSone.Button.LoadSone|l10n|html></button>
+       </div>
+</form>
index f44cbf2..ff858be 100644 (file)
                        <button type="submit">Select</button>
                </form>
        <%/if>
+
        <h1><%= Page.Login.LoadSone.Title|l10n|html></h1>
        <div><%= Page.Login.LoadSone.Description|l10n|html></div>
-       <form action="loadSone.html" method="post">
-               <input type="hidden" name="formPassword" value="<% formPassword|html>" />
-               <input type="hidden" name="returnPage" value="<% request.uri|html>" />
-               <div>
-                       <label for="request-uri"><%= Page.Login.LoadSone.Label.RequestURI|l10n|html></label>
-                       <input type="text" name="request-uri" />
-               </div>
-               <div>
-                       <label for="insert-uri"><%= Page.Login.LoadSone.Label.InsertURI|l10n|html></label>
-                       <input type="text" name="insert-uri" />
-               </div>
-               <div>
-                       <button type="submit"><%= Page.Login.LoadSone.Button.LoadSone|l10n|html></button>
-               </div>
-       </form>
+       <%include include/loadSone.html>
 
        <h1><%= Page.Login.CreateSone.Title|l10n|html></h1>
        <div><%= Page.Login.CreateSone.Description|l10n|html></div>