Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

core.js update #18

Open
wants to merge 2 commits into from

2 participants

@brgrz

updated fileExtension variable to correct the regex to only return the extension when file is in format "foobar.png" (with dot as extension separator)

brgrz added some commits
@lukescott

This is somewhat related. When you do rel="shadowbox;content=image.jpg" it incorrectly selects "iframe" as the player. Not really sure how to do diffs, but you just need to move this:

if (!obj.player)
    obj.player = S.getPlayer(obj.content);

At the end just before the return (So after the if(rel) {...}). What's happening is it's getting the player before the HTML options "trump" the JavaScript options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 5, 2011
  1. @brgrz

    updated fileExtension variable to correct the regex to only return th…

    brgrz authored
    …e extension when file is in format "foobar.png" (with dot as extension separator)
  2. @brgrz
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 source/core.js
View
4 source/core.js
@@ -28,7 +28,7 @@ Array.prototype.contains = Array.prototype.contains || function (obj) {
var galleryName = /^(light|shadow)box\[(.*?)\]/i,
inlineParam = /\s*([a-z_]*?)\s*=\s*(.+)\s*/,
- fileExtension = /[0-9a-z]+$/i,
+ fileExtension = /\.([0-9a-z]+)(?:[\?#]|$)/i,
scriptPath = /(.+\/)shadowbox\.js/i,
root = document.documentElement,
@@ -826,7 +826,7 @@ S.getPlayer = function(content) {
// get file extension
var ext, m = content.match(fileExtension);
if (m) {
- ext = m[0].toLowerCase();
+ ext = m[1].toLowerCase();
}
if (ext) {
Something went wrong with that request. Please try again.