User:Dixtosa/langspan.js

From Wiktionary, the free dictionary
Jump to navigation Jump to search

Note – after saving, you may have to bypass your browser’s cache to see the changes.

  • Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh);
  • Konqueror and Chrome: click Reload or press F5;
  • Opera: clear the cache in Tools → Preferences;
  • Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.

var ls_langLink = $(".etyl a");

var ls_mapping = {"Georgian" : "17-21th", "Old Georgian" : "5-11th", "English" : "6-21st", "Russian" : "18-21st", "Proto-Kartvelian" : "TBD"};

ls_langLink.each(function(){
    var elem = $(this);
    var ls_span = ls_mapping[elem.text()];
    if (ls_span){
        elem.text(elem.text() + " (" + ls_span + ")");
    }
});