Add the following lines to function tb_show (caption, url, imageGroup) of about 39 rows of wp-shortdes/js/thickbox. js (the bold red word indicates the newly added code)
Copy codeThe Code is as follows: function tb_show (caption, url, imageGroup) {// function called when the user clicks on a thickbox link
Try {
/// The code is omitted...
TB_NextHTML = "";
TB_imageCount = "";
TB_FoundURL = false;
///// Open a new window to display the original image
TB_OpenNewHTML = "";
If (imageGroup ){
/// The code is omitted...
If (TB_FoundURL ){
TB_NextCaption = TB_TempArray [TB_Counter]. title;
TB_NextURL = TB_TempArray [TB_Counter]. href;
TB_NextHTML = "<span id = 'tb _ next'> <a href = '#'>" + thickboxL10n. next + "</a> </span> ";
} Else {
TB_PrevCaption = TB_TempArray [TB_Counter]. title;
TB_PrevURL = TB_TempArray [TB_Counter]. href;
TB_PrevHTML = "<span id = 'tb _ prev'> <a href = '#'>" + thickboxL10n. prev + "</a> </span> ";
}
///// Open a new window to display the original image
TB_OpenNewHTML = "<span style = 'font-size: 11pt '> <a href ='" + url + "'target = '_ blank' style = 'color: red'> view the source image </a> </span> ";
} Else {
TB_FoundURL = true;
TB_imageCount = thickboxL10n. image + ''+ (TB_Counter + 1) +'' + thickboxL10n. of + ''+ (TB_TempArray.length );
///// Open a new window to display the original image
TB_OpenNewHTML = "<span style = 'font-size: 11pt '> <a href ='" + url + "'target = '_ blank' style = 'color: red'> view the source image </a> </span> ";
}
}
}
}
/// The code is omitted...
// Resizing large images-orginal by Christian Montoya edited by me.
/// The code is omitted...
// End Resizing
TB_WIDTH = imageWidth + 30;
TB_HEIGHT = imageHeight + 60;
// JQuery ("# TB_window "). append ("<a href ='' id = 'tb _ imageoff' title = '"+ thickboxL10n. close + "'> </a> "+" <div id = 'tb _ caption '> "+ caption +" <div id = 'tb _ secondLine '> "+ TB_imageCount + TB_PrevHTML + TB_NextHTML +" </div> <div id = 'tb _ closewindow'> <a href =' # 'id = 'tb _ closeWindowButton 'title = '"+ thickboxL10n. close + "'> </a> </div> ");
////// Display the next image + view the original image in a new window (add TB_OpenNewHTML)
JQuery ("# TB_window "). append ("<a href ='' id = 'tb _ nextimage' title = '"+ thickboxL10n. next + "'> </a> "+" <div id = 'tb _ caption '> "+ caption +" <div id = 'tb _ secondLine '> "+ TB_imageCount + TB_PrevHTML + TB_NextHTML + TB_OpenNewHTML +" </div> <div id = 'tb _ closewindow'> <a href = '#' id = 'tb _ closeWindowButton 'title = '"+ thickboxL10n. close + "'> </a> </div> ");
JQuery ("# TB_closeWindowButton"). click (tb_remove );
If (! (TB_PrevHTML = "")){
/// The code is omitted...
Effect:
After you click "View Source image", the original image is displayed in the new browser window (Tab. Author: Elf Sundae)