This repository has been archived by the owner on May 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip(app): use proper URL queries and polish setup
- Loading branch information
1 parent
c2bba6d
commit ce9d684
Showing
13 changed files
with
369 additions
and
162 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
const subdomain = window.location.hostname.split('.').length > 2; | ||
const splitLocation = window.location.toString().split('/'); | ||
if (splitLocation.indexOf('app') >= 0 || subdomain) { | ||
var locationParameter = "/app/?redirect="; | ||
splitLocation.forEach((str) => { | ||
if (splitLocation.indexOf(str) > splitLocation.indexOf('app')) | ||
locationParameter += str + '/'; | ||
}); | ||
window.location.replace(locationParameter); | ||
const pathnameParts = window.location.pathname.split('/').filter(part => part); | ||
if (pathnameParts.shift() === 'app' || subdomain) { | ||
var newLocation = '/app/?redirect=' + pathnameParts.join('/'); | ||
for (const [key, value] of new URLSearchParams(window.location.search)) | ||
newLocation += '&' + key + '=' + window.encodeURIComponent(value); | ||
window.location.replace(newLocation); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.