#4813: Replaced ImageReorderer with GridReorderer since the functionality in GridReor...
authorharris wong <hwong@ocad.ca>
Mon, 8 Aug 2011 20:44:39 +0000 (20:44 -0000)
committerharris wong <hwong@ocad.ca>
Mon, 8 Aug 2011 20:44:39 +0000 (20:44 -0000)
docs/mods/_standard/photos/include/imageReorderer.js
docs/mods/_standard/photos/include/upload.js [deleted file]
docs/themes/default/photos/pa_organize_photos.tmpl.php

index 006ded8..77b6d07 100644 (file)
@@ -13,15 +13,15 @@ https://source.fluidproject.org/svn/LICENSE.txt
 
 /*global jQuery*/
 /*global fluid*/
-/*global demo*/
+/*global atutor*/
 
-var demo = demo || {};
+var atutor = atutor || {};
 (function (jQuery, fluid) {
        var afterMoveListener = function (thePhotoThatMoved, position, allPhotos) {
                // Loop through each item in the ordered list and update its hidden form field.
                allPhotos.each(function (idx, photo) {
                        jQuery(photo).children("a").children("input").val(idx+1);
-               });
+               }); 
 
                //POST it back to the server
                postOrder();
@@ -35,7 +35,7 @@ var demo = demo || {};
                // Send it back to the server via an AJAX POST request.
                jQuery.ajax({
                        type: "post",
-                       url: form.action
+                       url: form.attr('action')
                        data: photoRequest, 
                        complete: function (data, ajaxStatus) {
                                // Handle success or failure by being nice to the user.
@@ -43,15 +43,16 @@ var demo = demo || {};
                });
        };
 
-        
-    demo.formBasedImageReorderer = function () {
-        var reorderer = fluid.reorderImages("#reorder-images-form", {
+    
+    /**
+     * Which actually uses the Grid reorderer
+     */
+    atutor.formBasedImageReorderer = function () {
+        var reorderer = fluid.reorderGrid("#reorder-images-form", {
             selectors: {
                 movables: ".photo_wrapper"
-            },
-                       listeners: {
-                          afterMove: afterMoveListener
-                       }
-        });  
+            }
+        });
+        reorderer.events.afterMove.addListener(afterMoveListener);
     };
-})(jQuery, fluid);
\ No newline at end of file
+})(jQuery, fluid);
diff --git a/docs/mods/_standard/photos/include/upload.js b/docs/mods/_standard/photos/include/upload.js
deleted file mode 100644 (file)
index b6fd401..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-Copyright 2008-2009 University of Cambridge
-Copyright 2008-2009 University of Toronto
-Copyright 2008-2009 University of California, Berkeley
-
-Licensed under the Educational Community License (ECL), Version 2.0 or the New
-BSD license. You may not use this file except in compliance with one these
-Licenses.
-
-You may obtain a copy of the ECL 2.0 License and BSD License at
-https://source.fluidproject.org/svn/LICENSE.txt
-*/
-
-/*global jQuery*/
-/*global fluid*/
-/*global demo*/
-
-var demo = demo || {};
-
-(function ($, fluid) {
-    demo.initUploader = function () {
-        fluid.progressiveEnhanceableUploader(".flc-uploader", ".fl-progEnhance-basic", {
-            demo: true,                
-            uploadManager: {
-                type: "fluid.swfUploadManager",        
-                options: {
-                   // Set the uploadURL to the URL for posting files to your server.
-                   uploadURL: "http://localhost/atutor155/atutor_163/mods/photo_album/albums.php",
-    
-                   // This option points to the location of the SWFUpload Flash object that ships with Fluid Infusion.
-                   flashURL: "../../jscript/infusion/lib/swfupload/flash/swfupload.swf"
-                }
-            },
-            decorators: [{
-                type: "fluid.swfUploadSetupDecorator",
-                options: {
-                    // This option points to the location of the Browse Files button used with Flash 10 clients.
-                    flashButtonImageURL: "../../jscript/infusion/components/uploader/images/browse.png"
-                }
-            }]
-        });    
-    }
-})(jQuery, fluid);
-
-
-  
\ No newline at end of file
index ceb430b..139fc56 100644 (file)
@@ -2,7 +2,7 @@
        <div class="album_panel">
                <?php if(!empty($this->photos)): ?>
                <p><?php echo _AT('pa_organize_photo_blurb'); ?></p>
-               <form action="<?php echo 'edit_photos.php?aid='.$this->album_info['id'].SEP.'org=1'; ?>" id="reorder-images-form" class="flc-imageReorderer fl-imageReorderer fl-reorderer-horizontalLayout" style="float:left;">
+               <form action="<?php echo AT_PA_BASENAME . 'edit_photos.php?aid='.$this->album_info['id'].SEP.'org=1'; ?>" id="reorder-images-form" class="fl-reorderer-horizontalLayout" style="float:left;">
                <!-- loop through this -->
                <?php foreach($this->photos as $key=>$photo):?>
                <div class="photo_wrapper">
@@ -24,5 +24,5 @@
 </div>
 
 <script type="text/javascript">
-       demo.formBasedImageReorderer(); 
+       atutor.formBasedImageReorderer();       
 </script>