Guest User

Tampermonkey script to show a tooltip for flags on etf2l.org

a guest
Aug 2nd, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name       ETF2L - Tooltips for flags
  3. // @namespace  http://etf2l.org/
  4. // @require    http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
  5. // @version    0.1
  6. // @description  Adds a title to flag images.
  7. // @match      http://etf2l.org/*
  8. // @copyright  2012+, Dave
  9. // ==/UserScript==
  10.  
  11. $('img[src^="http:\/\/etf2l.org\/images\/flags\/"]').each(function(index) {
  12.     var pattern = /http:\/\/etf2l\.org\/images\/flags\/(\w+)\.gif/;
  13.     var country = pattern.exec($(this).attr("src"))[1];
  14.    
  15.     if(country != null && country != '') {
  16.            $(this).attr('title', country);
  17.     }    
  18. });
Advertisement
Add Comment
Please, Sign In to add comment