CoffeeScript 1.7

pull/62/merge
Thibaut 11 years ago
parent 722a045475
commit 71afc2efa3

@ -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}$"

@ -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: ->

@ -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

@ -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

@ -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: ->

@ -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) =>

@ -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

Loading…
Cancel
Save