Guest User

Untitled

a guest
Mar 6th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. function e_sh(string) {
  2. // Backslashes are doubled since we're inside Ruby code
  3. return string.replace(/(?=[^a-zA-Z0-9_.\\/\\-\\x7F-\\xFF\\n])/g, '\\\\').replace(/\\n/g, "'\\n'").replace(/^$/g, "''");
  4. }
  5.  
  6. function click_external_link(evt) {
  7. TextMate.system("open " + e_sh(evt.srcElement.href), null);
  8. }
  9.  
  10. myLink.addEventListener('click', click_external_link, false);
Add Comment
Please, Sign In to add comment