Move ajaxification of album creation form fields to imageBrowser.html.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 23 Mar 2011 06:51:19 +0000 (07:51 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 23 Mar 2011 06:51:19 +0000 (07:51 +0100)
src/main/resources/static/javascript/sone.js
src/main/resources/templates/imageBrowser.html

index 0b28fb7..9ef6812 100644 (file)
@@ -1342,18 +1342,6 @@ $(document).ready(function() {
                });
        });
 
-       /* ajaxify album creation input field. */
-       getTranslation("WebInterface.DefaultText.CreateAlbum.Name", function(text) {
-               $("#create-album input[name='name']").each(function() {
-                       registerInputTextareaSwap(this, text, "name", false, true);
-               });
-       });
-       getTranslation("WebInterface.DefaultText.CreateAlbum.Description", function(text) {
-               $("#create-album input[name='description']").each(function() {
-                       registerInputTextareaSwap(this, text, "description", true, true);
-               });
-       });
-
        /* Ajaxifies all posts. */
        /* calling getTranslation here will cache the necessary values. */
        getTranslation("WebInterface.Confirmation.DeletePostButton", function(text) {
index 9dac07b..e1f4aea 100644 (file)
@@ -1,5 +1,23 @@
 <%include include/head.html>
 
+       <script language="javascript">
+
+               /* ajaxify album creation input field. */
+               $(document).ready(function() {
+                       getTranslation("WebInterface.DefaultText.CreateAlbum.Name", function(text) {
+                               $("#create-album input[name='name']").each(function() {
+                                       registerInputTextareaSwap(this, text, "name", false, true);
+                               });
+                       });
+                       getTranslation("WebInterface.DefaultText.CreateAlbum.Description", function(text) {
+                               $("#create-album input[name='description']").each(function() {
+                                       registerInputTextareaSwap(this, text, "description", true, true);
+                               });
+                       });
+               });
+
+       </script>
+
        <div class="page-id hidden">image-browser</div>
 
        <%if albumRequested>