This commit is contained in:
2022-12-11 15:08:41 +00:00
parent 5f2a181baa
commit ea5e27a5b3
137 changed files with 1178 additions and 751 deletions
@@ -1,7 +1,6 @@
/*
* Account page scripts.
*/
(function (win, doc, undef)
{
//--------------------------------------------------------------
@@ -61,7 +60,5 @@
setTimeout(sax.refreshProfile, 200);
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
+1 -15
View File
@@ -1,7 +1,6 @@
/*
* Article page scripts.
*/
(function (win, doc, undef)
{
"use strict";
@@ -10,7 +9,6 @@
let am = sax.articleMgt = { ajax: {}, data: {}, $pnl: {}, $frm: {}, $dlg: {} };
let $pnl = am.$pnl, $frm = am.$frm, $dlg = am.$dlg;
let ac = sax.articleContent = sax.articleContent || {};
//--------------------------------------------------------------
am.refreshResults = function (delay)
{
@@ -77,7 +75,6 @@
$bgr.toggle(!!$('.sax-dropdown-menu .sax-dropdown-item', $item).length);
return $item;
}
//--------------------------------------------------------------
am.getFilterDropdownTemplate = function ()
{
@@ -107,7 +104,6 @@
{
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
}
//--------------------------------------------------------------
am.selectFilterOrganisation = function ()
{
@@ -126,7 +122,6 @@
$('#frmArticleFilter #ifFilterOrganisation').val(name);
am.refreshResults(50);
}
//--------------------------------------------------------------
am.createItem = function ()
{
@@ -169,7 +164,6 @@
sax.openDialog($dlg.article, 800, 1200);
$('.ArticleHeadline.sax-input,.ArticleSummary.sax-textarea', $frm.article).trigger("input");
}
//--------------------------------------------------------------
am.updateItem = function (item, $item)
{
@@ -205,7 +199,6 @@
am.populateArticleContent(item.content);
am.openArticleDialog(sax.dlg.title.updateArticle);
}
//--------------------------------------------------------------
am.switchArticleHeader = function ()
{
@@ -215,7 +208,6 @@
{
$('.sax-article').removeClass('ArticleHeader').addClass('ArticleContent');
}
//--------------------------------------------------------------
am.selectArticleSport = function ()
{
@@ -226,7 +218,6 @@
sax.clearControlError($('#ifArticleSportId').val(sport.id));
$('#ifArticleSportCaption').val(sport ? sport.name : '');
}
//--------------------------------------------------------------
am.selectArticleRegion = function ()
{
@@ -237,7 +228,6 @@
sax.clearControlError($('#ifArticleRegionId').val(region.id));
$('#ifArticleRegionCaption').val(region ? region.name : '');
}
//--------------------------------------------------------------
am.segmentId = function (idx)
{
@@ -460,7 +450,6 @@
$dlg.selectArticleImage.dialog('close');
}
}
//--------------------------------------------------------------
am.storeItem = function ()
{
@@ -487,14 +476,12 @@
}
am.populateItem($item, item)
}
//--------------------------------------------------------------
am.refreshControlInfo = function (ctrl)
{
let $ctrl = $(ctrl);
sax.setAvailableCharsInfo($ctrl, $ctrl.prop('maxlength'));
}
//--------------------------------------------------------------
$(function ()
{
@@ -532,7 +519,6 @@
setTimeout(am.refreshResults, 250);
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,13 +1,11 @@
/*
* Contact Methods script.
*/
(function (win, doc, undef)
{
"use strict";
let cm = sax.mdl.contactMethods = { fn: {}, data: {}, ajax: {} };
let $dlg = cm.$dlg = {};
//--------------------------------------------------------------
/*
* Config:
@@ -19,7 +17,6 @@
*/
sax.editContactMethod = cm.fn.edit = function (cfg)
{
cm.fn.init();
cm.data.cfg = cfg || {};
cm.$mth.empty();
for (let mth of cfg.methods || [])
@@ -29,9 +26,9 @@
}
cm.$mth.val(cfg.method).attr('disabled', cfg.method && cm.$mth.val() == cfg.method ? true : null);
cm.$val.val(cfg.value);
sax.clearControlErrors($dlg.conMth);
sax.openDialog($dlg.conMth, 600, 240);
}
//--------------------------------------------------------------
cm.fn.applyChanges = function ()
{
@@ -50,20 +47,16 @@
$dlg.conMth.dialog('close');
if (cm.data.cfg.fnCallback) cm.data.cfg.fnCallback(cm.$mth.val(), $('option:selected', cm.$mth).text(), cm.$val.val());
}
//--------------------------------------------------------------
cm.fn.init = function ()
$(function ()
{
if ($dlg.conMth) return;
var opt = sax.dlgOpts();
opt.buttons[sax.dlg.btn.ok] = function () { cm.fn.applyChanges(); };
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
$dlg.conMth = $('#dlgContactMethod').dialog(opt);
cm.$mth = $('.sax-select.ContactMethod', $dlg.conMth);
cm.$val = $('.sax-input.ContactValue', $dlg.conMth);
}
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,12 +1,10 @@
/*
* Code selection.
*/
(function (win, doc, undef)
{
"use strict";
let cs = sax.codeSelect = sax.codeSelect || { fn: {}, $dlg: {} };
//--------------------------------------------------------------
/*
* Code selection config:
@@ -23,7 +21,6 @@
cs.fn.openCodeSelect = function (cfg)
{
//sax.debug('openSelectCode', cfg);
cs.fn.init();
cs.cfg = cfg;
cs.selectedCodes = cfg.selectedCodes || [];
cs.fn.displayCodes(cfg.codes);
@@ -44,6 +41,7 @@
else $codesAvail.append($code);
}
}
//--------------------------------------------------------------
cs.fn.onClickCode = function (code, $code)
{
$('.sax-panel-item.Code').removeClass('sel');
@@ -93,6 +91,7 @@
for (const code of codes)
$('.sax-panel-item.Code[aria-code="' + code + '"]').addClass('sel');
}
//--------------------------------------------------------------
cs.fn.storeSelectCode = function ()
{
//sax.debug('storeSelectCode', cs.cfg, cs.selectedCodes);
@@ -105,19 +104,16 @@
delete cs.cfg;
delete cs.selectedCodes;
}
//--------------------------------------------------------------
cs.fn.init = function ()
$(function ()
{
if (!cs.$dlg) return;
var opt = sax.dlgOpts();
opt.buttons[sax.dlg.btn.ok] = function () { cs.fn.storeSelectCode(); };
opt.buttons[sax.dlg.btn.cancel] = function () { cs.fn.cleanUp(); $(this).dialog('close'); };
cs.$dlg = $('#dlgCodeSelect').dialog(opt);
$('.sax-button.Select', cs.$dlg).on('click', function () { cs.fn.onClickSelect(); });
$('.sax-button.Remove', cs.$dlg).on('click', function () { cs.fn.onClickRemove(); });
}
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,11 +1,9 @@
/*
* Home scripts.
*/
(function (win, doc, undef)
{
"use strict";
//--------------------------------------------------------------
sax.refreshResults = function (delay)
{
@@ -57,7 +55,6 @@
$('.ActivityPublishedOn', $item).text(item.publishedOnFmt);
$item.on('click', '.sax-header .ActivityCaption', function () { sax.expandActivity(activity); }).on('dblclick', '.sax-content', function () { sax.expandActivity(activity); });
$('.sax-panel-messages', sax.$pnl.results).hide().empty();
}
sax.refreshItem = function (activity)
{
@@ -71,13 +68,11 @@
for (let i = 1; i <= Math.min(5, activity.item.reaction); i++)
$react.append($('<img>').prop('src', '../img/icon/star-gold-16.png'));
}
//--------------------------------------------------------------
sax.getActivityTemplate = function ()
{
return $('.sax-panel-item-template .sax-panel-item.Activity', sax.$pnl.results).clone();
}
//--------------------------------------------------------------
sax.expandActivity = function (activity)
{
@@ -148,7 +143,6 @@
sax.setActivityReactionButton(sax.activity.item.reaction);
sax.openDialog(sax.$dlg.activity, 800, dlgH);
}
//--------------------------------------------------------------
let selectedClass = 'sax-selected';
sax.setActivityReactionButton = function (r)
@@ -172,7 +166,6 @@
sax.ajax.activityReact = sax.ajax.activityReact || { url: sax.url.base + 'Activity/Ajax/React', formId: 'frmActivityReact', callbackFn: fn, noWaitIcon: true };
sax.doAjaxRequest(sax.ajax.activityReact, 20);
}
//--------------------------------------------------------------
$(function ()
{
@@ -188,8 +181,6 @@
setTimeout(sax.refreshResults, 250);
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
+2 -17
View File
@@ -1,12 +1,10 @@
/*
* Main scripts.
*/
(function (win, doc, undef)
{
"use strict";
win.sax = win.sax || {};
//--------------------------------------------------------------
// Utilities.
sax.isDef = function (obj)
@@ -73,7 +71,6 @@
evt.stopPropagation();
}
sax.debug = sax.debugMode ? win.console.log.bind(win.console) : function () { };
//--------------------------------------------------------------
sax.compareCI = function (a, b)
{
@@ -88,7 +85,6 @@
this.sort(function (a, b) { return sax.compareCI(a, b); });
return this;
};
//--------------------------------------------------------------
sax.setOddDataRowClass = function (rowSel, cName)
{
@@ -142,7 +138,6 @@
if (sax.mdl.resultsPaging.fn.refreshPaging)
sax.mdl.resultsPaging.fn.refreshPaging(response.paging, context, refreshFn);
}
//--------------------------------------------------------------
// Page navigation.
sax.navigateTo = function (action)
@@ -155,7 +150,6 @@
sax.doPleaseWait();
location = sax.url.base + action;
}
// Account action.
sax.onAccountAction = function (select)
{
@@ -166,7 +160,6 @@
else if (action == "Organisations")
sax.navigateTo("Organisations");
}
// Security.
sax.redirectHome = function ()
{
@@ -185,7 +178,6 @@
{
sax.doAjaxRequest({ url: sax.url.base + 'Security/Ajax/SignOut', formId: 'frmNavigate' }, 50);
}
//--------------------------------------------------------------
// Dialogs.
sax.openDialog = function ($dlg, width, height)
@@ -273,7 +265,6 @@
clearTimeout(sax.toShowProgress);
sax.$dlg.progress.dialog('close');
}
//--------------------------------------------------------------
// Notifications.
sax.showNotification = function (title, msg)
@@ -310,7 +301,6 @@
{
if (sax.$pleaseWait) sax.$pleaseWait.stop(true, false).fadeOut(200);
}
//--------------------------------------------------------------
// Ajax.
sax.doAjaxRequest = function (ajax, delay)
@@ -376,7 +366,6 @@
}
ajax.request = $.ajax(cfgAjax);
}
//--------------------------------------------------------------
// Session.
sax.configureKeepLoggedIn = function (single)
@@ -434,7 +423,6 @@
});
}
}
//--------------------------------------------------------------
// Elements.
sax.objBtm = function (sel)
@@ -477,7 +465,6 @@
var $obj = $(sel);
return parseInt($obj.css('border-top-width'), 10) + parseInt($obj.css('border-bottom-width'), 10);
}
//--------------------------------------------------------------
// Viewport - Desktop or Mobile.
sax.isMob = function () { return $('body.mob').length > 0; };
@@ -503,7 +490,6 @@
$ftr.css('visibility', 'visible');
sax.onWinResizePage();
}
//--------------------------------------------------------------
$(function ()
{
@@ -526,9 +512,8 @@
//defaultDate: 0,
});
});
//--------------------------------------------------------------
}(window, window.document));
//--------------------------------------------------------------
(function ()
{
@@ -538,5 +523,5 @@
}
if (!Array.prototype.sortBy) Array.prototype.sortCI = sax.arraySortCI;
})();
//--------------------------------------------------------------
/* The End */
@@ -1,13 +1,11 @@
/*
* Organisation - Events page scripts.
*/
(function (win, doc, undef)
{
"use strict";
let oe = sax.OrgEvt = { data: {}, fn: {} };
let $pnl = oe.$pnl = {}, $frm = oe.$frm = {}, $dlg = oe.$dlg = {};
//--------------------------------------------------------------
oe.refreshResults = function (delay)
{
@@ -83,7 +81,6 @@
$bgr.toggle(!!$('.sax-dropdown-menu .sax-dropdown-item', $item).length);
return $item;
}
//--------------------------------------------------------------
oe.getFilterDropdownTemplate = function ()
{
@@ -109,7 +106,6 @@
{
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
}
//--------------------------------------------------------------
oe.selectFilterOrganisation = function ()
{
@@ -141,7 +137,6 @@
$('#frmEventFilter #ifFilterOrganisation').val(name);
oe.refreshResults(50);
}
//--------------------------------------------------------------
oe.selectSportPrimary = function ()
{
@@ -152,7 +147,6 @@
sax.clearControlError($('.EventSportIdPrimary', $frm.evt).val(sport.id));
$('.EventSportCaptionPrimary', $frm.evt).val(sport ? sport.name : '');
}
//--------------------------------------------------------------
oe.selectRegionCountry = function ()
{
@@ -163,7 +157,6 @@
sax.clearControlError($('.EventRegionIdCountry', $frm.evt).val(region.id));
$('.EventRegionCaptionCountry', $frm.evt).val(region ? region.name : '');
}
//--------------------------------------------------------------
oe.createItem = function ()
{
@@ -185,7 +178,6 @@
$('.EventDate', $frm.evt).datepicker('setDate', 'today');
sax.clearControlErrors();
}
//--------------------------------------------------------------
oe.updateItem = function (item, $item)
{
@@ -216,7 +208,6 @@
$dlg.event.dialog('option', 'title', sax.dlg.title.updateEvent);
sax.openDialog($dlg.event, 600, 600);
}
//--------------------------------------------------------------
oe.storeItem = function ()
{
@@ -238,7 +229,6 @@
}
oe.populateItem(oe.$item, item)
}
//--------------------------------------------------------------
$(function ()
{
@@ -265,7 +255,6 @@
setTimeout(oe.refreshResults, 250);
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,13 +1,11 @@
/*
* Organisation - Members page scripts.
*/
(function (win, doc, undef)
{
"use strict";
let om = sax.OrgMbr = { data: {}, fn: {} };
let $pnl = om.$pnl = {}, $frm = om.$frm = {}, $dlg = om.$dlg = {};
//--------------------------------------------------------------
om.refreshResults = function (delay)
{
@@ -74,7 +72,6 @@
$bgr.toggle(!!$('.sax-dropdown-menu .sax-dropdown-item', $item).length);
return $item;
}
//--------------------------------------------------------------
om.getFilterDropdownTemplate = function ()
{
@@ -100,7 +97,6 @@
{
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
}
//--------------------------------------------------------------
om.selectFilterOrganisation = function ()
{
@@ -132,7 +128,6 @@
$('#frmMemberFilter #ifFilterOrganisation').val(name);
om.refreshResults(50);
}
//--------------------------------------------------------------
om.createItem = function ()
{
@@ -151,7 +146,6 @@
$('.MemberDisplayName,.MemberTitle,.MemberFirstName,.MemberLastName', $frm.mbr).hide();
sax.clearControlErrors();
}
//--------------------------------------------------------------
om.updateItem = function (item, $item)
{
@@ -182,7 +176,6 @@
$dlg.member.dialog('option', 'title', sax.dlg.title.updateMember);
sax.openDialog($dlg.member, 600, 560);
}
//--------------------------------------------------------------
// Member Roles.
om.selectMemberRoles = function ()
@@ -212,7 +205,6 @@
sax.data.memberRoles.some(function (value) { if (value.code == roleCode) { roleDesc = value.desc; return true; } return false; })
return roleDesc || roleCode;
}
//--------------------------------------------------------------
om.storeItem = function ()
{
@@ -241,7 +233,6 @@
om.populateItem(om.$item, item)
delete om.$item;
}
//--------------------------------------------------------------
om.removeItem = function (item, $item)
{
@@ -265,7 +256,6 @@
delete om.$item;
}
}
//--------------------------------------------------------------
om.activateItem = function (item, $item)
{
@@ -289,7 +279,6 @@
delete om.$item;
}
}
//--------------------------------------------------------------
$(function ()
{
@@ -315,7 +304,6 @@
setTimeout(om.refreshResults, 250);
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,13 +1,11 @@
/*
* Organisation - Opportunities page scripts.
*/
(function (win, doc, undef)
{
"use strict";
let oo = sax.OrgOpp = { data: {}, fn: {} };
let $pnl = oo.$pnl = {}, $frm = oo.$frm = {}, $dlg = oo.$dlg = {};
//--------------------------------------------------------------
oo.refreshResults = function (delay)
{
@@ -81,7 +79,6 @@
$bgr.toggle(!!$('.sax-dropdown-menu .sax-dropdown-item', $item).length);
return $item;
}
//--------------------------------------------------------------
oo.getFilterDropdownTemplate = function ()
{
@@ -107,7 +104,6 @@
{
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
}
//--------------------------------------------------------------
oo.selectFilterOrganisation = function ()
{
@@ -139,7 +135,6 @@
$('#frmOpportunityFilter #ifFilterOrganisation').val(name);
oo.refreshResults(50);
}
//--------------------------------------------------------------
oo.selectSport = function ()
{
@@ -150,7 +145,6 @@
sax.clearControlError($('#ifOpportunitySportId').val(sport.id));
$('#ifOpportunitySportCaption').val(sport ? sport.name : '');
}
//--------------------------------------------------------------
oo.selectRegion = function ()
{
@@ -161,7 +155,6 @@
sax.clearControlError($('#ifOpportunityRegionId').val(region.id));
$('#ifOpportunityRegionCaption').val(region ? region.name : '');
}
//--------------------------------------------------------------
oo.createItem = function ()
{
@@ -182,7 +175,6 @@
$('#cbOpportunityType', $frm.opp).find('option[value=""]').remove();
sax.clearControlErrors();
}
//--------------------------------------------------------------
oo.updateItem = function (item, $item)
{
@@ -212,7 +204,6 @@
$dlg.opportunity.dialog('option', 'title', sax.dlg.title.updateOpportunity);
sax.openDialog($dlg.opportunity, 600, 600);
}
//--------------------------------------------------------------
oo.storeItem = function ()
{
@@ -234,7 +225,6 @@
}
oo.populateItem(oo.$item, item)
}
//--------------------------------------------------------------
$(function ()
{
@@ -260,7 +250,6 @@
setTimeout(oo.refreshResults, 250);
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,17 +1,14 @@
/*
* Organisation Request.
*/
(function (win, doc, undef)
{
"use strict";
let or = sax.orgReq;
or.fn = {}; or.ajax = {};
//--------------------------------------------------------------
or.fn.requestOrganisation = function ()
{
or.fn.init();
$('input[type="text"],textarea,select,.OrganisationSportId,.OrganisationRegionIdCountry', or.$frm).val('');
$('.OrganisationRegionIdPrimary', or.$frm).val(sax.data.regionIdCountryDefault);
$('.OrganisationRegionNamePrimary', or.$frm).val(sax.data.regionNameCountryDefault);
@@ -36,7 +33,6 @@
or.fn.cleanUp = function ()
{
}
//--------------------------------------------------------------
or.selectOrgSport = function ()
{
@@ -47,7 +43,6 @@
sax.clearControlError($('.OrganisationSportId', or.$frm).val(sport.id));
$('.OrganisationSportName', or.$frm).val(sport ? sport.name : '');
}
//--------------------------------------------------------------
or.selectOrgRegionPrimary = function ()
{
@@ -59,11 +54,9 @@
sax.clearControlError($('.OrganisationRegionIdPrimary', or.$frm).val(region.id));
$('.OrganisationRegionNamePrimary', or.$frm).val(region ? region.name : '');
}
//--------------------------------------------------------------
or.fn.init = function ()
$(function ()
{
if (or.$dlg) return;
var opt = sax.dlgOpts();
opt.title = sax.orgReq.dlgTitleRequestOrganisation;
opt.buttons[sax.dlg.btn.ok] = function () { or.fn.storeOrganisation(); };
@@ -74,8 +67,7 @@
or.$frm.on('dblclick', 'input.OrganisationRegionNamePrimary', or.selectOrgRegionPrimary).on('click', 'button.SelectOrganisationRegionPrimary', or.selectOrgRegionPrimary);
$('.sax-input, .sax-textarea', or.$frm).on('input', function () { sax.clearControlError(this); });
$('.sax-select', or.$frm).on('change', function () { sax.clearControlError(this); });
}
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,13 +1,11 @@
/*
* Organisation selection.
*/
(function (win, doc, undef)
{
"use strict";
let so = sax.selectOrganisation;
let so = sax.selectOrganisation = sax.selectOrganisation || {};
so.data = {}; so.fn = {};
//--------------------------------------------------------------
/*
* Organisation selection config:
@@ -20,7 +18,6 @@
so.fn.selectOrganisation = function (cfg)
{
//sax.debug('openDialog', cfg);
so.fn.init();
so.cfg = cfg;
sax.openDialog(so.$dlg.dialog('option', { title: cfg.caption || so.dlgTitleSelectOrganisation || 'Select Organisation' }), so.cfg.width || 480, so.cfg.height || 600);
}
@@ -99,11 +96,9 @@
delete so.cfg;
delete so.data.item;
}
//--------------------------------------------------------------
so.fn.init = function ()
$(function ()
{
if (so.$dlg) return;
var opt = sax.dlgOpts();
opt.open = function () { so.fn.refreshResults(200); };
opt.buttons[sax.dlg.btn.ok] = function () { so.fn.confirmSelection(); };
@@ -113,8 +108,7 @@
so.$results = $('.sax-selection-results.Organisations', so.$dlg);
so.$filter = $('.sax-panel-filter', so.$dlg);
$('.sax-input.FilterOrganisation', so.$filter).on('input', function () { sax.selectOrganisation.fn.refreshResults(250); });
}
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -16,5 +16,4 @@
}
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,7 +1,6 @@
/*
* Profile Eligibility scripts.
*/
(function (win, doc, undef)
{
//--------------------------------------------------------------
@@ -11,7 +10,6 @@
//--------------------------------------------------------------
sax.refreshProfileEligibilityInfo = function (delay)
{
ue.init();
$pnl.infoTip.hide().find('.sax-info').text(sax.msg.eligibilityInfo);
$pnl.usrElg.removeClass('sax-edit').addClass('sax-populating');
$('.sax-property', $pnl.usrElg).hide();
@@ -224,9 +222,8 @@
ue.clearItem();
}
//--------------------------------------------------------------
ue.init = function ()
$(function ()
{
if ($pnl.usrElg) return;
$pnl.usrElg = $('.sax-panel-section.ProfileEligibility');
$pnl.usrElg.on('click', '.sax-action.sax-add', function (evt) { ue.addItem(); });
$pnl.usrElg.on('click', '.sax-action.sax-info', function (evt) { ue.showInfoTip(); });
@@ -248,7 +245,7 @@
sax.initCalendars('#frmUserEligibility .sax-calendar', { changeMonth: true, changeYear: true, yearRange: '-99:+12', autoClose: true });
ue.$dpExpiresOn.datepicker({ onSelect: function () { ue.onChangeExpiresOn(); }, onClose: function () { ue.onChangeExpiresOn(); } });
sax.allowClearCalendar('#frmUserEligibility .sax-calendar');
}
});
//--------------------------------------------------------------
}(window, window.document));
@@ -1,13 +1,11 @@
/*
* Account page scripts.
*/
(function (win, doc, undef)
{
"use strict";
let po = sax.mdl.profileOrganisations = sax.mdl.profileOrganisations || { data: {}, ajax: {} };
let $pnl = po.$pnl = {}, $dlg = po.$dlg = {}, $frm = po.$frm = {};
//--------------------------------------------------------------
sax.refreshProfileOrganisationsInfo = function (delay)
{
@@ -62,7 +60,6 @@
return $item;
}
//--------------------------------------------------------------
po.getHeaderDropdownTemplate = function ()
{
@@ -88,7 +85,6 @@
{
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
}
//--------------------------------------------------------------
po.updateOrganisation = function ($item, item)
{
@@ -155,7 +151,6 @@
delete po.data.item;
delete po.data.$item;
}
//--------------------------------------------------------------
po.selectOrgSport = function ()
{
@@ -166,7 +161,6 @@
sax.clearControlError($('.OrganisationSportId', $frm.org).val(sport.id));
$('.OrganisationSportName', $frm.org).val(sport ? sport.name : '');
}
//--------------------------------------------------------------
po.selectOrgRegionPrimary = function ()
{
@@ -177,7 +171,6 @@
sax.clearControlError($('.OrganisationRegionIdPrimary', $frm.org).val(region.id));
$('.OrganisationRegionNamePrimary', $frm.org).val(region ? region.name : '');
}
//--------------------------------------------------------------
po.getConMthCfg = function (usedMths, mth, val)
{
@@ -229,8 +222,8 @@
po.clearConMth = function (mth)
{
$('#' + po.getConMthId(mth), $pnl.conMths).remove();
po.sortConMths();
}
//--------------------------------------------------------------
$(function ()
{
@@ -248,9 +241,6 @@
$pnl.conMths = $('.OrganisationContactMethods', $frm.org);
$pnl.tblconMths = $('table.sax-data', $pnl.conMths);
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
+51 -23
View File
@@ -1,7 +1,6 @@
/*
* Account page scripts.
*/
(function (win, doc, undef)
{
//--------------------------------------------------------------
@@ -11,7 +10,6 @@
//--------------------------------------------------------------
sax.refreshProfileSportsInfo = function (delay)
{
ps.init();
$pnl.proSpt.removeClass('sax-edit').addClass('sax-populating');
$('.sax-property', $pnl.proSpt).hide();
sax.showDataRefreshingMsg($pnl.proSpt);
@@ -64,28 +62,28 @@
{
//sax.debug('addProfileSport');
ps.clearProfileSport();
sax.openDialog($dlg.proSpt.dialog('option', 'title', sax.dlg.title.addUserSport), 640, 480);
sax.openDialog($dlg.spt.dialog('option', 'title', sax.dlg.title.addUserSport), 640, 480);
}
ps.clearProfileSport = function ()
{
let dlg = $dlg.proSpt;
let dlg = $dlg.spt;
$('.UserSportId,.ProfileSportExists,#ifProfileSportId,input.sax-input,textarea.sax-textarea,select.sax-select', dlg).val('');
$('.SelectSport', dlg).show();
sax.clearControlErrors(dlg);
}
ps.updateProfileSport = function (item)
{
//sax.debug('updateProfileSport', item, $frm.proSptId);
$('.UserSportId', $frm.proSptId).val(item.id);
ps.ajax.profileSport = ps.ajax.profileSport || { url: sax.url.base + 'Account/Ajax/GetProfileSport', formId: $frm.proSptId.prop('id'), callbackFn: ps.doUpdateProfileSport };
//sax.debug('updateProfileSport', item, $frm.sptId);
$('.UserSportId', $frm.sptId).val(item.id);
ps.ajax.profileSport = ps.ajax.profileSport || { url: sax.url.base + 'Account/Ajax/GetProfileSport', formId: $frm.sptId.prop('id'), callbackFn: ps.doUpdateProfileSport };
sax.doAjaxRequest(ps.ajax.profileSport, 50);
}
ps.doUpdateProfileSport = function (response)
{
//sax.debug('doUpdateProfileSport', response);
ps.clearProfileSport();
let dlg = $dlg.proSpt;
let frm = $frm.proSpt;
let dlg = $dlg.spt;
let frm = $frm.spt;
let item = response.sport;
$('.UserSportId', frm).val(item.id);
$('.ProfileSportExists', frm).val(1);
@@ -101,9 +99,9 @@
ps.selectUserSport = function (sport)
{
//sax.debug('selectUserSport');
if ($('.UserSportId', $frm.proSpt).val() > 0) return;
if ($('.UserSportId', $frm.spt).val() > 0) return;
let excludeIds = $.grep(sax.profile.sports.Ids, function (value) { return !sport || value != sport.id; });
sax.mdl.selectSport.fn.selectSport({ caption: sax.dlg.title.selectSport, sportId: $('#ifProfileSportId', $frm.proSpt).val(), excludeIds: excludeIds, fnCallback: ps.onSelectUserSport })
sax.mdl.selectSport.fn.selectSport({ caption: sax.dlg.title.selectSport, sportId: $('#ifProfileSportId', $frm.spt).val(), excludeIds: excludeIds, fnCallback: ps.onSelectUserSport })
}
ps.onSelectUserSport = function (sport)
{
@@ -111,37 +109,67 @@
$('#ifProfileSport').val(sport ? sport.name : '');
}
//--------------------------------------------------------------
ps.getSportContactCfg = function (contact)
{
let cfg = { fnCallback: ps.applySportContact, methods: ps.data.contactTypes, typesUsed: ps.getUsedContactTypes(), contact: contact};
return cfg;
}
ps.getUsedContactTypes = function ()
{
return $('input[name="Contacts.ContactTypes"]', $frm.org).map(function () { return $(this).val(); }).get();
}
ps.addSportContact = function ()
{
sax.debug('addSportContact');
ps.showSportContact(ps.getSportContactCfg());
}
ps.editSportContact= function (contact)
{
sax.debug('editSportContact');
ps.showSportContact(ps.getSportContactCfg(contact));
}
ps.showSportContact=function(cfg)
{
sax.mdl.sportContact.showSportContact(cfg);
}
ps.getConId = function (contact)
{
return 'SptCon_' + contact.type;
}
ps.applySportContact = function ()
{
sax.debug('applySportContact');
}
//--------------------------------------------------------------
ps.storeProfileSport = function ()
{
//sax.debug('storeProfileSport');
sax.clearControlErrors();
ps.ajax.storeProfileSport = ps.ajax.storeProfileSport || { url: sax.url.base + 'Account/Ajax/StoreProfileSport', formId: $frm.proSpt.prop('id'), callbackFn: ps.onStoreProfileSport };
ps.ajax.storeProfileSport = ps.ajax.storeProfileSport || { url: sax.url.base + 'Account/Ajax/StoreProfileSport', formId: $frm.spt.prop('id'), callbackFn: ps.onStoreProfileSport };
sax.doAjaxRequest(ps.ajax.storeProfileSport, 50);
}
ps.onStoreProfileSport = function (response)
{
sax.refreshControlValues(response.controlValues);
if (!response || !response.success) return;
$dlg.proSpt.dialog('close');
$dlg.spt.dialog('close');
sax.refreshProfileSportsInfo();
}
//--------------------------------------------------------------
ps.init = function ()
$(function ()
{
if ($pnl.proSpt) return;
$pnl.proSpt = $('.sax-panel-section.ProfileSports');
$('.sax-action.sax-add', $pnl.proSpt).on('click', function (evt) { ps.addProfileSport(); });
$frm.proSptId = $('#frmProfileSportId', $pnl.proSpt);
$frm.sptId = $('#frmProfileSportId', $pnl.proSpt);
var opt = sax.dlgOpts();
opt.buttons[sax.dlg.btn.ok] = function () { ps.storeProfileSport(); };
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
$dlg.proSpt = $('#dlgProfileSport').dialog(opt);
$frm.proSpt = $('#frmProfileSport', $dlg.proSpt);
$frm.proSpt.on('dblclick', '.ProfileSport.sax-input', ps.selectUserSport);
$frm.proSpt.on('click', '.SelectSport.sax-button', ps.selectUserSport);
}
$dlg.spt = $('#dlgProfileSport').dialog(opt);
$frm.spt = $('#frmProfileSport', $dlg.spt);
$frm.spt.on('dblclick', '.ProfileSport.sax-input', ps.selectUserSport);
$frm.spt.on('click', '.SelectSport.sax-button', ps.selectUserSport);
$frm.spt.on('click', '.SportContacts .sax-action.sax-add', ps.addSportContact);
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,12 +1,10 @@
/*
* Account page scripts.
*/
(function (win, doc, undef)
{
"use strict";
let $pnl = sax.$pnl, $dlg = sax.$dlg, $frm = sax.$frm;
//--------------------------------------------------------------
sax.refreshProfileContactInfo = function ()
{
@@ -86,7 +84,6 @@
if (!response.success) return;
sax.refreshProfileContactInfo();
}
//--------------------------------------------------------------
sax.refreshDob = function ()
{
@@ -125,7 +122,6 @@
$selDobDay.val('');
$selDobDay.prop('disabled', !monthVal);
}
//--------------------------------------------------------------
sax.selectRegionCountry = function ()
{
@@ -137,7 +133,6 @@
sax.clearControlError($('#ifAccountRegionIdCountry').val(region.id));
$('#ifAccountRegionCaptionCountry').val(region ? region.name : '');
}
//--------------------------------------------------------------
sax.onDropContactImage = function (evt)
{
@@ -193,7 +188,6 @@
let file = $fileCtrl[0].files[0];
sax.onDropContactImageFile(file, dlg);
}
//--------------------------------------------------------------
$(function ()
{
@@ -215,9 +209,6 @@
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
$dlg.selectContactImage = $('#dlgSelectContactImage').dialog(opt);
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,13 +1,11 @@
/*
* Region selection.
*/
(function (win, doc, undef)
{
"use strict";
let sr = sax.mdl.selectRegion = sax.mdl.selectRegion || {};
sr.regions = {}; sr.fn = {}; sr.ajax = {}; sr.itemIdPrefix = 'Rgn_';
//--------------------------------------------------------------
/*
* Region selection config:
@@ -19,7 +17,6 @@
*/
sr.fn.selectRegion = function (cfg)
{
sr.fn.init();
sr.cfg = cfg;
sr.regionId = cfg.regionId;
if (sr.regions.length) sr.fn.showSelectRegion();
@@ -43,7 +40,6 @@
sr.fn.displayRegions();
sax.openDialog(sr.$dlg.dialog('option', { title: sr.cfg.caption || 'Select Region' }), sr.cfg.width || 400, sr.cfg.height || 800);
}
//--------------------------------------------------------------
sr.fn.compareRegions = function (a, b)
{
@@ -52,7 +48,6 @@
return a.name.localeCompare(b.name);
return comparison;
}
//--------------------------------------------------------------
sr.fn.displayRegions = function ()
{
@@ -90,7 +85,6 @@
let region = sr.fn.getRegion(id);
return region ? region.name : '';
}
//--------------------------------------------------------------
sr.fn.onClickRegion = function (region, $region)
{
@@ -117,26 +111,22 @@
delete sr.cfg;
delete sr.regionId;
}
//--------------------------------------------------------------
sr.fn.onDlgSize = function ()
{
let $pnl = $('.sax-selectRegion-regions.AvailableRegions', sr.$dlg);
$pnl.outerHeight(Math.floor(sr.$dlg.innerHeight() - $pnl.position().top - ($pnl.outerHeight(true) - $pnl.innerHeight())));
}
//--------------------------------------------------------------
sr.fn.init = function ()
$(function ()
{
if (sr.$dlg) return;
var opt = sax.dlgOpts();
opt.open = function (evt, ui) { sr.fn.onDlgSize(); };
opt.resize = function (evt, ui) { sr.fn.onDlgSize(); };
opt.buttons[sax.dlg.btn.ok] = function () { sr.fn.storeSelectRegion(); };
opt.buttons[sax.dlg.btn.cancel] = function () { sr.fn.cleanUp(); $(this).dialog('close'); };
sr.$dlg = $('#dlgSelectRegion').dialog(opt);
}
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,12 +1,11 @@
/*
* Admin - Results paging.
*/
(function (win, doc, undef)
{
"use strict";
let rp = sax.mdl.resultsPaging = sax.mdl.resultsPaging || { fn: {}, msg: {}, contexts: [] };
let rp = sax.mdl.resultsPaging = sax.mdl.resultsPaging || { msg: {} };
rp.fn = {}; rp.contexts = [];
//--------------------------------------------------------------
rp.fn.refreshPaging = function (paging, contextSel, refreshFn)
{
@@ -20,7 +19,6 @@
//$('.sax-paging-first,.sax-paging-prev', context.$rp).toggle(paging.pageNo > 1);
//$('.sax-paging-next,.sax-paging-last', context.$rp).toggle(paging.pageNo < paging.pageCount);
}
//--------------------------------------------------------------
rp.fn.getContext = function (contextSel, refreshFn)
{
@@ -33,7 +31,6 @@
rp.contexts.push(context);
return context;
}
//--------------------------------------------------------------
rp.fn.firstPage = function (context)
{
@@ -63,7 +60,6 @@
context.$pageNo.val(context.paging.pageCount);
context.refreshFn();
}
//--------------------------------------------------------------
rp.fn.init = function (context)
{
@@ -77,7 +73,10 @@
$('.sax-paging-next', context.$rp).off('click').on('click', function () { rp.fn.nextPage(context); });
$('.sax-paging-last', context.$rp).off('click').on('click', function () { rp.fn.lastPage(context); });
}
//--------------------------------------------------------------
$(function ()
{
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,11 +1,9 @@
/*
* Security page scripts.
*/
(function (win, doc, undef)
{
"use strict";
//--------------------------------------------------------------
sax.doSignin = function ()
{
@@ -19,7 +17,6 @@
if (!response.success) return;
sax.goToPage('');
}
//--------------------------------------------------------------
sax.doScorePassword = function ()
{
@@ -31,7 +28,6 @@
var score = (response || {}).score || 0;
sax.$prgPwordStrength.progressbar("option", "value", score).removeClass('amber green').addClass(score > 3 ? 'green' : score > 2 ? 'amber' : '');
}
//--------------------------------------------------------------
sax.doChangePassword = function ()
{
@@ -47,7 +43,6 @@
sax.goToPage('Security/Signin');
else sax.goToPage('');
}
//--------------------------------------------------------------
sax.doRequestPassword = function ()
{
@@ -67,7 +62,6 @@
sax.doAlert($('.sax-page-caption').text(), response.successMsg, gotoSigninPage);
else gotoSigninPage();
}
//--------------------------------------------------------------
$(function ()
{
@@ -85,8 +79,6 @@
sax.$frm.reqPword.on('keypress', '#ifEmailAddress', function (e) { if (e.which == 13) sax.doRequestPassword(); });
$('#pbRequestPassword', sax.$frm.reqPword).on('click', function () { sax.doRequestPassword(); }).on('keypress', function (e) { if (e.which == 13) sax.doRequestPassword(); });
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,12 +1,11 @@
/*
* Sport contact.
* Sport contacts.
*/
(function (win, doc, undef)
{
//--------------------------------------------------------------
"use strict";
let sc = sax.mdl.sportContact = { ajax: {}, data: {}, $pnl: {}, $dlg: {}, $frm: {} };
let sc = sax.mdl.sportContact = { fn: {}, ajax: {}, data: {}, $pnl: {}, $dlg: {}, $frm: {} };
//--------------------------------------------------------------
/*
* Sport Contact config:
@@ -19,28 +18,25 @@
* - typesUsed
* - fnCallback - method to call on completion to store details.
*/
sax.showSportContact = function (cfg)
sc.showSportContact = function (cfg)
{
sc.fn.init();
sc.data.cfg = cfg;
sax.openDialog(sc.$dlg.dialog('option', { title: sc.data.cfg.caption || 'Select Sport' }), sc.data.cfg.width || 400, sc.data.cfg.height || 800);
sax.openDialog(sc.$dlg.sptCnt.dialog('option', { title: sc.data.cfg.caption || 'Sport Contact' }), sc.data.cfg.width || 400, sc.data.cfg.height || 800);
}
//--------------------------------------------------------------
sc.fn.displayContact = function ()
{
}
//--------------------------------------------------------------
sc.fn.init = function ()
$(function ()
{
if (sc.$dlg.sptCnt) return;
var opt = sax.dlgOpts();
opt.open = function (evt, ui) { sc.fn.onDlgSize(); };
opt.resize = function (evt, ui) { sc.fn.onDlgSize(); };
opt.buttons[sax.dlg.btn.ok] = function () { sc.fn.storeSelectSport(); };
opt.buttons[sax.dlg.btn.cancel] = function () { sc.fn.cleanUp(); $(this).dialog('close'); };
sc.$dlg.sptCnt = $('#dlgSportContact').dialog(opt);
}
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -9,7 +9,6 @@
//--------------------------------------------------------------
sax.showSportExperience = function (usrSpt)
{
se.init();
//sax.debug('showSportExperience', usrSpt);
$('.sax-header .SportName', se.$pnl.sportExp).text(usrSpt.sportName);
$('.sax-panel-section').slideUp(750, function () { se.$pnl.sportExp.slideDown(750); });
@@ -131,9 +130,8 @@
sax.refreshProfileSportsInfo(50);
}
//--------------------------------------------------------------
se.init=function ()
$(function ()
{
if (se.$pnl.sportExp) return;
se.$pnl.sportExp = $('.sax-panel.ProfileSportExperience');
se.$pnl.hdr = $('.sax-header', se.$pnl.sportExp);
se.$pnl.results = $('.sax-panel-results.ProfileSportExperiences', se.$pnl.sportExp);
@@ -151,7 +149,7 @@
se.$dpPeriodTo = $('.sax-calendar.ExperiencePeriodTo', se.$frm.sportExp);
se.$dpPeriodFrom.datepicker({ onSelect: function () { $(this).change(); } });
sax.allowClearCalendar('#frmSportExperience .sax-calendar.ExperiencePeriodTo');
}
});
//--------------------------------------------------------------
}(window, window.document));
@@ -1,13 +1,11 @@
/*
* Sport selection.
*/
(function (win, doc, undef)
{
"use strict";
let ss = sax.mdl.selectSport = sax.mdl.selectSport || {};
ss.sports = {}; ss.fn = {}; ss.ajax = {};;
//--------------------------------------------------------------
/*
* Sport selection config:
@@ -18,7 +16,6 @@
*/
ss.fn.selectSport = function (cfg)
{
ss.fn.init();
ss.cfg = cfg;
ss.sportId = cfg.sportId;
if (ss.sports.length) ss.fn.showSelectSport();
@@ -42,7 +39,6 @@
ss.fn.displaySports();
sax.openDialog(ss.$dlg.dialog('option', { title: ss.cfg.caption || 'Select Sport' }), ss.cfg.width || 400, ss.cfg.height || 800);
}
//--------------------------------------------------------------
ss.fn.compareSports = function (a, b)
{
@@ -51,7 +47,6 @@
return a.name.localeCompare(b.name);
return comparison;
}
//--------------------------------------------------------------
ss.fn.displaySports = function ()
{
@@ -86,7 +81,6 @@
let sport = ss.fn.getSport(id);
return sport ? sport.name : '';
}
//--------------------------------------------------------------
ss.fn.onClickSport = function (sport, $sport)
{
@@ -113,26 +107,22 @@
delete ss.cfg;
delete ss.sportId;
}
//--------------------------------------------------------------
ss.fn.onDlgSize = function ()
{
let $pnl = $('.sax-selectSport-sports.AvailableSports', ss.$dlg);
$pnl.outerHeight(Math.floor(ss.$dlg.innerHeight() - $pnl.position().top - ($pnl.outerHeight(true) - $pnl.innerHeight())));
}
//--------------------------------------------------------------
ss.fn.init = function ()
$(function ()
{
if (ss.$dlg) return;
var opt = sax.dlgOpts();
opt.open = function (evt, ui) { ss.fn.onDlgSize(); };
opt.resize = function (evt, ui) { ss.fn.onDlgSize(); };
opt.buttons[sax.dlg.btn.ok] = function () { ss.fn.storeSelectSport(); };
opt.buttons[sax.dlg.btn.cancel] = function () { ss.fn.cleanUp(); $(this).dialog('close'); };
ss.$dlg = $('#dlgSelectSport').dialog(opt);
}
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,14 +1,12 @@
/*
* Search - Organisations.
*/
(function (win, doc, undef)
{
"use strict";
let so = sax.searchOrganisations = {};
so.ajax = {}; so.data = {}; so.fn = {};
let $pnl = so.$pnl = {}, $frm = so.$frm = {}, $dlg = so.$dlg = {};
//--------------------------------------------------------------
so.refreshResults = function (delay)
{
@@ -63,7 +61,6 @@
$bgr.toggle(!!$('.sax-dropdown-menu .sax-dropdown-item', $item).length);
return $item;
}
//--------------------------------------------------------------
so.getFilterDropdownTemplate = function ()
{
@@ -89,7 +86,6 @@
{
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
}
//--------------------------------------------------------------
so.selectFilterSport = function ()
{
@@ -107,7 +103,6 @@
$('.FilterSportId,.FilterSportCaption', $frm.filter).val('');
so.refreshResults();
}
//--------------------------------------------------------------
so.selectFilterRegion = function ()
{
@@ -125,7 +120,6 @@
$('.FilterRegionId,.FilterRegionCaption', $frm.filter).val('');
so.refreshResults();
}
//--------------------------------------------------------------
so.viewItem = function (item)
{
@@ -155,7 +149,6 @@
$dlg.org.dialog('option', 'title', item.name || sax.dlg.title.organisation);
sax.openDialog($dlg.org, 720, 800);
}
//--------------------------------------------------------------
$(function ()
{
@@ -177,7 +170,6 @@
setTimeout(so.refreshResults, 250);
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */
@@ -1,14 +1,12 @@
/*
* Search - Users.
*/
(function (win, doc, undef)
{
"use strict";
let su = sax.searchUsers = {};
su.ajax = {}; su.data = {}; su.fn = {};
let $pnl = su.$pnl = {}, $frm = su.$frm = {}, $dlg = su.$dlg = {};
//--------------------------------------------------------------
su.refreshResults = function (delay)
{
@@ -60,7 +58,6 @@
$bgr.toggle(!!$('.sax-dropdown-menu .sax-dropdown-item', $item).length);
return $item;
}
//--------------------------------------------------------------
su.getFilterDropdownTemplate = function ()
{
@@ -86,7 +83,6 @@
{
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
}
//--------------------------------------------------------------
su.selectFilterSport = function ()
{
@@ -104,7 +100,6 @@
$('.FilterSportId,.FilterSportCaption', $frm.filter).val('');
su.refreshResults();
}
//--------------------------------------------------------------
su.selectFilterRegion = function ()
{
@@ -122,7 +117,6 @@
$('.FilterRegionId,.FilterRegionCaption', $frm.filter).val('');
su.refreshResults();
}
//--------------------------------------------------------------
su.viewItem = function (item)
{
@@ -141,7 +135,6 @@
$dlg.usr.dialog('option', 'title', item.name || sax.dlg.title.user);
sax.openDialog($dlg.usr, 600, 600);
}
//--------------------------------------------------------------
$(function ()
{
@@ -163,7 +156,6 @@
setTimeout(su.refreshResults, 250);
});
//--------------------------------------------------------------
}(window, window.document));
/* The End */