3.0.0.1 Demo repository registration
This commit is contained in:
@@ -25,7 +25,24 @@ div, button, input, select, textarea, table, tr, td
|
||||
box-shadow: 0 0 0 2px #80808040 inset;
|
||||
}
|
||||
|
||||
/* Fonts */
|
||||
/* Responsive */
|
||||
|
||||
.sbm-flex-column
|
||||
{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.sbm-flex-row
|
||||
{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.sbm-flex-1
|
||||
{
|
||||
flex:1;
|
||||
}
|
||||
|
||||
/* Common styles */
|
||||
|
||||
@@ -36,7 +53,7 @@ h1, h2, h3
|
||||
|
||||
h1
|
||||
{
|
||||
font-size: 14px;
|
||||
font-size: 1.4em;
|
||||
font-weight: bold;
|
||||
margin: 6px 0 6px 0;
|
||||
padding: 0;
|
||||
@@ -44,7 +61,7 @@ h1
|
||||
|
||||
h2
|
||||
{
|
||||
font-size: 12px;
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
margin: 3px 0 6px 0;
|
||||
padding: 0;
|
||||
@@ -52,7 +69,7 @@ h2
|
||||
|
||||
h3
|
||||
{
|
||||
font-size: 11px;
|
||||
font-size: 1.0em;
|
||||
font-weight: bold;
|
||||
margin: 3px 0 6px 0;
|
||||
padding: 0;
|
||||
@@ -230,7 +247,7 @@ td.action
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.width50pc
|
||||
.halfwidth, .width50pc
|
||||
{
|
||||
width: 50%;
|
||||
}
|
||||
@@ -240,7 +257,17 @@ td.action
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fullheight
|
||||
.height25pc
|
||||
{
|
||||
height: 25%;
|
||||
}
|
||||
|
||||
.halfheight, .height50pc
|
||||
{
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.fullheight, .height100pc
|
||||
{
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@@ -242,18 +242,17 @@
|
||||
|
||||
/* Password strength */
|
||||
|
||||
#prgPasswordStrength
|
||||
.sbm-password-strength
|
||||
{
|
||||
width: 200px;
|
||||
height: 18px;
|
||||
margin: 6px 24px;
|
||||
margin: 6px 12px;
|
||||
border-color: #595959;
|
||||
-moz-box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#prgPasswordStrength .ui-widget-header
|
||||
.sbm-password-strength .ui-widget-header
|
||||
{
|
||||
margin: 0;
|
||||
height: 20px;
|
||||
@@ -263,21 +262,21 @@
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
#prgPasswordStrength.amber .ui-widget-header
|
||||
.sbm-password-strength.amber .ui-widget-header
|
||||
{
|
||||
background-color: #FFBF00;
|
||||
border-color: #FFBF00;
|
||||
}
|
||||
|
||||
#prgPasswordStrength.green .ui-widget-header
|
||||
.sbm-password-strength.green .ui-widget-header
|
||||
{
|
||||
background-color: #238823;
|
||||
border-color: #238823;
|
||||
}
|
||||
|
||||
#prgPasswordStrength.ui-corner-all
|
||||
.sbm-password-strength.ui-corner-all
|
||||
{
|
||||
border-radius: 8px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
/* The End */
|
||||
|
||||
@@ -52,7 +52,12 @@ body
|
||||
}
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
/* Page layout */
|
||||
|
||||
#sbm-page-body
|
||||
{
|
||||
background-color: #f8ffff;
|
||||
}
|
||||
|
||||
#sbm-page-body > .container, header > .container, footer > .container
|
||||
{
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
}
|
||||
as.onUpdateItem = function (env, response)
|
||||
{
|
||||
sbm.debug('onUpdateItem', response);
|
||||
//sbm.debug('onUpdateItem', response);
|
||||
if (!response.success) return;
|
||||
let cfg = response.config || {};
|
||||
as.clearItem(env, cfg);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
}
|
||||
ac.handleCodes = function (response)
|
||||
{
|
||||
sbm.debug('handleCodes', response);
|
||||
//sbm.debug('handleCodes', response);
|
||||
delete ac.awaitingRefreshResponse;
|
||||
let $table = $('table', $pnl.table).find('tbody tr').remove().end();
|
||||
$pnl.msgs.hide().empty();
|
||||
@@ -135,7 +135,7 @@
|
||||
}
|
||||
ac.onUpdateItem = function (response)
|
||||
{
|
||||
sbm.debug('onUpdateItem', response);
|
||||
//sbm.debug('onUpdateItem', response);
|
||||
let frm = $frm.item;
|
||||
ac.clearItem();
|
||||
if (!response.success) return;
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
}
|
||||
co.onUpdateItem = function (env, response)
|
||||
{
|
||||
sbm.debug('onUpdateItem', env, response);
|
||||
//sbm.debug('onUpdateItem', env, response);
|
||||
if (!response.success) return;
|
||||
let cfg = response.config || {};
|
||||
co.clearItem(env, cfg);
|
||||
@@ -187,7 +187,7 @@
|
||||
}
|
||||
co.onStoreItem = function (env, response)
|
||||
{
|
||||
sbm.debug('onStoreItem', env, response);
|
||||
//sbm.debug('onStoreItem', env, response);
|
||||
sbm.refreshControlValues(response.controlValues);
|
||||
if (!response.success) return;
|
||||
env.$dlg.item.dialog('close');
|
||||
@@ -243,7 +243,7 @@
|
||||
//sbm.debug('editCommodity', prm);
|
||||
let env = co.env.select;
|
||||
env.prmEdit = prm;
|
||||
sbm.debug(env, prm);
|
||||
//sbm.debug(env, prm);
|
||||
co.updateItem(env, prm.id);
|
||||
}
|
||||
co.onItemEdited = function (env, item)
|
||||
|
||||
@@ -231,7 +231,7 @@
|
||||
{
|
||||
//sbm.debug('onClickAssociationCount', env, item);
|
||||
if (!item.id) return;
|
||||
sbm.fn.listAssociations({ ownerId: item.id });
|
||||
sbm.fn.listAssociations({ targetId: item.id });
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
@@ -268,7 +268,7 @@
|
||||
//sbm.debug('editContact', prm);
|
||||
let env = co.env.select;
|
||||
env.prmEdit = prm;
|
||||
sbm.debug(env, prm);
|
||||
//sbm.debug(env, prm);
|
||||
co.updateItem(env, prm.id);
|
||||
}
|
||||
co.onItemEdited = function (env, item)
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Security page scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let de = sbm.demo = { ajax: {}, $pnl: {}, $frm: {} };
|
||||
|
||||
//--------------------------------------------------------------
|
||||
de.requestDemoUser = function ()
|
||||
{
|
||||
sbm.clearControlErrors();
|
||||
de.ajax.request = de.ajax.request || { url: sbm.url.base + 'Demo/Ajax/Request', formSel: de.$frm.request, callbackFn: de.onRequestDemoUser };
|
||||
sbm.doAjaxRequest(de.ajax.request, 50);
|
||||
}
|
||||
de.onRequestDemoUser = function (response)
|
||||
{
|
||||
//sbm.debug('onRequestDemoUser', response);
|
||||
sbm.refreshControlValues(response.controlValues, de.$frm.request);
|
||||
if (!response.success) return;
|
||||
let msg = response.confirmMessage;
|
||||
if (msg)
|
||||
sbm.doAlert(msg.title, msg.text, function () { sbm.goToPage(''); });
|
||||
else sbm.goToPage('');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
de.registerDemoUser = function ()
|
||||
{
|
||||
sbm.clearControlErrors();
|
||||
de.ajax.register = de.ajax.register || { url: sbm.url.base + 'Demo/Ajax/Register', formSel: de.$frm.register, callbackFn: de.onRegisterDemoUser };
|
||||
sbm.doAjaxRequest(de.ajax.register, 50);
|
||||
}
|
||||
de.onRegisterDemoUser = function (response)
|
||||
{
|
||||
//sbm.debug('onRegisterDemoUser', response);
|
||||
sbm.refreshControlValues(response.controlValues, de.$frm.register);
|
||||
if (!response.success) return;
|
||||
let msg = response.confirmMessage;
|
||||
if (msg)
|
||||
sbm.doAlert(msg.title, msg.text, function () { sbm.goToPage(''); });
|
||||
else sbm.goToPage('');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
de.doScorePassword = function ()
|
||||
{
|
||||
sbm.ajaxScorePassword = sbm.ajaxScorePassword || { url: sbm.url.base + 'Security/Ajax/ScorePassword', formSel: de.$frm.register, callbackFn: de.onScorePassword, noWaitIcon: true };
|
||||
sbm.doAjaxRequest(sbm.ajaxScorePassword, 250);
|
||||
}
|
||||
de.onScorePassword = function (response)
|
||||
{
|
||||
var score = (response || {}).score || 0;
|
||||
sbm.$prgPasswordStrength.progressbar("option", "value", score).removeClass('amber green').addClass(score > 3 ? 'green' : score > 2 ? 'amber' : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
de.$pnl.request = $('.DemoRequest');
|
||||
de.$frm.request = de.$pnl.request.find('#frmDemoRequest');
|
||||
de.$frm.request.on('click', '#pbRequest', function () { de.requestDemoUser(); });
|
||||
|
||||
de.$pnl.register = $('.DemoRegister');
|
||||
de.$frm.register = de.$pnl.register.find('#frmDemoRegister');
|
||||
de.$frm.register.on('keyup', '.AccountPassword', de.doScorePassword);
|
||||
sbm.$prgPasswordStrength = de.$frm.register.find('.AccountPasswordStrength').progressbar({ 'max': 5 });
|
||||
de.$frm.register.on('click', '#pbRegister', function () { de.registerDemoUser(); });
|
||||
|
||||
$('.sbm-input').on('input', function () { sbm.clearControlError(this); });
|
||||
$(':input:enabled:visible:first').trigger('focus');
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -255,7 +255,7 @@
|
||||
var opt = sbm.dlgOpts();
|
||||
sbm.$dlg.alert = $('<div id="dlgAlert"><div id="dlgAlertMsg"></div></div>').dialog(opt);
|
||||
}
|
||||
$('#dlgAlertMsg', sbm.$dlg.alert).html(msg.replace(/\\n/g, '<br>'));
|
||||
$('#dlgAlertMsg', sbm.$dlg.alert).html(msg.replace(/\n/g, '<br>'));
|
||||
let btns = {};
|
||||
btns[sbm.lbl.ok] = function () { $(this).dialog('close'); if (onOk) onOk(); };
|
||||
sbm.$dlg.alert.dialog('option', { title: title || sbm.dlg.title.alert, buttons: btns });
|
||||
@@ -278,7 +278,7 @@
|
||||
btns[sbm.lbl.yes] = function () { $(this).dialog('close'); if (onOk) onOk(); };
|
||||
btns[sbm.lbl.no] = function () { $(this).dialog('close'); if (onCancel) onCancel(); };
|
||||
sbm.$dlg.confirm.dialog('option', { title: title || sbm.dlg.title.confirm, buttons: btns });
|
||||
$('#dlgConfirmMsg').html(msg.replace(/\\n/g, '<br>'));
|
||||
$('#dlgConfirmMsg').html(msg.replace(/\n/g, '<br>'));
|
||||
sbm.openDialog(sbm.$dlg.confirm);
|
||||
}
|
||||
sbm.confirmItemRemove = function (fn)
|
||||
@@ -300,7 +300,7 @@
|
||||
opt.hide = { effect: 'fade', duration: 200 };
|
||||
sbm.$dlg.progress = $('<div id="dlgProgress"><div id="dlgProgressMsg"></div></div>').dialog(opt);
|
||||
}
|
||||
$('#dlgProgressMsg').html(msg.replace(/\\n/g, '<br>'));
|
||||
$('#dlgProgressMsg').html(msg.replace(/\n/g, '<br>'));
|
||||
sbm.$dlg.progress.dialog('option', { title: title || sbm.dlg.title.progress });
|
||||
if (delay > 0) sbm.toShowProgress = setTimeout(function () { sbm.$dlg.progress.dialog('open'); }, delay);
|
||||
else sbm.$dlg.progress.dialog('open');
|
||||
|
||||
@@ -74,10 +74,10 @@
|
||||
$(':input:enabled:visible:first').trigger('focus');
|
||||
$('#ifEmailAddress,#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm').on('input', function () { sbm.clearControlError(this); });
|
||||
$('#frmChangePassword #ifPassword').on('keyup', sbm.doScorePassword);
|
||||
sbm.$prgPasswordStrength = $('#frmChangePassword #prgPasswordStrength').progressbar({ 'max': 5 });
|
||||
sbm.$prgPasswordStrength = $('#frmChangePassword .sbm-password-strength').progressbar({ 'max': 5 });
|
||||
sbm.$frm.signIn = $('#frmSignIn');
|
||||
sbm.$frm.signIn.on('keypress', '#ifEmailAddress,#ifPassword,#chkKeepMeSignedIn', function (e) { if (e.which == 13 && $('#ifEmailAddress', sbm.$frm.signIn).val() && $('#ifPassword', sbm.$frm.signIn).val()) sbm.doSignin(); });
|
||||
sbm.$frm.signIn.on('click', '#pbSignIn', function () { sbm.doSignin(); }).on('keypress', '#pbSignIn', function (e) { if (e.which == 13) sbm.doSignin(); });;
|
||||
sbm.$frm.signIn.on('click', '#pbSignIn', function () { sbm.doSignin(); }).on('keypress', '#pbSignIn', function (e) { if (e.which == 13) sbm.doSignin(); });
|
||||
$('#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm', $('#frmChangePassword')).on('keypress', function (e) { if (e.which == 13) sbm.doChangePassword(); });
|
||||
$('#frmChangePassword #pbChangePassword').on('click', function () { sbm.doChangePassword(); });
|
||||
$('#ifEmailAddress', $('#frmRequestPassword')).on('keypress', function (e) { if (e.which == 13) sbm.doRequestPassword(); });
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
}
|
||||
vc.handleVehicleClasses = function (response)
|
||||
{
|
||||
sbm.debug('handleVehicleClasses', response);
|
||||
//sbm.debug('handleVehicleClasses', response);
|
||||
delete vc.awaitingRefreshResponse;
|
||||
let $table = $('table', $pnl.table).find('tbody tr').remove().end();
|
||||
$pnl.msgs.hide().empty();
|
||||
|
||||
Reference in New Issue
Block a user