Repository: couchdb-fauxton Updated Branches: refs/heads/master 6bd3d7896 -> 7f118dfc0
Polyfill window.location.origin Old browser do not support `window.location.origin` so we are polyfilling it. Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/7f118dfc Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/7f118dfc Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/7f118dfc Branch: refs/heads/master Commit: 7f118dfc0f9b150063af399c5c76c09e0ef3a3ac Parents: 6bd3d78 Author: Robert Kowalski <[email protected]> Authored: Tue Feb 24 15:24:39 2015 +0100 Committer: Robert Kowalski <[email protected]> Committed: Wed Feb 25 13:38:20 2015 +0100 ---------------------------------------------------------------------- app/app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/7f118dfc/app/app.js ---------------------------------------------------------------------- diff --git a/app/app.js b/app/app.js index 382fd99..af9cab4 100644 --- a/app/app.js +++ b/app/app.js @@ -43,6 +43,16 @@ function(app, $, _, Backbone, Bootstrap, Helpers, constants, Utils, FauxtonAPI, }; } + // make sure we have location.origin + if (_.isUndefined(window.location.origin)) { + var port = ''; + if (window.location.port) { + port = ':' + window.location.port; + } + window.location.origin = window.location.protocol + '//' + + window.location.hostname + port; + } + // Provide a global location to place configuration settings and module // creation also mix in Backbone.Events _.extend(app, {
