dogacsenol / Eksi Sozluk Gizli Bknz Acici

// ==UserScript==
// @namespace     https://openuserjs.org/users/dogacsenol
// @name          Eksi Sozluk Gizli Bknz Acici
// @description   Gizli bknzlari acar, hoverdan tasarruf ettirir. Swh killer.
// @copyright     2017, dogacsenol (https://openuserjs.org/users/dogacsenol)
// @license       MIT
// @version       1.0.0
// @include        http://www.eksisozluk.com/*
// @include        http://eksisozluk.com/*
// @include        https://www.eksisozluk.com/*
// @include        https://eksisozluk.com/*
// @grant none
// ==/UserScript==

// ==OpenUserJS==
// @author dogacsenol
// ==/OpenUserJS==

var matchStr = '(<a title="\\(bkz: )(.*)(\\)".*)';
var repStr = '(<a href="\https://eksisozluk.com/$2\">*:$2</a>)';
var repStrEntryNo = '(<a href="\https://eksisozluk.com/entry/$2\">*:$2</a>)';

var abs;
var re = new RegExp(matchStr);

abs = document.evaluate(
    "//sup[@class='ab']",
    document,
    null,
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
    null);

	
for (var i = 0; i <abs.snapshotLength; i++)
{
  if (abs.snapshotItem(i).innerHTML.indexOf('#') == -1)
    abs.snapshotItem(i).innerHTML = abs.snapshotItem(i).innerHTML.replace(re, repStr);
  else
    abs.snapshotItem(i).innerHTML = abs.snapshotItem(i).innerHTML.replace(re.replace('#', ''), repStrEntryNo);
}