Skip to content

Commit

Permalink
Fixes #10 Fixes #7 Fixes #5 Fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Apr 17, 2014
1 parent 58359b7 commit b3d5d47
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 33 deletions.
1 change: 0 additions & 1 deletion .htaccess

This file was deleted.

19 changes: 15 additions & 4 deletions install_files/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,17 @@ Installer.showPage = function(pageId, noPush) {
$('#containerFooter').renderPartial('footer', page)

/*
* @todo Cache the body load instead of resetting it on a secondary load
* Check if the content container exists already, if not, create it
*/
$('#containerBody').renderPartial(page.body, page)
page.init && page.init()
var pageContainer = $('#containerBody').find('.pageContainer-' + pageId);
if (!pageContainer.length) {
pageContainer = $('<div />').addClass('pageContainer-' + pageId);
pageContainer.renderPartial(page.body, page)
$('#containerBody').append(pageContainer);
page.init && page.init()
}

pageContainer.show().siblings().hide();

// New page, add it to the history
if (history.pushState && !noPush) {
Expand Down Expand Up @@ -278,8 +285,12 @@ $.extend({
})

window.onpopstate = function(event) {
// If progress page has rendered, disable navigation
if (Installer.Pages.installProgress.isRendered) {
// Do nothing
}
// Navigate back/foward through a known push state
if (event.state) {
else if (event.state) {
// Only allow navigation to previously rendered pages
var noPop = (!Installer.Pages[event.state.page].isRendered || Installer.ActivePage == event.state.page)
if (!noPop)
Expand Down
8 changes: 7 additions & 1 deletion install_files/js/complete.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ Installer.Pages.installComplete.beforeUnload = function() {

Installer.Pages.installComplete.beforeShow = function() {

var backendUri = Installer.Data.config.backend_uri,
baseUrl = installerBaseUrl

if (baseUrl.charAt(baseUrl.length - 1) == '/')
baseUrl = baseUrl.substr(0, baseUrl.length - 1)

Installer.Pages.installComplete.baseUrl = installerBaseUrl
Installer.Pages.installComplete.backendUrl = installerBaseUrl + 'backend';
Installer.Pages.installComplete.backendUrl = baseUrl + backendUri

}

Expand Down
5 changes: 4 additions & 1 deletion install_files/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Installer.Pages.configForm.init = function() {
configFormDatabase = $('#configFormDatabase')

configFormDatabase.renderPartial('config/mysql')

// Set the encryption code with a random string
$('#advEncryptionCode').val(Math.random().toString(36).slice(2))
}

Installer.Pages.configForm.next = function() {
Expand Down Expand Up @@ -41,7 +44,7 @@ Installer.Pages.configForm.next = function() {

// Scroll browser to the bottom of the error
var scrollTo = configFormFailed.offset().top - $(window).height() + configFormFailed.height() + 10
$('body,html').animate({ scrollTop: scrollTo })
$('body, html').animate({ scrollTop: scrollTo })
})
})
})
Expand Down
17 changes: 11 additions & 6 deletions install_files/partials/config/admin.htm
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<p class="lead">Please specify details for logging in to the Administration Area.</p>

<div class="form-group">
<label for="admin_first_name" class="control-label col-sm-4">First Name</label>
<label for="adminFirstName" class="control-label col-sm-4">First Name</label>
<div class="col-sm-8">
<input
id="adminFirstName"
name="admin_first_name"
class="form-control"
value="Admin"
Expand All @@ -12,9 +13,10 @@
</div>

<div class="form-group">
<label for="admin_last_name" class="control-label col-sm-4">Last Name</label>
<label for="adminLastName" class="control-label col-sm-4">Last Name</label>
<div class="col-sm-8">
<input
id="adminLastName"
name="admin_last_name"
class="form-control"
value="Person"
Expand All @@ -23,9 +25,10 @@
</div>

<div class="form-group">
<label for="admin_email" class="control-label col-sm-4">Email Address</label>
<label for="adminEmail" class="control-label col-sm-4">Email Address</label>
<div class="col-sm-8">
<input
id="adminEmail"
name="admin_email"
class="form-control"
value="admin@admin.admin"
Expand All @@ -34,9 +37,10 @@
</div>

<div class="form-group">
<label for="admin_login" class="control-label col-sm-4">Admin Login</label>
<label for="adminLogin" class="control-label col-sm-4">Admin Login</label>
<div class="col-sm-8">
<input
id="adminLogin"
name="admin_login"
class="form-control"
value="admin"
Expand All @@ -45,12 +49,13 @@
</div>

<div class="form-group">
<label for="admin_password" class="control-label col-sm-4">Admin Password</label>
<label for="adminPassword" class="control-label col-sm-4">Admin Password</label>
<div class="col-sm-8">
<input
id=="adminPassword"
name="admin_password"
class="form-control"
value="admin"
value=""
/>
</div>
</div>
12 changes: 8 additions & 4 deletions install_files/partials/config/advanced.htm
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
</p>

<div class="form-group">
<label for="backend_uri" class="control-label col-sm-4">Backend URL</label>
<label for="advBackendUri" class="control-label col-sm-4">Backend URL</label>
<div class="col-sm-8">
<input
id="advBackendUri"
name="backend_uri"
class="form-control"
value="/backend" />
Expand All @@ -17,9 +18,10 @@
Specify a unique code for protecting sensitive data, such as user passwords.
</p>
<div class="form-group">
<label for="encryption_code" class="control-label col-sm-4">Encryption Code</label>
<label for="advEncryptionCode" class="control-label col-sm-4">Encryption Code</label>
<div class="col-sm-8">
<input
id="advEncryptionCode"
name="encryption_code"
class="form-control"
value="RANDOM_STRING" />
Expand All @@ -32,19 +34,21 @@
</p>

<div class="form-group">
<label for="folder_mask" class="control-label col-sm-4">File Permission Mask</label>
<label for="advFolderMask" class="control-label col-sm-4">File Permission Mask</label>
<div class="col-sm-8">
<input
id="advFolderMask"
name="folder_mask"
class="form-control"
value="777" />
</div>
</div>

<div class="form-group">
<label for="file_mask" class="control-label col-sm-4">Folder Permission Mask</label>
<label for="advFileMask" class="control-label col-sm-4">Folder Permission Mask</label>
<div class="col-sm-8">
<input
id="advFileMask"
name="file_mask"
class="form-control"
value="777" />
Expand Down
2 changes: 1 addition & 1 deletion install_files/partials/config/database.htm
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<label for="dbType" class="control-label col-sm-4">Database Type</label>
<div class="col-sm-8">
<select
id="dbType"
name="db_type"
class="form-control"
id="dbType"
onchange="Installer.Pages.configForm.toggleDatabase(this)">
<option value="mysql">MySQL</option>
<option value="pgsql">Postgres</option>
Expand Down
8 changes: 4 additions & 4 deletions install_files/partials/config/mysql.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<label for="dbHost" class="control-label col-sm-4">MySQL Host</label>
<div class="col-sm-8">
<input
id="dbHost"
name="db_host"
class="form-control"
value="localhost"
id="dbHost"
/>
<span class="help-block">Specify the hostname for the database connection.</span>
</div>
Expand All @@ -15,10 +15,10 @@
<label for="dbName" class="control-label col-sm-4">Database Name</label>
<div class="col-sm-8">
<input
id="dbName"
name="db_name"
class="form-control"
value=""
id="dbName"
/>
<span class="help-block">Specify the name of the empty database.</span>
</div>
Expand All @@ -28,10 +28,10 @@
<label for="dbUser" class="control-label col-sm-4">MySQL Login</label>
<div class="col-sm-8">
<input
id="dbUser"
name="db_user"
class="form-control"
value=""
id="dbUser"
/>
<span class="help-block">User with all privileges in the database.</span>
</div>
Expand All @@ -41,10 +41,10 @@
<label for="dbPass" class="control-label col-sm-4">MySQL Password</label>
<div class="col-sm-8">
<input
id="dbPass"
name="db_pass"
class="form-control"
value=""
id="dbPass"
/>
<span class="help-block">Password for the specified user.</span>
</div>
Expand Down
8 changes: 4 additions & 4 deletions install_files/partials/config/pgsql.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<label for="dbHost" class="control-label col-sm-4">Postgres Host</label>
<div class="col-sm-8">
<input
id="dbHost"
name="db_host"
class="form-control"
value="localhost"
id="dbHost"
/>
<span class="help-block">Specify the hostname for the database connection.</span>
</div>
Expand All @@ -15,10 +15,10 @@
<label for="dbName" class="control-label col-sm-4">Database Name</label>
<div class="col-sm-8">
<input
id="dbName"
name="db_name"
class="form-control"
value=""
id="dbName"
/>
<span class="help-block">Specify the name of the empty database.</span>
</div>
Expand All @@ -28,10 +28,10 @@
<label for="dbUser" class="control-label col-sm-4">Postgres Login</label>
<div class="col-sm-8">
<input
id="dbUser"
name="db_user"
class="form-control"
value=""
id="dbUser"
/>
<span class="help-block">User with all privileges in the database.</span>
</div>
Expand All @@ -41,10 +41,10 @@
<label for="dbPass" class="control-label col-sm-4">Postgres Password</label>
<div class="col-sm-8">
<input
id="dbPass"
name="db_pass"
class="form-control"
value=""
id="dbPass"
/>
<span class="help-block">Password for the specified user.</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion install_files/partials/config/sqlite.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<label for="dbName" class="control-label col-sm-4">SQLite Database Path</label>
<div class="col-sm-8">
<input
id="dbName"
name="db_name"
class="form-control"
value="../database/production.sqlite"
id="dbName"
/>
<span class="help-block">Specify absolute path to the SQLite database file.</span>
</div>
Expand Down
9 changes: 5 additions & 4 deletions install_files/partials/config/sqlsrv.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<label for="dbHost" class="control-label col-sm-4">SQL Host</label>
<div class="col-sm-8">
<input
id="dbHost"
name="db_host"
class="form-control"
value="localhost"
id="dbHost"
/>
<span class="help-block">Specify the hostname for the database connection.</span>
</div>
Expand All @@ -15,10 +15,10 @@
<label for="dbName" class="control-label col-sm-4">Database Name</label>
<div class="col-sm-8">
<input
id="dbName"
name="db_name"
class="form-control"
value=""
id="dbName"
/>
<span class="help-block">Specify the name of the empty database.</span>
</div>
Expand All @@ -28,10 +28,10 @@
<label for="dbUser" class="control-label col-sm-4">SQL Login</label>
<div class="col-sm-8">
<input
id="dbUser"
name="db_user"
class="form-control"
value=""
id="dbUser"
/>
<span class="help-block">User with all privileges in the database.</span>
</div>
Expand All @@ -41,10 +41,11 @@
<label for="dbPass" class="control-label col-sm-4">SQL Password</label>
<div class="col-sm-8">
<input
id="dbPass"
name="db_pass"
class="form-control"
value=""
id="dbPass"/>
/>
<span class="help-block">Password for the specified user.</span>
</div>
</div>
Loading

1 comment on commit b3d5d47

@raftelco
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GJ

Please sign in to comment.