Ok, make the below changes to the frontend JavaScript to add the option of using the file names (minus extension) as the caption instead of a static text like "Photo 1", "Photo 2" etc.
Step 1:
Locate the line:
Code:
var descriptionprefix=[1, "Photo "]
inside the JavaScript, and change that to:
Code:
var descriptionprefix=[1, "filename"]
function buildcaption(i){
if (descriptionprefix[1]=="filename")
return galleryarray[i].substring(0, galleryarray[i].lastIndexOf("."))
else
return descriptionprefix[1]+(i+1)
}
Step 2:
Locate the line:
Code:
tempcontainer+=(descriptionprefix[0]==1)? descriptionprefix[1]+(i+1) : ""
and change that to:
Code:
tempcontainer+=(descriptionprefix[0]==1)? buildcaption(i) : ""
That's it. By entering "filename" in Step 1, the script will now use the file names as caption. You can still change that to a static text, by entering "Photo ", for example.
Bookmarks