From 2ade638d790e259ba21b7e52bc19a29fc98c2f7d Mon Sep 17 00:00:00 2001 From: riking Date: Tue, 18 Mar 2014 18:25:29 -0700 Subject: [PATCH] Remove unused variables --- app/assets/javascripts/discourse/lib/autocomplete.js | 3 +-- app/assets/javascripts/discourse/lib/caret_position.js | 2 -- app/assets/javascripts/discourse/lib/eyeline.js | 4 ---- .../javascripts/discourse/views/actions_history_view.js | 1 + app/jobs/scheduled/poll_mailbox.rb | 2 +- 5 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/autocomplete.js b/app/assets/javascripts/discourse/lib/autocomplete.js index f439626b5..fdb424c0e 100644 --- a/app/assets/javascripts/discourse/lib/autocomplete.js +++ b/app/assets/javascripts/discourse/lib/autocomplete.js @@ -271,7 +271,7 @@ $.fn.autocomplete = function(options) { }); return $(this).keydown(function(e) { - var c, caretPosition, i, initial, next, nextIsGood, prev, prevIsGood, stopFound, term, total, userToComplete; + var c, caretPosition, i, initial, next, prev, prevIsGood, stopFound, term, total, userToComplete; if(options.allowAny){ // saves us wiring up a change event as well, keypress is while its pressed @@ -298,7 +298,6 @@ $.fn.autocomplete = function(options) { if ((completeStart === null) && e.which === 8 && options.key) { c = Discourse.Utilities.caretPosition(me[0]); next = me[0].value[c]; - nextIsGood = next === void 0 || /\s/.test(next); c -= 1; initial = c; prevIsGood = true; diff --git a/app/assets/javascripts/discourse/lib/caret_position.js b/app/assets/javascripts/discourse/lib/caret_position.js index 8569d3b76..c08127728 100644 --- a/app/assets/javascripts/discourse/lib/caret_position.js +++ b/app/assets/javascripts/discourse/lib/caret_position.js @@ -71,8 +71,6 @@ $.fn.caretPosition = function(options) { "line-height": important("line-height") }); - before = void 0; - after = void 0; pos = options && (options.pos || options.pos === 0) ? options.pos : getCaret(textarea[0]); val = textarea.val().replace("\r", ""); if (options && options.key) { diff --git a/app/assets/javascripts/discourse/lib/eyeline.js b/app/assets/javascripts/discourse/lib/eyeline.js index 54a0434f5..ded17866e 100644 --- a/app/assets/javascripts/discourse/lib/eyeline.js +++ b/app/assets/javascripts/discourse/lib/eyeline.js @@ -21,7 +21,6 @@ Discourse.Eyeline.prototype.update = function() { docViewBottom = docViewTop + windowHeight, $elements = $(this.selector), atBottom = false, - foundElement = false, bottomOffset = $elements.last().offset(), self = this; @@ -29,9 +28,6 @@ Discourse.Eyeline.prototype.update = function() { atBottom = (bottomOffset.top <= docViewBottom) && (bottomOffset.top >= docViewTop); } - // Whether we've seen any elements in this search - foundElement = false; - return $elements.each(function(i, elem) { var $elem = $(elem), elemTop = $elem.offset().top, diff --git a/app/assets/javascripts/discourse/views/actions_history_view.js b/app/assets/javascripts/discourse/views/actions_history_view.js index 61bb81c01..06ec4b6ac 100644 --- a/app/assets/javascripts/discourse/views/actions_history_view.js +++ b/app/assets/javascripts/discourse/views/actions_history_view.js @@ -47,6 +47,7 @@ Discourse.ActionsHistoryComponent = Em.Component.extend({ var key = 'post.actions.people.' + c.get('actionType.name_key'); if (postUrl) { key = key + "_with_url"; } + // TODO postUrl might be uninitialized? pick a good default buffer.push(" " + I18n.t(key, { icons: iconsHtml, postUrl: postUrl}) + "."); } renderActionIf('usersCollapsed', 'who-acted', c.get('description')); diff --git a/app/jobs/scheduled/poll_mailbox.rb b/app/jobs/scheduled/poll_mailbox.rb index 581ab2193..0b70aa932 100644 --- a/app/jobs/scheduled/poll_mailbox.rb +++ b/app/jobs/scheduled/poll_mailbox.rb @@ -22,7 +22,7 @@ module Jobs begin mail_string = mail.pop Email::Receiver.new(mail_string).process - rescue Email::Receiver::UserNotSufficientTrustLevelError => e + rescue Email::Receiver::UserNotSufficientTrustLevelError # inform the user about the rejection @message = Mail::Message.new(mail_string) clientMessage = RejectionMailer.send_trust_level(@message.from, @message.body)