Skip to content

Commit

Permalink
Closes #245 Merge branch 'issue/245_deployment_issues'
Browse files Browse the repository at this point in the history
  • Loading branch information
Zsolt Lattmann committed Mar 16, 2015
2 parents afff8ba + 19b011f commit 33e4534
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/client/js/WebGME.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,12 @@ define(['logManager',
openProjectLoadDialog;

// URL query has higher priority than the config.
initialThingsToDo.projectToLoad = initialThingsToDo.projectToLoad || gmeConfig.client.defaultProject.name;
initialThingsToDo.branchToLoad = initialThingsToDo.branchToLoad || gmeConfig.client.defaultProject.branch;
initialThingsToDo.objectToLoad = initialThingsToDo.objectToLoad || gmeConfig.client.defaultProject.node;
if ((initialThingsToDo.projectToLoad || initialThingsToDo.createNewProject) === false) {
initialThingsToDo.projectToLoad = gmeConfig.client.defaultProject.name;
initialThingsToDo.branchToLoad = initialThingsToDo.branchToLoad || gmeConfig.client.defaultProject.branch;
initialThingsToDo.objectToLoad = initialThingsToDo.objectToLoad || gmeConfig.client.defaultProject.node;
}


layoutManager = new LayoutManager();
layoutManager.loadLayout(initialThingsToDo.layoutToLoad, function () {
Expand Down
16 changes: 12 additions & 4 deletions src/client/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,20 @@ <h2 class="form-signin-heading">WebGME sign in</h2>
</body>
<script>
function getParameterByName(name) {
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search),
result;
if (match) {
result = decodeURIComponent(match[1].replace(/\+/g, ' '));
}
return result;
}
var form = document.getElementById('loginForm'),
redirect = getParameterByName('redirect');
form.setAttribute('action', location.origin + '/login' + redirect ? ('?redirect=' + encodeURIComponent(redirect)) : '');
redirect = getParameterByName('redirect'),
redirectQuery = '';
if (redirect) {
redirectQuery = '?redirect=' + encodeURIComponent(redirect);
}
form.setAttribute('action', location.origin + '/login' + redirectQuery);
</script>
<script src="/lib/jquery/jquery-2.1.0.js"></script>
<script>
Expand Down

0 comments on commit 33e4534

Please sign in to comment.