This $.get somehow escaped me.

This commit is contained in:
Zixaphir 2013-04-13 23:41:06 -07:00
parent 478a75d03e
commit 40165ef7e8
2 changed files with 26 additions and 21 deletions

View File

@ -6727,7 +6727,7 @@
} }
}, },
embedder: function(a) { embedder: function(a) {
var callbacks, embed, err, key, match, service, title, titles, type, _ref; var callbacks, embed, key, match, service, type, _ref;
if (!Conf['Embedding']) { if (!Conf['Embedding']) {
return [a]; return [a];
@ -6769,18 +6769,22 @@
embed.setAttribute('data-originalURL', a.href); embed.setAttribute('data-originalURL', a.href);
$.on(embed, 'click', Linkify.toggle); $.on(embed, 'click', Linkify.toggle);
if (Conf['Link Title'] && (service = type.title)) { if (Conf['Link Title'] && (service = type.title)) {
titles = $.get('CachedTitles', {}); $.get('CachedTitles', {}, function(item) {
var err, title, titles;
titles = item['CachedTitles'];
if (title = titles[match[1]]) { if (title = titles[match[1]]) {
a.textContent = title[0]; a.textContent = title[0];
embed.setAttribute('data-title', title[0]); return embed.setAttribute('data-title', title[0]);
} else { } else {
try { try {
$.cache(service.api.call(a), callbacks); return $.cache(service.api.call(a), callbacks);
} catch (_error) { } catch (_error) {
err = _error; err = _error;
a.innerHTML = "[" + key + "] <span class=warning>Title Link Blocked</span> (are you using NoScript?)</a>"; return a.innerHTML = "[" + key + "] <span class=warning>Title Link Blocked</span> (are you using NoScript?)</a>";
} }
} }
});
} }
return [a, $.tn(' '), embed]; return [a, $.tn(' '), embed];
} }

View File

@ -4564,7 +4564,8 @@ Linkify =
$.on embed, 'click', Linkify.toggle $.on embed, 'click', Linkify.toggle
if Conf['Link Title'] and (service = type.title) if Conf['Link Title'] and (service = type.title)
titles = $.get 'CachedTitles', {} $.get 'CachedTitles', {}, (item) ->
titles = item['CachedTitles']
if title = titles[match[1]] if title = titles[match[1]]
a.textContent = title[0] a.textContent = title[0]