TWEagle / galleriffic

Automatically exported from code.google.com/p/galleriffic
0 stars 0 forks source link

The ability to add and remove photos from the gallery after it is initialized. #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Init the gallery with some images.
2. Note that there is no native way to add or remove photos.

What is the expected output? What do you see instead?
A function which accepts the needed params - thumb url, image url, caption
etc and adds it to the gallery, and an accompanying method to remove them.

What version of the product are you using? On what operating system?
1.0, IE/FF etc

Please provide any additional information below.
Please contact me at alundgren04@gmail.com if you need any help in dev,
clarification of the functionality etc.

--
Andrew Lundgren

Original issue reported on code.google.com by alundgre...@gmail.com on 7 Aug 2009 at 7:13

GoogleCodeExporter commented 9 years ago

P.S. You can see this in action at LoversCanBeChoosers.com

If you fill out the join form it'll log you in and you'll see the "New Profile"
dialog. If you click "Add Picture" an upload dialog will pop-up and when you 
click
upload notice how in the background the entire gallery is being removed and
recreated. This is the temporary solution I'm using, and it isn't very elegant 
:)

Original comment by alundgre...@gmail.com on 7 Aug 2009 at 7:18

GoogleCodeExporter commented 9 years ago

( This is requested additional functionality, not a defect. I don't see how to 
change
it. )

Original comment by alundgre...@gmail.com on 7 Aug 2009 at 7:24

GoogleCodeExporter commented 9 years ago

Original comment by trentfoley on 7 Aug 2009 at 7:33

GoogleCodeExporter commented 9 years ago

Original comment by trentfoley on 7 Aug 2009 at 7:34

GoogleCodeExporter commented 9 years ago
Hi Trent,

Thanks for taking a look. What's the status on this?

I hope it's not too difficult to implement.
--
Andrew Lundgren
alundgren04@gmail.com

Original comment by alundgre...@gmail.com on 21 Aug 2009 at 6:53

GoogleCodeExporter commented 9 years ago
I did my own remove photo.  I call it:
gallery.deleteThumb(index);
gallery.goto(index+1); // or location.href='#'+index if hisotry enabled;

This is the new method:

            deleteThumb: function(i){
                    gallery.data[i]={
                        title:'Deleted',
                        slideUrl:'[url for a picture that says photo deleted]',
                        caption:'Deleted',
                        hash:i,
                        downloadlink:'',
                        width:500,
                        height:500
                    };
                    //Loop over the thumbnails and replace the original thumbnail with the one for a
deleted image
                    this.$thumbsContainer.find('ul.thumbs > li').each(function(j) {
                        if (j == i){
                            var $li = $(this);
                            var $aThumb = $li.find('a.thumb');
                            var $img=$aThumb.find('img');
                            $img.remove();
                            $aThumb.append('<img src="[url for an image with a big red X on it]">');
                        }
                    });

            },

You need a picture as a placeholder for a deleted image and a thumbnail with a 
big red X.

Original comment by hammo...@yahoo.com on 3 Sep 2009 at 1:58

GoogleCodeExporter commented 9 years ago
I think it might achieve what I want if instead I spliced out the gallery.data
element and removed the li instead of just replacing it with a "deleted" image. 

I'd move the gallery.goto call to be inside the deleteThumb method and only 
fire if
the pic being deleted was currently selected. Also, need bounds checking in 
case the
deleted photo was the last pic.

Original comment by jimmorga...@gmail.com on 3 Sep 2009 at 4:56

GoogleCodeExporter commented 9 years ago
btw jimmorganpoolandspa was me :)

Original comment by alundgre...@gmail.com on 3 Sep 2009 at 7:40

GoogleCodeExporter commented 9 years ago
I just committed r16 which has a few new functions for adding/inserting images 
after
the gallery is initialized: insertImage and appendImage.  I have yet to 
implement the
remove, but that is next.

Original comment by trentfoley on 17 Oct 2009 at 9:33

GoogleCodeExporter commented 9 years ago
Released version 2.0 now supports inserting and removing images after 
initialization. 

Original comment by trentfoley on 31 Oct 2009 at 4:03