History

CoffeeScript 1.7

Thibaut committed 12 years ago

Commit 71afc2e1 parent 722a0457 files · +19 −19Browse files

Unified · Split

7 files
  1. assets/javascripts/lib/page.coffee +3 −3
  2. assets/javascripts/models/entry.coffee +5 −5
  3. assets/javascripts/views/content/content.coffee +4 −4
  4. assets/javascripts/views/layout/mobile.coffee +2 −2
  5. assets/javascripts/views/list/paginated_list.coffee +1 −1
  6. assets/javascripts/views/sidebar/results.coffee +2 −2
  7. assets/javascripts/views/sidebar/sidebar.coffee +2 −2
assets/javascripts/lib/page.coffee+3−3
@@ -121,7 +121,7 @@ pathtoRegexp = (path, keys) -> · 120 unmodified lines
121 121
122 path = "(#{path.join '|'})" if path instanceof Array122 path = "(#{path.join '|'})" if path instanceof Array
123 path = path123 path = path
124 .replace(/\/\(/g, '(?:/')124 .replace /\/\(/g, '(?:/'
125 .replace /(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, (_, slash = '', format = '', key, capture, optional) ->125 .replace /(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, (_, slash = '', format = '', key, capture, optional) ->
126 keys.push name: key, optional: !!optional126 keys.push name: key, optional: !!optional
127 str = if optional then '' else slash127 str = if optional then '' else slash
@@ -132,8 +132,8 @@ pathtoRegexp = (path, keys) -> · 4 unmodified lines
132 str += ')'132 str += ')'
133 str += optional if optional133 str += optional if optional
134 str134 str
135 .replace(/([\/.])/g, '\\$1')135 .replace /([\/.])/g, '\\$1'
136 .replace(/\*/g, '(.*)')136 .replace /\*/g, '(.*)'
137 137
138 new RegExp "^#{path}$"138 new RegExp "^#{path}$"
139 139
assets/javascripts/models/entry.coffee+5−5
@@ -11,11 +11,11 @@ class app.models.Entry extends app.Model · 10 unmodified lines
11 searchValue: ->11 searchValue: ->
12 @name12 @name
13 .toLowerCase()13 .toLowerCase()
14 .replace('...', ' ')14 .replace '...', ' '
15 .replace(' event', '')15 .replace ' event', ''
16 .replace(SEPARATORS_REGEXP, '.')16 .replace SEPARATORS_REGEXP, '.'
17 .replace(/\.+/g, '.')17 .replace /\.+/g, '.'
18 .replace(PARANTHESES_REGEXP, '')18 .replace PARANTHESES_REGEXP, ''
19 .trim()19 .trim()
20 20
21 fullPath: ->21 fullPath: ->
assets/javascripts/views/content/content.coffee+4−4
@@ -28,12 +28,12 @@ class app.views.Content extends app.View · 27 unmodified lines
28 @entryPage = new app.views.EntryPage28 @entryPage = new app.views.EntryPage
29 29
30 @entryPage30 @entryPage
31 .on('loading', @onEntryLoading)31 .on 'loading', @onEntryLoading
32 .on('loaded', @onEntryLoaded)32 .on 'loaded', @onEntryLoaded
33 33
34 app34 app
35 .on('ready', @onReady)35 .on 'ready', @onReady
36 .on('bootError', @onBootError)36 .on 'bootError', @onBootError
37 37
38 return38 return
39 39
assets/javascripts/views/layout/mobile.coffee+2−2
@@ -23,8 +23,8 @@ class app.views.Mobile extends app.View · 22 unmodified lines
23 $.on $('._search'), 'touchend', @onTapSearch23 $.on $('._search'), 'touchend', @onTapSearch
24 24
25 app.document.sidebar.search25 app.document.sidebar.search
26 .on('searching', @showSidebar)26 .on 'searching', @showSidebar
27 .on('clear', @hideSidebar)27 .on 'clear', @hideSidebar
28 28
29 @activate()29 @activate()
30 return30 return
assets/javascripts/views/list/paginated_list.coffee+1−1
@@ -61,7 +61,7 @@ class app.views.PaginatedList extends app.View · 60 unmodified lines
61 paginateTo: (object) ->61 paginateTo: (object) ->
62 index = @data.indexOf(object)62 index = @data.indexOf(object)
63 if index >= PER_PAGE63 if index >= PER_PAGE
64 @paginateNext() for [0...Math.floor(index / PER_PAGE)]64 @paginateNext() for [0...(index // PER_PAGE)]
65 return65 return
66 66
67 hideTopPage: ->67 hideTopPage: ->
assets/javascripts/views/sidebar/results.coffee+2−2
@@ -16,8 +16,8 @@ class app.views.Results extends app.View · 15 unmodified lines
16 @addSubview @listFocus = new app.views.ListFocus @el unless $.isTouchScreen()16 @addSubview @listFocus = new app.views.ListFocus @el unless $.isTouchScreen()
17 17
18 @search18 @search
19 .on('results', @onResults)19 .on 'results', @onResults
20 .on('clear', @onClear)20 .on 'clear', @onClear
21 return21 return
22 22
23 onResults: (entries, flags) =>23 onResults: (entries, flags) =>
assets/javascripts/views/sidebar/sidebar.coffee+2−2
@@ -14,8 +14,8 @@ class app.views.Sidebar extends app.View · 13 unmodified lines
14 @addSubview @search = new app.views.Search14 @addSubview @search = new app.views.Search
15 15
16 @search16 @search
17 .on('searching', @showResults)17 .on 'searching', @showResults
18 .on('clear', @showDocList)18 .on 'clear', @showDocList
19 19
20 @results = new app.views.Results @search20 @results = new app.views.Results @search
21 @docList = new app.views.DocList21 @docList = new app.views.DocList