From 65743c22fd40abd94baecdeb57eb53841023810c Mon Sep 17 00:00:00 2001 From: Samuel Cochran Date: Wed, 26 Mar 2014 20:30:59 +1100 Subject: [PATCH] Fix messages count on initial page load --- assets/javascripts/mailcatcher.js.coffee | 35 +----------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/assets/javascripts/mailcatcher.js.coffee b/assets/javascripts/mailcatcher.js.coffee index 86f0530..8f40271 100644 --- a/assets/javascripts/mailcatcher.js.coffee +++ b/assets/javascripts/mailcatcher.js.coffee @@ -123,7 +123,6 @@ class MailCatcher @refresh() @subscribe() - @updateMessagesCount() # Only here because Safari's Date parsing *sucks* # We throw away the timezone, but you could use it for something... @@ -287,44 +286,12 @@ class MailCatcher text = text.replace(/\n/g, "
") message_iframe.find("html").html("#{text}") - loadMessageAnalysis: (id) -> - id ||= @selectedMessage() - - $("#message .views .analysis.tab:not(.selected)").addClass("selected") - $("#message .views :not(.analysis).tab.selected").removeClass("selected") - - if id? - # Makes a new iframe and populate it with a quick intro and a button - $iframe = $("#message iframe").contents().children() - .html(""" - - - Analysis - #{$('link[rel="stylesheet"]')[0].outerHTML} - - -

Analyse your email with Fractal

-

Fractal is a really neat service that applies common email design and development knowledge from Email Standards Project to your HTML email and tells you what you've done wrong or what you should do instead.

-

Please note that this sends your email to the Fractal service for analysis. Read their terms of service if you're paranoid.

-
- -
- - - """) - $form = $iframe.find("form") - .submit (e) -> - e.preventDefault() - $(this) - .find("""input[type="submit"]""").attr("disabled", "disabled").end() - .find(".loading").show() - $("#message iframe").contents().find("body").xslt("/messages/#{id}/analysis.xml", "/stylesheets/analysis.xsl") - refresh: -> $.getJSON "/messages", (messages) => $.each messages, (i, message) => unless @haveMessage message @addMessage message + @updateMessagesCount() subscribe: -> if WebSocket?