Sorry, I made a typo, leaving out a closing quote. I will correct my original post, but here it is highlighted red:
Code:
function popuplinkfunc(imgsrc){
if (popupsetting[0]==1){
var popwin=open("", "popwin", popupsetting[1]);
popwin.document.write('<center><img src="'+imgsrc.href+'"><br>'+imgsrc.href.replace(/\.[^\.]*$/,'')+'<\/center>');
popwin.document.close();
popwin.focus();
return false;
}
else
return true;
}
This next part I won't change in my original post, but to trim the filename further, use this:
Code:
.replace(/^.*\/([^\/]+)\.[^\.]*$/,'$1')
instead of:
Code:
.replace(/\.[^\.]*$/,'')
So, putting it all together:
Code:
function popuplinkfunc(imgsrc){
if (popupsetting[0]==1){
var popwin=open("", "popwin", popupsetting[1]);
popwin.document.write('<center><img src="'+imgsrc.href+'"><br>'+imgsrc.href.replace(/^.*\/([^\/]+)\.[^\.]*$/,'$1')+'<\/center>');
popwin.document.close();
popwin.focus();
return false;
}
else
return true;
}
Bookmarks