class @Utils @navigatePath: (path) -> path = "/" + path unless path.match(/^\//) window.location.href = path @currentPath: -> window.location.href.replace(/https?:\/\/.*?\//g, '') @registerPage: (klass, options = {}) -> if options.forPathsMatching? if Utils.currentPath().match(options.forPathsMatching) window.currentPage = new klass() else new klass() @showDynamicModal: (content = '', { title, body, onHide } = {}) -> $("body").append """ """ modal = document.querySelector('#dynamic-modal') $(modal).find('.modal-title').text(title || '').end().on 'hidden.bs.modal', -> $('#dynamic-modal').remove() onHide?() body?(modal.querySelector('.modal-body')) $(modal).modal('show')