Unified · Split
| @@ -121,7 +121,7 @@ pathtoRegexp = (path, keys) -> · 120 unmodified lines | |||
| 121 | 121 | ||
| 122 | path = "(#{path.join '|'})" if path instanceof Array | 122 | path = "(#{path.join '|'})" if path instanceof Array |
| 123 | path = path | 123 | 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: !!optional | 126 | keys.push name: key, optional: !!optional |
| 127 | str = if optional then '' else slash | 127 | str = if optional then '' else slash |
| @@ -132,8 +132,8 @@ pathtoRegexp = (path, keys) -> · 4 unmodified lines | |||
| 132 | str += ')' | 132 | str += ')' |
| 133 | str += optional if optional | 133 | str += optional if optional |
| 134 | str | 134 | 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 | ||
| @@ -11,11 +11,11 @@ class app.models.Entry extends app.Model · 10 unmodified lines | |||
| 11 | searchValue: -> | 11 | searchValue: -> |
| 12 | @name | 12 | @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: -> |
| @@ -28,12 +28,12 @@ class app.views.Content extends app.View · 27 unmodified lines | |||
| 28 | @entryPage = new app.views.EntryPage | 28 | @entryPage = new app.views.EntryPage |
| 29 | 29 | ||
| 30 | @entryPage | 30 | @entryPage |
| 31 | .on('loading', @onEntryLoading) | 31 | .on 'loading', @onEntryLoading |
| 32 | .on('loaded', @onEntryLoaded) | 32 | .on 'loaded', @onEntryLoaded |
| 33 | 33 | ||
| 34 | app | 34 | app |
| 35 | .on('ready', @onReady) | 35 | .on 'ready', @onReady |
| 36 | .on('bootError', @onBootError) | 36 | .on 'bootError', @onBootError |
| 37 | 37 | ||
| 38 | return | 38 | return |
| 39 | 39 | ||
| @@ -23,8 +23,8 @@ class app.views.Mobile extends app.View · 22 unmodified lines | |||
| 23 | $.on $('._search'), 'touchend', @onTapSearch | 23 | $.on $('._search'), 'touchend', @onTapSearch |
| 24 | 24 | ||
| 25 | app.document.sidebar.search | 25 | 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 | return | 30 | return |
| @@ -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_PAGE | 63 | if index >= PER_PAGE |
| 64 | @paginateNext() for [0...Math.floor(index / PER_PAGE)] | 64 | @paginateNext() for [0...(index // PER_PAGE)] |
| 65 | return | 65 | return |
| 66 | 66 | ||
| 67 | hideTopPage: -> | 67 | hideTopPage: -> |
| @@ -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 | @search | 18 | @search |
| 19 | .on('results', @onResults) | 19 | .on 'results', @onResults |
| 20 | .on('clear', @onClear) | 20 | .on 'clear', @onClear |
| 21 | return | 21 | return |
| 22 | 22 | ||
| 23 | onResults: (entries, flags) => | 23 | onResults: (entries, flags) => |
| @@ -14,8 +14,8 @@ class app.views.Sidebar extends app.View · 13 unmodified lines | |||
| 14 | @addSubview @search = new app.views.Search | 14 | @addSubview @search = new app.views.Search |
| 15 | 15 | ||
| 16 | @search | 16 | @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 @search | 20 | @results = new app.views.Results @search |
| 21 | @docList = new app.views.DocList | 21 | @docList = new app.views.DocList |