1jQuery(function() {
2
3    jQuery('div.dokuwiki a.plugin_linksenhanced_pending').each(function() {
4        var $link = jQuery(this).prop('href');
5        if(!$link)
6            return;
7        var $obj = jQuery(this);
8        // If we are still here, we found our target link
9        jQuery.post(
10            DOKU_BASE + 'lib/exe/ajax.php',
11            {
12                call: 'plugin_linksenhanced',
13                url: $link,
14                action: 'check',
15                sectok: JSINFO.plugin.linksenhanced['sectok'],
16            },
17            function(data)
18            {
19                var result = data['result'];
20                if(result === true)
21                {
22                    $obj.removeClass('plugin_linksenhanced_pending');
23                    $obj.addClass('plugin_linksenhanced_online');
24                }
25                else
26                {
27                    $obj.removeClass('plugin_linksenhanced_pending');
28                    $obj.addClass('plugin_linksenhanced_offline');
29                }
30            }
31        );
32    });
33});
34