From 2b65686636270dbbcef2d306fd8a4be3cf7f5502 Mon Sep 17 00:00:00 2001 From: Hiro Asari Date: Sat, 11 Jan 2014 13:42:34 -0500 Subject: [PATCH] Rearrange github link helpers So that regex and transformation appear together. --- assets/scripts/app/helpers/helpers.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/scripts/app/helpers/helpers.coffee b/assets/scripts/app/helpers/helpers.coffee index 862e9290..cd6f49a7 100644 --- a/assets/scripts/app/helpers/helpers.coffee +++ b/assets/scripts/app/helpers/helpers.coffee @@ -79,15 +79,18 @@ require 'config/emoij' self._githubCommitReferenceLink(reference, { owner: owner, repo: repo }, { owner: matchedOwner, repo: matchedRepo, sha: matchedSHA }) text + _githubReferenceRegexp: new RegExp("([\\w-]+)?\\/?([\\w-]+)?(?:#|gh-)(\\d+)", 'g') + _githubReferenceLink: (reference, current, matched) -> owner = matched.owner || current.owner repo = matched.repo || current.repo "#{reference}" - _githubReferenceRegexp: new RegExp("([\\w-]+)?\\/?([\\w-]+)?(?:#|gh-)(\\d+)", 'g') - _githubUserRegexp: new RegExp("\\B@([\\w-]+)", 'g') + _githubUserLink: (reference, username) -> + "#{reference}" + _githubCommitReferenceRegexp: new RegExp("([\\w-]+)?\\/([\\w-]+)?@([0-9A-Fa-f]+)", 'g') _githubCommitReferenceLink: (reference, current, matched) -> @@ -95,9 +98,6 @@ require 'config/emoij' repo = matched.repo || current.repo "#{reference}" - _githubUserLink: (reference, username) -> - "#{reference}" - _normalizeDateString: (string) -> if window.JHW string = string.replace('T', ' ').replace(/-/g, '/')