Advertisement
Guest User

Untitled

a guest
Nov 4th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var removeOverlay = function(re) {
  2.     this.href = this.getAttribute('onclick').match(re).pop();
  3.     this.removeAttribute('onclick');
  4.     this.setAttribute('target', '_blank');    
  5. };
  6.  
  7. $('a.img_filename, a.expand_image').each((i,v) => {
  8.     switch(v.className) {
  9.         case 'img_filename':
  10.             removeOverlay.call(v, /'(.*)'/)
  11.             break;
  12.         case 'expand_image':
  13.             removeOverlay.call(v, /','(.*)',/)
  14.             break;
  15.     }
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement