From e757183cec10a6dd31919b3d7013a3d6f8d0ec41 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 12 Mar 2014 01:29:24 -0400 Subject: [PATCH] linting --- public/src/forum/admin/topics.js | 50 +++++++++++++++++--------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/public/src/forum/admin/topics.js b/public/src/forum/admin/topics.js index bcd4a2f4ec..5bb0d3eb0b 100644 --- a/public/src/forum/admin/topics.js +++ b/public/src/forum/admin/topics.js @@ -1,3 +1,6 @@ +"use strict"; +/* global define, socket, app, templates, RELATIVE_PATH */ + define(function() { var Topics = {}; @@ -13,30 +16,29 @@ define(function() { tid = $this.parents('[data-tid]').attr('data-tid'); switch (action) { - case 'pin': - if (!$this.hasClass('active')) { - socket.emit('topics.pin', tid, Topics.pin); - } else { - socket.emit('topics.unpin', tid, Topics.unpin); - } - break; - - case 'lock': - if (!$this.hasClass('active')) { - socket.emit('topics.lock', tid, Topics.lock); - } else { - socket.emit('topics.unlock', tid, Topics.unlock); - } - break; + case 'pin': + if (!$this.hasClass('active')) { + socket.emit('topics.pin', tid, Topics.pin); + } else { + socket.emit('topics.unpin', tid, Topics.unpin); + } + break; - case 'delete': - if (!$this.hasClass('active')) { - socket.emit('topics.delete', tid, Topics.setDeleted); - } else { - socket.emit('topics.restore', tid, Topics.restore); - } - break; + case 'lock': + if (!$this.hasClass('active')) { + socket.emit('topics.lock', tid, Topics.lock); + } else { + socket.emit('topics.unlock', tid, Topics.unlock); + } + break; + case 'delete': + if (!$this.hasClass('active')) { + socket.emit('topics.delete', tid, Topics.setDeleted); + } else { + socket.emit('topics.restore', tid, Topics.restore); + } + break; } }); @@ -48,7 +50,7 @@ define(function() { return; } - var lastTid = parseInt(topics.eq(topics.length - 1).attr('data-tid')); + var lastTid = parseInt(topics.eq(topics.length - 1).attr('data-tid'), 10); $(this).html(' Retrieving topics'); socket.emit('admin.topics.getMore', { @@ -64,7 +66,7 @@ define(function() { if (topics.length > 0) { templates.preload_template('admin/topics', function() { templates['admin/topics'].parse({topics:[]}); - var html = templates.prepare(templates['admin/topics'].blocks['topics']).parse({ + var html = templates.prepare(templates['admin/topics'].blocks.topics).parse({ topics: topics }), topicsListEl = $('.topics');