diff --git a/assets/javascripts/lib/page.coffee b/assets/javascripts/lib/page.coffee index da58171e..7a22e3db 100644 --- a/assets/javascripts/lib/page.coffee +++ b/assets/javascripts/lib/page.coffee @@ -121,7 +121,7 @@ pathtoRegexp = (path, keys) -> path = "(#{path.join '|'})" if path instanceof Array path = path - .replace(/\/\(/g, '(?:/') + .replace /\/\(/g, '(?:/' .replace /(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, (_, slash = '', format = '', key, capture, optional) -> keys.push name: key, optional: !!optional str = if optional then '' else slash @@ -132,8 +132,8 @@ pathtoRegexp = (path, keys) -> str += ')' str += optional if optional str - .replace(/([\/.])/g, '\\$1') - .replace(/\*/g, '(.*)') + .replace /([\/.])/g, '\\$1' + .replace /\*/g, '(.*)' new RegExp "^#{path}$" diff --git a/assets/javascripts/models/entry.coffee b/assets/javascripts/models/entry.coffee index 2523bfc8..9ab1c60f 100644 --- a/assets/javascripts/models/entry.coffee +++ b/assets/javascripts/models/entry.coffee @@ -11,11 +11,11 @@ class app.models.Entry extends app.Model searchValue: -> @name .toLowerCase() - .replace('...', ' ') - .replace(' event', '') - .replace(SEPARATORS_REGEXP, '.') - .replace(/\.+/g, '.') - .replace(PARANTHESES_REGEXP, '') + .replace '...', ' ' + .replace ' event', '' + .replace SEPARATORS_REGEXP, '.' + .replace /\.+/g, '.' + .replace PARANTHESES_REGEXP, '' .trim() fullPath: -> diff --git a/assets/javascripts/views/content/content.coffee b/assets/javascripts/views/content/content.coffee index e6c7cbff..bae6130a 100644 --- a/assets/javascripts/views/content/content.coffee +++ b/assets/javascripts/views/content/content.coffee @@ -28,12 +28,12 @@ class app.views.Content extends app.View @entryPage = new app.views.EntryPage @entryPage - .on('loading', @onEntryLoading) - .on('loaded', @onEntryLoaded) + .on 'loading', @onEntryLoading + .on 'loaded', @onEntryLoaded app - .on('ready', @onReady) - .on('bootError', @onBootError) + .on 'ready', @onReady + .on 'bootError', @onBootError return diff --git a/assets/javascripts/views/layout/mobile.coffee b/assets/javascripts/views/layout/mobile.coffee index 359a2e14..f92bb62e 100644 --- a/assets/javascripts/views/layout/mobile.coffee +++ b/assets/javascripts/views/layout/mobile.coffee @@ -23,8 +23,8 @@ class app.views.Mobile extends app.View $.on $('._search'), 'touchend', @onTapSearch app.document.sidebar.search - .on('searching', @showSidebar) - .on('clear', @hideSidebar) + .on 'searching', @showSidebar + .on 'clear', @hideSidebar @activate() return diff --git a/assets/javascripts/views/list/paginated_list.coffee b/assets/javascripts/views/list/paginated_list.coffee index bc3288b5..815e4824 100644 --- a/assets/javascripts/views/list/paginated_list.coffee +++ b/assets/javascripts/views/list/paginated_list.coffee @@ -61,7 +61,7 @@ class app.views.PaginatedList extends app.View paginateTo: (object) -> index = @data.indexOf(object) if index >= PER_PAGE - @paginateNext() for [0...Math.floor(index / PER_PAGE)] + @paginateNext() for [0...(index // PER_PAGE)] return hideTopPage: -> diff --git a/assets/javascripts/views/sidebar/results.coffee b/assets/javascripts/views/sidebar/results.coffee index eac1f1b3..3f55672e 100644 --- a/assets/javascripts/views/sidebar/results.coffee +++ b/assets/javascripts/views/sidebar/results.coffee @@ -16,8 +16,8 @@ class app.views.Results extends app.View @addSubview @listFocus = new app.views.ListFocus @el unless $.isTouchScreen() @search - .on('results', @onResults) - .on('clear', @onClear) + .on 'results', @onResults + .on 'clear', @onClear return onResults: (entries, flags) => diff --git a/assets/javascripts/views/sidebar/sidebar.coffee b/assets/javascripts/views/sidebar/sidebar.coffee index f0d6a7a5..9b0caf72 100644 --- a/assets/javascripts/views/sidebar/sidebar.coffee +++ b/assets/javascripts/views/sidebar/sidebar.coffee @@ -14,8 +14,8 @@ class app.views.Sidebar extends app.View @addSubview @search = new app.views.Search @search - .on('searching', @showResults) - .on('clear', @showDocList) + .on 'searching', @showResults + .on 'clear', @showDocList @results = new app.views.Results @search @docList = new app.views.DocList