| 149 | module.exports.init = init |
| 150 | |
| 151 | var handleNormalUrls = () => // https://artsy.github.io/blog/2012/06/25/replacing-hashbang-routes-with-pushstate/ |
| 152 | $(document).on('click', "a[href^='/']", function (event) { |
| 153 | const href = $(event.currentTarget).attr('href') |
| 154 | const target = $(event.currentTarget).attr('target') |
| 155 | |
| 156 | // chain 'or's for other black list routes |
| 157 | const passThrough = href.indexOf('sign_out') >= 0 |
| 158 | |
| 159 | // Allow shift+click for new tabs, etc. |
| 160 | if (passThrough || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey || (target === '_blank')) { |
| 161 | return |
| 162 | } |
| 163 | |
| 164 | event.preventDefault() |
| 165 | |
| 166 | // Remove leading slashes and hash bangs (backward compatablility) |
| 167 | const url = href.replace(/^\//, '').replace('\#\!\/', '') |
| 168 | |
| 169 | // Instruct Backbone to trigger routing events |
| 170 | app.router.navigate(url, { trigger: true }) |
| 171 | |
| 172 | return false |
| 173 | }) |
| 174 | |
| 175 | var setUpBackboneMediator = function (app) { |
| 176 | let schemas |