linhit / slideshow

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

url+querystring not kept intact as image src #209

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
1. Create an ASP/PHP/etc to output the binary for an image from a database.  
Pass a querystring to select a specific image.
2. Code in the data array (or the div#slideshow-images) the URL+querystring to 
the above page as an image src, rather than an image filename.
3. Attempt to display the image via SlideShow

What is the expected output? What do you see instead?
Expected output is to see the image the URL+querystring displayed.  Instead, 
only the Loader graphic is displayed.  No images are displayed.

What version of the product are you using? On what operating system and browser?
Tools:
mootools-1.3.2-core
mootools-1.3.2.1-more
Slideshow-1.3.2.110508

Browsers:
MSIE 8.0.7600.16385
Firefox 3.6.18
Chrome 12.0.742.100
Safari 5.0.5

Please provide any additional information below.
I've run thru Firebug, and I found my problem.  In _preload, a replace
function is removing the URL's querystring.  So instead of the first
line (below), I get the second line:

What I need:     
http://www.basilthegreat.org/dev_active/lifeteen/banner_download.asp?id=3
What I get   :     
http://www.basilthegreat.org/dev_active/lifeteen/banner_download.asp

The resulting src is meaningless, and triggers the onerror condition.
The exact spot in the code is:

/**
   Private method: preload
       Preloads the next slide in the show, once loaded triggers the
show, updates captions, thumbnails, etc.
   */

       _preload: function(fast){
           var src = this.data.images[this._slide].replace(/([^?]
+).*/, '$1'),
               cached = loaded = !!this.cache[src];
           if (!cached){
               if (!this.preloader)
                    this.preloader = new Asset.image(src, {
                       'onerror': function(){
                           // do something
                       },
                       'onload': function(){
                           this.store('loaded', true);
                       }
                   });
               loaded = this.preloader.retrieve('loaded') &&
this.preloader.get('width');
           }

Original issue reported on code.google.com by webmas...@basilthegreat.org on 29 Jun 2011 at 2:45

GoogleCodeExporter commented 9 years ago

Original comment by aeron.gl...@gmail.com on 1 Jul 2011 at 12:49

GoogleCodeExporter commented 9 years ago
Will be up on github and in the new build later today.

Original comment by aeron.gl...@gmail.com on 9 Jul 2011 at 6:51

GoogleCodeExporter commented 9 years ago
Awesome.  Will test this out in the next day or two, and let you know the 
outcome.

Original comment by webmas...@basilthegreat.org on 10 Jul 2011 at 3:11