Add form for album creation.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 11 Jan 2011 06:45:20 +0000 (07:45 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 11 Jan 2011 06:45:20 +0000 (07:45 +0100)
src/main/resources/i18n/sone.en.properties
src/main/resources/static/javascript/sone.js
src/main/resources/templates/imageBrowser.html
src/main/resources/templates/include/createAlbum.html [new file with mode: 0644]

index 6463de6..45631f4 100644 (file)
@@ -126,6 +126,7 @@ Page.UnfollowSone.Title=Unfollow Sone - Sone
 Page.ImageBrowser.Title=Image Browser - Sone
 Page.ImageBrowser.Page.Title=Image Browser
 Page.ImageBrowser.Album.Error.NotFound.Text=The requested album could not be found. It is possible that it has not yet been downloaded, or that it has been deleted.
+Page.ImageBrowser.CreateAlbum.Button.CreateAlbum=Create Album
 
 Page.NoPermission.Title=Unauthorized Access - Sone
 Page.NoPermission.Page.Title=Unauthorized Access
index 9aa0b82..16eb806 100644 (file)
@@ -882,6 +882,13 @@ $(document).ready(function() {
                });
        });
 
+       /* ajaxify album creation input field. */
+       getTranslation("WebInterface.DefaultText.Reply", function(text) {
+               $("#create-album input[type=text]".each(function() {
+                       registerInputTextareaSwap(this, text, "name", false, true);
+               });
+       });
+
        /* Ajaxifies all posts. */
        /* calling getTranslation here will cache the necessary values. */
        getTranslation("WebInterface.Confirmation.DeletePostButton", function(text) {
index ece0dfc..b3f4003 100644 (file)
 
        <%else>
 
-               <form id="create-album" method="post" action="createAlbum.html">
-                       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
-                       <input type="hidden" name="returnPage" value="<% request.uri|html>" />
-                       <input type="file" name="image" />
-                       <button type="submit" name="uploadImage" value="1"><%= Page.ImageBrowser.CreateAlbum.Button.CreateAlbum|l10n|html></button>
-               </form>
+               <%include include/createAlbum.html>
 
        <%/if>
 
diff --git a/src/main/resources/templates/include/createAlbum.html b/src/main/resources/templates/include/createAlbum.html
new file mode 100644 (file)
index 0000000..18c3da1
--- /dev/null
@@ -0,0 +1,6 @@
+<form id="create-album" method="post" action="createAlbum.html">
+       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+       <input type="hidden" name="returnPage" value="<% request.uri|html>" />
+       <input type="text" name="album" value="" />
+       <button type="submit" name="uploadImage" value="1"><%= Page.ImageBrowser.CreateAlbum.Button.CreateAlbum|l10n|html></button>
+</form>