Fixes #45
Unified · Split
| @@ -260,6 +260,9 @@ ESCAPE_REGEXP = /([.*+?^=!:${}()|\[\]\/\\])/g · 259 unmodified lines | ||
| 260 | 260 | $.escapeRegexp = (string) -> |
| 261 | 261 | string.replace ESCAPE_REGEXP, "\\$1" |
| 262 | 262 | |
| 263 | +$.urlDecode = (string) -> | |
| 264 | + decodeURIComponent string.replace(/\+/g, '%20') | |
| 265 | + | |
| 263 | 266 | # |
| 264 | 267 | # Miscellaneous |
| 265 | 268 | # |
| @@ -116,4 +116,4 @@ class app.views.Search extends app.View · 115 unmodified lines | ||
| 116 | 116 | value |
| 117 | 117 | |
| 118 | 118 | getHashValue: -> |
| 119 | − try (new RegExp "##{SEARCH_PARAM}=(.*)").exec(decodeURIComponent location.hash)?[1] catch | |
| 119 | + try (new RegExp "##{SEARCH_PARAM}=(.*)").exec($.urlDecode location.hash)?[1] catch | |
| @@ -76,9 +76,9 @@ class app.views.SearchScope extends app.View · 75 unmodified lines | ||
| 76 | 76 | |
| 77 | 77 | extractHashValue: -> |
| 78 | 78 | if value = @getHashValue() |
| 79 | − newHash = decodeURIComponent(location.hash).replace "##{SEARCH_PARAM}=#{value} ", "##{SEARCH_PARAM}=" | |
| 79 | + newHash = $.urlDecode(location.hash).replace "##{SEARCH_PARAM}=#{value} ", "##{SEARCH_PARAM}=" | |
| 80 | 80 | app.router.replaceHash(newHash) |
| 81 | 81 | value |
| 82 | 82 | |
| 83 | 83 | getHashValue: -> |
| 84 | − try (new RegExp "^##{SEARCH_PARAM}=(.+?) .").exec(decodeURIComponent location.hash)?[1] catch | |
| 84 | + try (new RegExp "^##{SEARCH_PARAM}=(.+?) .").exec($.urlDecode location.hash)?[1] catch | |