diff --git a/package.json b/package.json index 7c43bca47..85ae14ef0 100644 --- a/package.json +++ b/package.json @@ -26,13 +26,13 @@ "grunt-bump": "~0.0.13", "grunt-concurrent": "~0.4.3", "grunt-contrib-clean": "~0.5.0", - "grunt-contrib-coffee": "~0.8.2", + "grunt-contrib-coffee": "~0.9.0", "grunt-contrib-compress": "~0.6.0", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-copy": "~0.5.0", "grunt-contrib-watch": "~0.5.3", "grunt-shell": "~0.6.4", - "load-grunt-tasks": "~0.2.1" + "load-grunt-tasks": "~0.3.0" }, "repository": { "type": "git", diff --git a/src/General/Build.coffee b/src/General/Build.coffee index 1a3efa7ed..f342857af 100644 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -176,7 +176,7 @@ Build = '' if isOP and g.VIEW is 'index' - pageNum = Math.floor Index.liveThreadIDs.indexOf(postID) / Index.threadsNumPerPage + pageNum = Index.liveThreadIDs.indexOf(postID) // Index.threadsNumPerPage pageIcon = " Page #{pageNum}" replyLink = "   [Reply]" else @@ -284,7 +284,7 @@ Build = postCount = data.replies + 1 fileCount = data.images + !!data.ext - pageCount = Math.floor Index.liveThreadIDs.indexOf(thread.ID) / Index.threadsNumPerPage + pageCount = Index.liveThreadIDs.indexOf(thread.ID) // Index.threadsNumPerPage subject = if thread.OP.info.subject "
#{thread.OP.info.subject}
" diff --git a/src/General/Get.coffee b/src/General/Get.coffee index 9fe328a13..d05651789 100644 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -188,7 +188,7 @@ Get = comment = bq.innerHTML # greentext - .replace(/(^|>)(>[^<$]*)(<|$)/g, '$1$2$3') + .replace /(^|>)(>[^<$]*)(<|$)/g, '$1$2$3' # quotes .replace /((>){2}(>\/[a-z\d]+\/)?\d+)/g, '$1' diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 1ce167006..5c6cc8919 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -344,7 +344,7 @@ Index = threadRoot = Build.thread g.BOARD, threadData Index.nodes.push threadRoot, $.el 'hr' if thread = g.BOARD.threads[threadData.no] - thread.setPage Math.floor i / Index.threadsNumPerPage + thread.setPage i // Index.threadsNumPerPage thread.setCount 'post', threadData.replies + 1, threadData.bumplimit thread.setCount 'file', threadData.images + !!threadData.ext, threadData.imagelimit thread.setStatus 'Sticky', !!threadData.sticky @@ -394,8 +394,8 @@ Index = Main.callbackNodes Post, posts buildCatalogViews: -> threads = Index.sortedNodes - .filter((n, i) -> !(i % 2)) - .map((threadRoot) -> Get.threadFromRoot threadRoot) + .filter (n, i) -> !(i % 2) + .map (threadRoot) -> Get.threadFromRoot threadRoot .filter (thread) -> !thread.isHidden catalogThreads = [] for thread in threads when !thread.catalogView @@ -408,8 +408,8 @@ Index = sortedThreadIDs = Index.liveThreadIDs when 'lastreply' sortedThreadIDs = [Index.liveThreadData...].sort((a, b) -> - a = a.last_replies[a.last_replies.length - 1] if 'last_replies' of a - b = b.last_replies[b.last_replies.length - 1] if 'last_replies' of b + [..., a] = a.last_replies if 'last_replies' of a + [..., b] = b.last_replies if 'last_replies' of b b.no - a.no ).map (data) -> data.no when 'birth' diff --git a/src/General/UI.coffee b/src/General/UI.coffee index e52774aea..ee852ccd4 100644 --- a/src/General/UI.coffee +++ b/src/General/UI.coffee @@ -191,7 +191,7 @@ UI = do -> # prevent text selection e.preventDefault() if isTouching = e.type is 'touchstart' - e = e.changedTouches[e.changedTouches.length - 1] + [..., e] = e.changedTouches # distance from pointer to el edge is constant; calculate it here. el = $.x 'ancestor::div[contains(@class,"dialog")][1]', @ rect = el.getBoundingClientRect() diff --git a/src/Posting/QR.cooldown.coffee b/src/Posting/QR.cooldown.coffee index ce0fa7960..e6dd14a8d 100644 --- a/src/Posting/QR.cooldown.coffee +++ b/src/Posting/QR.cooldown.coffee @@ -76,7 +76,7 @@ QR.cooldown = if isReply is cooldown.isReply # Only cooldowns relevant to this post can set the seconds variable: # reply cooldown with a reply, thread cooldown with a thread - elapsed = Math.floor (now - start) / $.SECOND + elapsed = (now - start) // $.SECOND continue if elapsed < 0 # clock changed since then? type = unless isReply 'thread' @@ -91,7 +91,7 @@ QR.cooldown = seconds = Math.max seconds, types[type] - elapsed if seconds and Conf['Cooldown Prediction'] and hasFile and upSpd - seconds -= Math.floor post.file.size / upSpd * upSpdAccuracy + seconds -= post.file.size // (upSpd * upSpdAccuracy) seconds = Math.max seconds, 0 # Update the status when we change posting type. # Don't get stuck at some random number. diff --git a/src/Posting/QR.post.coffee b/src/Posting/QR.post.coffee index 06194bbe3..a38362840 100644 --- a/src/Posting/QR.post.coffee +++ b/src/Posting/QR.post.coffee @@ -35,7 +35,7 @@ QR.post = class else 'new' - prev = QR.posts[QR.posts.length - 1] + [..., prev] = QR.posts QR.posts.push @ @nodes.spoiler.checked = @spoiler = if prev and Conf['Remember Spoiler'] prev.spoiler