]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Matt's demands (ticket #217)
authorMax Shinn <trombonechamp@gmail.com>
Wed, 29 Dec 2010 01:45:25 +0000 (19:45 -0600)
committerMax Shinn <trombonechamp@gmail.com>
Wed, 29 Dec 2010 01:45:25 +0000 (19:45 -0600)
plugins/GNUsocialPhotos/actions/editphoto.php
plugins/GNUsocialPhotos/actions/photo.php
plugins/GNUsocialPhotos/actions/photos.php
plugins/GNUsocialPhotos/res/gnusocialphotos.js
plugins/GNUsocialPhotos/res/style.css

index 2ebcd97aff8f141acb3f1d31a0e35d139598edf9..eacd09156da9100c326c7fb76091d60a84b1c93a 100644 (file)
@@ -172,12 +172,16 @@ class EditphotoAction extends Action
             $this->showForm(_('Error: The photo data is not valid.'));
             return;
         }
+        common_redirect('/photo/' . $this->photo->id, '303');
         $this->showForm(_('Success!'));
 
     }
 
     function deletePhoto()
     {
+        //For redirection
+        $oldalbum = $this->album_id;
+
         $this->photo->title = "";
         $this->photo->photo_description = "";
         $this->photo->profile_id = 0;
@@ -192,6 +196,7 @@ class EditphotoAction extends Action
             return;
         }
         $this->showForm(_('Success!'));
+        common_redirect('/' . $this->user->nickname . '/photos/' . $oldalbum, '303');
         return;
     }
 
index f6ec06358638fbf294062afcdc6c323bfa9a59e8..4d08e5bbd6393ed15870285397c72ce394a7075c 100644 (file)
@@ -99,7 +99,7 @@ class PhotoAction extends Action
             $this->elementEnd('div');
         }
 
-        $this->element('p', array(), $this->photo->photo_description);
+        $this->element('p', array('class' => 'photodescription'), $this->photo->photo_description);
         //This is a hack to hide the top-level comment
         $this->element('style', array(), "#notice-{$this->photo->notice_id} div { display: none } #notice-{$this->photo->notice_id} ol li div { display: inline }");
         $this->conversation->show();
index 5b750a6501ac1227ef0f7683cedbdba7caf85b3d..a75c446be1fc04d13c631f29d8f96c41d37b68c4 100644 (file)
@@ -74,6 +74,16 @@ class PhotosAction extends Action
         $nav->show();
     }
 
+    function showResizeImagesBox()
+    {
+        $this->elementStart('select', array('onchange' => 'return scalePhotosToSize(this.value)'));
+        $this->element('option', array('value' => ''), "");
+        $this->element('option', array('value' => '60'), _("Thumbnail"));
+        $this->element('option', array('value' => '120'), _("Medium"));
+        $this->element('option', array('value' => '400'), _("Normal"));
+        $this->elementEnd('select');
+    }        
+
     function showAlbums()
     {
         $album = new GNUsocialPhotoAlbum();
@@ -85,13 +95,17 @@ class PhotosAction extends Action
         }
 
         $this->elementStart('div', array('class' => 'galleryheader'));
-        $this->element('a', array('href' => '#',
-                                  'onclick' => 'return increasePhotoSize()'), '+');
-        $this->raw(' | ');
-        $this->element('a', array('href' => '#',
-                                  'onclick' => 'return decreasePhotoSize()'), '-');
+        //$this->element('a', array('href' => '#',
+        //                          'onclick' => 'return increasePhotoSize()'), '+');
+        //$this->raw(' | ');
+        //$this->element('a', array('href' => '#',
+        //                          'onclick' => 'return decreasePhotoSize()'), '-');
+
+        $this->showResizeImagesBox();
         $this->elementEnd('div');
 
+
+
         while ($album->fetch()) {
             $this->elementStart('div', array('class' => 'photocontainer'));
             $this->elementStart('a', array('href' => $album->getPageLink()));
@@ -126,13 +140,16 @@ class PhotosAction extends Action
             $this->element('a', array('href' => $album->getPageLink() . '?pageid=' . ($page+1) ), 'Next page');
             $this->raw(' | ');
         }
-        $this->element('a', array('href' => '#',
-                                  'onclick' => 'return increasePhotoSize()'), '+');
-        $this->raw(' | ');
-        $this->element('a', array('href' => '#',
-                                  'onclick' => 'return decreasePhotoSize()'), '-');
+
+        //$this->element('a', array('href' => '#',
+        //                          'onclick' => 'return increasePhotoSize()'), '+');
+        //$this->raw(' | ');
+        //$this->element('a', array('href' => '#',
+        //                          'onclick' => 'return decreasePhotoSize()'), '-');
+        //$this->raw(' | ');
+
+        $this->showResizeImagesBox();
         $this->elementEnd('div');
-        
 
         foreach ($photos as $photo) {
             $this->elementStart('a', array('href' => $photo->getPageLink()));
index 3a959a5db49126b04c83b8d7540b50fc3e70ee19..8681f617554eec9a693ee2931cc3ed5f17562120 100644 (file)
@@ -13,3 +13,17 @@ function decreasePhotoSize() {
         });
     return false;
 }
+
+function scalePhotosToSize(size) {
+    $('.photoingallery, .albumingallery').each(function(index) {
+            if(this.height > this.width) {
+                this.width = this.width*size/this.height;
+                this.height = size;
+            }
+            else {
+                this.height = this.height*size/this.width;
+                this.width = size;
+            }
+        });
+    return false;
+}
\ No newline at end of file
index 78cd01f926f6763fd762bcfe6cc4745d08271b56..bb7b6192784b1e17dae34f5169de5104a1780bba 100644 (file)
@@ -6,3 +6,9 @@
     margin: 15px; 
 }
 
+.photodescription {
+    display: block;
+    background-color: #dddddd;
+    padding: 20px;
+    margin: 15px;
+}
\ No newline at end of file