Flipper - The Gallery Flipper

Released version 2.9, fixed saving of images...
This is a page to describe the functionality and to give some support to the users of Flipper. From this page you can download and install the extension and actually get an idea of how it works and how to use it.

Credits

Before everything else is said and written I wish to thank a couple of people, that mostly not knowing helped me out and let me get the knowledge I needed to write this extension.

Ben Goodger - I got a lot from reading his code, MagPie and before TabDownloader were an incredible source of inspiration and code lifting. I think I credited in the code all the pieces that were inspired by his code, if I didn't in all the places I'm sorry about it, and I'll fix that.

Matt Kennedy - from one of his postings I got the idea of packing an initial RDF into the jar and then having it copied where it's needed the first time a user launches Flipper.

Many other postings have been a great help in writing this extension, I'm not able to track back everything I read from the net about extension writing, but I guess I thank them all.

A short story...

What's the idea behind Flipper and how comes the first release was 2.1?[Note: Current release is 2.9] In this chapter we'll get to know a bit more about it.

I had seen many url flippers by the time I decided to sit down and write my own, I knew the shortcomings of others, and I knew the problems that came with surfing galleries and such. So I'd say I had all the elements needed to write a flipper that had to be the ultimate flipper.

My plan had only a minor flaw: I had no clue on how to write an extension!

My motto is: if you have no clue on how to do something, start doing it, what you need you can get on the way. I know it's not a great motto, but, hey, are we here to talk about Flipper or my mottos?

I wrote several version for my own personal use, then some friends asked to take a look at it, and I made some extension to the extension to suit their needs, and some of their particular requests. Few days ago I decided to go public, I did some code polishing, worked out some big bugs, fine tuned some screws and here I am now, writing a documentation about Flipper. I guess this is when you really know you are going to go public!

How to use it

Here we go: this chapter tackles all you need to know to start using the flipper, the keys used, the way to write your gallery definitions and some other concepts and semi-hidden features that may come handy.

Installing the extension is as easy as clicking on the box you find at the left side of this page. Follow the instructions and in a matter of few seconds and a restart of your very fine FireFox browser you'll be ready to enter the magic world of gallery flipping.

So, browser restarted, and ready to go, now, press CTRL and END at the same time; if you did it right you should see the dialog in the picture pop out, if it doesn't make sure your focus is not in the address bar, click on the web-page content and try again.

Did it work? Good, let's move on.

I know it looks a bit complicated seen like this, but with a fast example I'm sure we can make it, and have you running around creating galleries in less time than you can say "Corvo Rosso non avrai il mio scalpo", which, if you're Italian like me, doesn't take very long...

Click Cancel on the dialog, open up a new tab and go to this page. You should have a nice thumbnailed gallery of images, some pictures I took while in Cancun. If you click on one of the pictures there a window will pop up one [I do hate popups as the next guy, but this is simply for demoing, so forgive me this once!]

Click on the top one, the one with the campesino, and once the window pops out press the combination to call up Flipper's dialog (CTRL+END, and this is the last time I remind you!) and let's take a look at it.

We have as Actually Loaded URL the URL to the picture we are looking at, something in the lines of http://www.aliquam.org/gall01/img01.jpg. The Referrer, the URL Flipper will tell the site it's coming from, is set to http://www.aliquam.org/gall01.html. There is no history of URL so far, right? So we can start building or gallery definition.

Gallery base URL - This is the bit of the URL that points to the part that never changes at the beginning of every image in the galleries URL, in our case this is http://www.aliquam.org/gall.

Gal.Rng. - This is a definition of the gallery range. Hard to explain, but I'll try. If you leave this empty Flipper will simply add things up and slap them in the generated URL. Say that you defined G.Min. 1 and G.Max. 3 this part URL will flip as http://www.aliquam.org/gall1, http://www.aliquam.org/gall2 and http://www.aliquam.org/gall3.

Now, since the galleries here are defined as gall01, gall02 and gall03, what do I do? Simple: in Gal.Rng. you'll write 00, or any two digits for what it matters, Flipper will get that we're talking numbers here and that there are two digits to define. The gallery browsing will then be defined as:

	http://www.aliquam.org/gall01
	http://www.aliquam.org/gall02
	http://www.aliquam.org/gall03
	.....	
	.....

Now we come to the middle bit of the URL to the images that never changes, the Url Mid. In the case of the image we have in the gallery here at aliquam.org, the campesino from Cancun, the middle bit of the URL is "/img", since then comes the counter of images.

So, writing "/img" in the URL Mid field the galleries that we'll browse through are calculated by flipper as being like

	http://www.aliquam.org/gall01/img
	http://www.aliquam.org/gall02/img
	http://www.aliquam.org/gall03/img
	.....	
	.....

Now we need to attach to this "/img" a counter for every image in the gallery; as with the Gal.Rng. if you leave Img.Rng. empty Flipper will attach to it the actual image number, no formatting, no special thingies. If, on the other hand, you write in here a number, any number, Flipper will make it so that the number it will attach here will be long at least as the number you specified, padding with zeroes if needed.

Not clear yet? Well, say that you left the Img.Rng. field empty, browsing the images will make Flipper create the following URLs:

    http://www.aliquam.org/gall01/img1
    http://www.aliquam.org/gall01/img2
    http://www.aliquam.org/gall01/img3
    http://www.aliquam.org/gall01/img4
    ......
    ......

If you put in Img.Rng. something like "00", or "21" or "91" or "42" or any other two digits, your images will be counted like:

    http://www.aliquam.org/gall01/img01
    http://www.aliquam.org/gall01/img02
    http://www.aliquam.org/gall01/img03
    http://www.aliquam.org/gall01/img04
    ......
    ......

You see my point here, right?

Finally we fill in the URL End. field, this last bit will be attached to the end of every generated URL. In the example of our gallery this is simply ".jpg".

Once we told Flipper how to generate the image URLs we must tell the poor sod which are the ranges to browse through, so we tell him that galleries are numbered from G.Min. 1 to G.Max. 3, and that images in the galleries are from I.Min. 1 to I.Max. 4.

To recap:

FieldValue
Gallery Base URLhttp://www.aliquam.org/gall
Gall. Range00
Mid. URL/img
Img. Range00
URL End.jpg
G. Min1
G. Max3
I. Min1
I. Max4

Ignore for the moment being the Save Media and Auto Flip checkboxes and click on OK. If we did all the right way then you should see appearing in your browser the first image of the first gallery.

Pressing CTRL+ will load the next image in the first gallery, CTRL+ will go to the previous image. Pressing CTRL+ will skip to the first image of the next gallery, whilst pressing CTRL+ will send you right to the first image of the previous gallery.

A bit must be said about this flipping: images that return a 404 (page not found) or a redirection will be skipped; after the last image of a gallery going forward will beam you to the first image of the next gallery. If browsing by gallery Flipper will flip away till it finds a gallery starting with an image with the lowest index in the image range; if instead it tries to find the "next" image at the end of a gallery it will flip images one by one, and galleries, till it finds a visible image.

If any of this doesn't make much sense, just try browsing for a while and you'll get the point!

Bonus features

This Flipper of mine may actually do something more than simple flipping. A look at the source code should clear up most of what I'm going to tell you next.

The first two features that pop up are the two checkboxes on the dialog: Save Media and Auto Flip. If you check the first one, and make sure you select a download path, while you're flipping the images or media you see will be saved below the directory you specified in a folder name after the domain you're reading stuff from. The other checkbox, Auto Flip, will flip automatically every image and every gallery, you see that this will become quite handy when you want to download entire galleries. Beware! This two options are quite an hack, they may behave weirdly and badly, so use them with all the caution that is due to something that writes on your disk!

The other features don't actually pop-up pretty much, I'd say these are also some quick hacks I made to the code to make room for some stuff my friends asked me to add; these features are basically some special meaning strings that will be substituted by Flipper when creating the URL to the image. Here we go!

- : From this version using a simple "-" in the Gal. Range field will make it so that building the URL this field will be skipped. This lets you create a single un-numbered gallery that you can browse simply navigating single images.

--fg-- : This bit will be substituted with the gallery number, formatted as requested by the user according to Gal. Rng., so if you have defined a middle URL of /img--fg--_ and you're browsing gallery 8, the middle URL would actually be /img08_ if you have Gal.Rng. set to, for example, "00".

--g-- : This is a bit like --fg--, but it will be substituted in the URL with the actual gallery number, no formatting done; in this case, with Mid.URL defined as above, for gallery number 8, no matter what you have in Gal.Rng., you would have as result /img8_

[delta] : This will be substituted by the number of the gallery plus or minus the deltal, if you write in the URL "[-10]" and you are at gallery 21 the resulting string will be, no surprise here, 11. If you instead wrote "[10]" in the URL, still for gallery 21, it would become 31. Coll, right?.

(str1,str2,...) : Another cool hack! The strings you specified between parenthesis will be rotated and used, so, if you wrote "(a,b,c,d)" the URL would see as you browse through the galleries this bit becoming a then b then c then d and then again from the first a... and so on and so forth.

Letter counting : try putting in the gallery ranges or image ranges some letters, say Gal.Min a and Gal.Max x and see what happens. This is tricky and may not work properly, but still, it works when things are simple!

Future developements

One thing I would like to add is the ability to simply click on a specific type of URL, say something like "flipper://something..." and automatically get the galleries defined in the URL. I still don't get if it's possible to add a protocol handler using XUL...

Now, if you want to comment, greet, suggest, insult, use the e-mail address dedicated to this nice software of mine! The e-mail is "f l i p p e r @aliquam.org", without all those spaces.

Install Flipper!

If you simply want to download the extension and use it later on, or simply to look at it in awe, right click HERE and save it locally on your machine.

Key Summary

CTRL+END

Start Flipper dialog box. Here you define the gallery starting from the displayed image.


CTRL+

Flip to the next image in this gallery. If at the end skip to first image of next gallery.


CTRL+

Flip to the previous image in this gallery. If at the beginning skip to the last image of the previous gallery.


CTRL+

Flip to the first image of the next gallery.


CTRL+

Flip to the first image of the previous gallery


CTRLINS

Increment the current image number (No gallery setup needed)


CTRL+DEL

Decrement the current image number (No gallery setup needed)