mjackson / mjackson/shadowbox

shadowbox fails on links that include slugified image filenames

Open
#17 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
293
Forks
110
PR merge metrics
No merged PRs in 30d

Description

In our CMS, we are using links such as

http://localhost:59744/Admin/ContentPage/EditAttachment/31/Hydrangeas-jpg

to edit an attachment to the content of type ContentPage where 31 indicates the content ID and Hydrangeas-jpg indicates the slugified filename that is attached. This link will display a form that allows editing/replacing the attached file. The response from the server works fine (if opened by browsing directly to the URL). However, if including this URL in a link with Shadowbox attached to that link, the Shadowbox will open partially then start loading and never completely open and load the link.

This only happens when the link contains "-jpg", "-gif" or "-png", so for the image extensions only. I guess it must be detecting that we are trying to open an image (while we don't, we want to open the HTML page) because it is working for "-pdf".

At first I thought the dash "-" was the problem but then figured out that it works perfectly for instance for

http://localhost:59744/Admin/ContentPage/EditAttachment/31/leaflet-pdf

Hopefully you will be able to reproduce and fix this. Thank you for a great product.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the ContentPage edit URL ending in -jpg, -gif, or -png, comparing it with the working -pdf URL. Start by tracing Shadowbox's link-type detection and loading behavior; done means these URLs open their HTML form completely instead of being treated as images.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.