diff --git a/src/General/lib/$.coffee b/src/General/lib/$.coffee index fb521fa1c..678fa9f4f 100755 --- a/src/General/lib/$.coffee +++ b/src/General/lib/$.coffee @@ -61,7 +61,8 @@ $.ajax = do -> r.open type, url, true catch err blockedError url - return options.onerror?() + options.onerror?() + return if whenModified r.setRequestHeader 'If-Modified-Since', lastModified[url] if url of lastModified $.on r, 'load', -> lastModified[url] = r.getResponseHeader 'Last-Modified' @@ -77,13 +78,13 @@ do -> $.cache = (url, cb, options) -> if req = reqs[url] if req.readyState is 4 - cb.call req, req.evt + $.queueTask -> cb.call req, req.evt else req.callbacks.push cb - return + return req rm = -> delete reqs[url] try - req = $.ajax url, options + return unless req = $.ajax url, options catch err return $.on req, 'load', (e) -> diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index a5ebcbc74..f882b8fab 100755 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -171,11 +171,8 @@ Linkify = title: (data) -> [key, uid, options, link, post] = data return unless service = Linkify.types[key].title - try - $.cache service.api(uid), (-> Linkify.cb.title @, data), responseType: 'json' - catch err + unless $.cache service.api(uid), (-> Linkify.cb.title @, data), {responseType: 'json'} $.extend link, <%= html('[${key}] Title Link Blocked (are you using NoScript?)') %> - return cb: toggle: (e) ->