This commit is contained in:
2022-05-16 15:01:01 +01:00
parent 4cc1185c3c
commit d17cce340e
18 changed files with 318 additions and 203 deletions
@@ -635,6 +635,15 @@ You will then be able to publicise your sporting activities.</value>
<data name="msg.upload.image.invalid" xml:space="preserve">
<value>Invalid image file uploaded</value>
</data>
<data name="msg.upload.image.invalid.content.type" xml:space="preserve">
<value>Invalid image content type.</value>
</data>
<data name="msg.upload.image.invalid.mime" xml:space="preserve">
<value>Invalid image mime type.</value>
</data>
<data name="msg.upload.image.resize.failed" xml:space="preserve">
<value>Image resize failed.</value>
</data>
<data name="msg.upload.image.single" xml:space="preserve">
<value>Only one image can be uploaded.</value>
</data>
@@ -89,6 +89,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
// Reference data.
public List<CodeDesc> Genders { get; } = new List<CodeDesc>();
public List<CodeDesc> Months { get; } = new List<CodeDesc>();
public List<String> ImageContentTypes { get; set; }
}
// Ajax request.
[HttpPost]
@@ -113,6 +114,9 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
for (int month = 1; month <= 12; month++)
responseData.Months.Add(month.ToString(), DateUtil.Format(new DateTime(DateTime.Today.Year, month, 1), "MMMM", SessionCulture));
// Profile image content types.
responseData.ImageContentTypes = SaxItemImage.GetValidContentTypes(Sax.DataItemType.UserAccount);
// Retrieve user details.
SaxUserAccount userAccount = AccountMgr.GetUserAccountById(UserAccountId);
if (userAccount == null)
@@ -190,6 +194,18 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
if (!imageConfig.ValidImage)
return Json(responseData.SetControlError("AccountContactImage", Localiser["msg.upload.image.invalid"]));
// Validate mime type.
if (!SaxItemImage.GetValidMimeTypes(Sax.DataItemType.UserAccount).Contains(imageConfig.MimeType))
return Json(responseData.SetControlError("AccountContactImage", Localiser["msg.upload.image.invalid.mime"]));
// Validate content type.
if (StringUtil.IsEmpty(file.ContentType) || !SaxItemImage.GetValidContentTypes(Sax.DataItemType.UserAccount).ContainsCI(file.ContentType))
return Json(responseData.SetControlError("AccountContactImage", Localiser["msg.upload.image.invalid.content.type"]));
// Resize the image if required.
if (!ImageUtils.ConstrainImage(imageConfig, Sax.Config.Online.Profile.User.Image.WidthMax, Sax.Config.Online.Profile.User.Image.HeightMax))
return Json(responseData.SetControlError("AccountContactImage", Localiser["msg.upload.image.resize.failed"]));
// Image belongs to the user's account.
ItemId userItemId = GetUserItemId(UserAccountId);
@@ -200,9 +216,9 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
itemImage.Filename = file.FileName;
itemImage.Mime = SacsContentTypeHelper.GetMimeTypeFromContentType(file.ContentType).ToString().ToLower();
itemImage.ContentType = file.ContentType;
itemImage.ImageData = imageConfig.ImageData;
itemImage.Width = imageConfig.Width;
itemImage.Height = imageConfig.Height;
itemImage.ImageData = imageData;
itemImage.Status = SaxItemImage.DefaultStatus;
if (!SysId.IsValid(itemImage.Id))
@@ -155,8 +155,9 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
public List<ArticleData_List> Articles { get; } = new List<ArticleData_List>();
/// <summary>Organisations that the user has rights to author articles for.</summary>
public List<OrganisationData> Organisations { get; set; }
public ItemIdName defaultSport { get; set; }
public ItemIdName defaultRegion { get; set; }
public ItemIdName DefaultSport { get; set; }
public ItemIdName DefaultRegion { get; set; }
public List<String> ImageContentTypes { get; set; }
}
//-------------------------------------------------------------------
[HttpPost]
@@ -215,7 +216,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
SysId defaultSportId = organisation?.SportIdPrimary ?? null;
if (SysId.IsValid(defaultSportId))
{
responseData.defaultSport = new AjaxResponse_Data.ItemIdName()
responseData.DefaultSport = new AjaxResponse_Data.ItemIdName()
{
Id = model.GetEncryptedSportId(defaultSportId),
Name = model.GetSportCaption(defaultSportId)
@@ -226,13 +227,16 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
SysId defaultRegionId = organisation?.RegionIdPrimary ?? userAccount?.RegionIdCountry ?? null;
if (SysId.IsValid(defaultRegionId))
{
responseData.defaultRegion = new AjaxResponse_Data.ItemIdName()
responseData.DefaultRegion = new AjaxResponse_Data.ItemIdName()
{
Id = model.GetEncryptedRegionId(defaultRegionId),
Name = model.GetRegionCaption(defaultRegionId)
};
}
// Article image content types.
responseData.ImageContentTypes = SaxItemImage.GetValidContentTypes(Sax.DataItemType.Article);
// Item filter.
SaxArticle.Params prmArticle = new SaxArticle.Params();
prmArticle.UserAccountIdsAuthorIncluded.Add(sessionData.User.UserAccountId);
@@ -445,6 +449,18 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
if (!imageConfig.ValidImage)
return Json(responseData.SetControlError("ArticleImage", Localiser["msg.upload.image.invalid"]));
// Validate mime type.
if (!SaxItemImage.GetValidMimeTypes(Sax.DataItemType.Article).Contains(imageConfig.MimeType))
return Json(responseData.SetControlError("ArticleImage", Localiser["msg.upload.image.invalid.mime"]));
// Validate content type.
if (StringUtil.IsEmpty(file.ContentType) || !SaxItemImage.GetValidContentTypes(Sax.DataItemType.Article).ContainsCI(file.ContentType))
return Json(responseData.SetControlError("ArticleImage", Localiser["msg.upload.image.invalid.content.type"]));
// Resize the image if required.
if (!ImageUtils.ConstrainImage(imageConfig, Sax.Config.Online.Articles.Images.WidthMax, Sax.Config.Online.Articles.Images.HeightMax))
return Json(responseData.SetControlError("ArticleImage", Localiser["msg.upload.image.resize.failed"]));
// Image belongs to the article.
// If the article doesn't yet exist, it will need to be uploaded to the user first and later transferred.
SysId articleId = model.ExtractSysId(model.ArticleId);
@@ -470,9 +486,9 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
itemImage.Filename = file.FileName;
itemImage.Mime = SacsContentTypeHelper.GetMimeTypeFromContentType(file.ContentType).ToString().ToLower();
itemImage.ContentType = file.ContentType;
itemImage.ImageData = imageConfig.ImageData;
itemImage.Width = imageConfig.Width;
itemImage.Height = imageConfig.Height;
itemImage.ImageData = imageData;
itemImage.SessionUid = sessionData.SessionIdx;
itemImage.ImageUid = sessionData.NextItemIdx;
itemImage.Status = SaxItemImage.DefaultStatus;
@@ -20,170 +20,169 @@
@* Article dialog and form *@
<div id="dlgArticle" class="sax-dialog" title="">
<div class="spacer2"></div>
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmArticle", @class = "sax-form", @onSubmit = "return false;" }))
{
@Html.HiddenFor(model => model.ArticleId, new { @id = "ifArticleId", @class = "ArticleId" })
@Html.HiddenFor(model => model.ArticleExists, new { @id = "ifArticleExists", @class = "ArticleExists" })
@Html.HiddenFor(model => model.ArticleOrganisationId, new { @id = "ifArticleOrganisationId", @class = "ArticleOrganisationId" })
<div class="sax-article ArticleHeader-xxx">
<div class="sax-article">
<div class="sax-article-panel sax-article-header">
<div class="sax-article-panel sax-article-header">
<div class="spacer2"></div>
@* Organisation *@
<div class="sax-form-control ArticleOrganisation">
<div class="row">
<div class="col-sm-3">
<div class="sax-label pt4 pr8">
<label for="ifArticleOrganisation"><span>@Localiser["label.organisation"]</span></label>
</div>
@* Organisation *@
<div class="sax-form-control ArticleOrganisation">
<div class="row">
<div class="col-sm-3">
<div class="sax-label pt4 pr8">
<label for="ifArticleOrganisation"><span>@Localiser["label.organisation"]</span></label>
</div>
<div class="col-sm">
<div class="sax-control">
<input type="text" id="ifArticleOrganisation" class="ArticleOrganisation sax-input" readonly="readonly" />
</div>
</div>
<div class="col-sm">
<div class="sax-control">
<input type="text" id="ifArticleOrganisation" class="ArticleOrganisation sax-input" readonly="readonly" />
</div>
</div>
</div>
@* Article headline *@
<div class="sax-form-control ArticleHeadline">
<div class="row">
<div class="col">
<div class="sax-label"><label for="ifArticleHeadline"><span>@Localiser["label.headline"]</span><span class="required">&nbsp;*</span></label></div>
</div>
<div class="fixed right"><div class="sax-info"></div></div>
</div>
<div class="sax-control">
@Html.TextBoxFor(model => model.ArticleHeadline, new { @id = "ifArticleHeadline", @class = "ArticleHeadline sax-input", @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Article_Headline) })
</div>
<div class="sax-message"></div>
</div>
@* Article summary *@
<div class="sax-form-control ArticleSummary">
<div class="row">
<div class="col">
<div class="sax-label"><label for="ifArticleSummary"><span>@Localiser["label.summary"]</span><span class="required">&nbsp;*</span></label></div>
</div>
<div class="fixed right"><div class="sax-info"></div></div>
</div>
<div class="sax-control">
@Html.TextAreaFor(model => model.ArticleSummary, new { @id = "ifArticleSummary", @class = "ArticleSummary sax-textarea", @rows = 6, @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Article_Summary) })
</div>
<div class="sax-message"></div>
</div>
@* Sport *@
<div class="sax-form-control ArticleSportId">
<div class="row">
<div class="col-sm-3">
<div class="sax-label">
<label for="ifArticleSportId"><span>@Localiser["label.sport"]</span><span class="required">&nbsp;*</span></label>
</div>
</div>
<div class="col-sm">
<div class="sax-control row">
@Html.HiddenFor(model => model.ArticleSportId, new { @id = "ifArticleSportId", @class = "ArticleSportId" })
<div class="col">@Html.TextBoxFor(model => model.ArticleSportCaption, new { @id = "ifArticleSportCaption", @class = "ArticleSportCaption sax-input", @readonly = "readonly", @onDblClick = "sax.selectSport()" }) </div>
<div class="fixed"><button class="SelectSport sax-button" style="min-width:auto;margin-left:4px;padding:4px 6px">@Localiser["label.select"]</button></div>
</div>
<div class="sax-message"></div>
</div>
</div>
</div>
@* Region *@
<div class="sax-form-control ArticleRegionId">
<div class="row">
<div class="col-sm-3">
<div class="sax-label">
<label for="ifArticleRegionId"><span>@Localiser["label.region"]</span><span class="required">&nbsp;*</span></label>
</div>
</div>
<div class="col-sm">
<div class="sax-control row">
@Html.HiddenFor(model => model.ArticleRegionId, new { @id = "ifArticleRegionId", @class = "ArticleRegionId" })
<div class="col">@Html.TextBoxFor(model => model.ArticleRegionCaption, new { @id = "ifArticleRegionCaption", @class = "ArticleRegionCaption sax-input", @readonly = "readonly", @onDblClick = "sax.selectRegion()" }) </div>
<div class="fixed"><button class="SelectRegion sax-button" style="min-width:auto;margin-left:4px;padding:4px 6px">@Localiser["label.select"]</button></div>
</div>
<div class="sax-message"></div>
</div>
</div>
</div>
@* Publication *@
<div class="sax-form-control ArticlePublication">
<div class="row">
<div class="col-sm-3">
<div class="sax-label">
<label for="ifArticleRegionId"><span>@Localiser["label.publication"]</span></label>
</div>
</div>
<div class="col-sm">
<div class="sax-control">
<div class="row ArticlePublish">
@Html.HiddenFor(model => model.ArticlePublished, new { @id = "ifArticlePublished" })
<div class="fixed"><div class="pl16 pt4 pr8">@Html.CheckBoxFor(model => model.ArticlePublish, new { @id = "chkArticlePublish", @class = "ArticlePublish" })&nbsp;<span class="" onclick="$('#chkArticlePublish').click()">@Localiser["label.publish"]</span></div></div>
<div class="col">@Html.TextBoxFor(model => model.ArticlePublishOn, new { @id = "ifArticlePublishOn", @class = "sax-input sax-calendar ArticlePublishOn", @readonly = "readonly" })</div>
</div>
<div class="ArticlePublished">
<div class=""><div class="">@Localiser["label.published"]: <span class="ArticlePublishedOn"></span></div></div>
<div class=""><div class="">@Localiser["label.feedback"]: <span class="ArticleFeedback"></span></div></div>
</div>
</div>
<div class="sax-message"></div>
</div>
</div>
</div>
</div>
<div class="sax-article-panel sax-article-content">
<div class="sax-article-segment-list">
@* Article headline *@
<div class="sax-form-control ArticleHeadline">
<div class="row">
<div class="col">
<div class="sax-label"><label for="ifArticleHeadline"><span>@Localiser["label.headline"]</span><span class="required">&nbsp;*</span></label></div>
</div>
<div class="fixed right"><div class="sax-info"></div></div>
</div>
<div class="sax-control">
@Html.TextBoxFor(model => model.ArticleHeadline, new { @id = "ifArticleHeadline", @class = "ArticleHeadline sax-input", @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Article_Headline) })
</div>
<div class="sax-message"></div>
</div>
<div class="sax-panel-item-template">
<div class="sax-panel-item ArticleSegment">
@* Inputs with same name for every segment to ensure they are uploaded as a list. *@
<input type="hidden" name="ArticleContentSegmentBodies" class="ArticleContentSegmentBody" value="" />
<input type="hidden" name="ArticleContentSegmentItemImageIds" class="ArticleContentSegmentItemImageId" value="" />
<input type="hidden" name="ArticleContentSegmentImageIdxs" class="ArticleContentSegmentImageIdx" value="" />
@* Image drop panel *@
<div class="sax-panel-file-drop row">
<div class="col">Drop image here</div>
<div class="fixed">
<img class="ContactImageUploadProgress" src="~/img/animated/progress-basketball-32.gif" style="display:none;margin:8px 4px;" />
@* Article summary *@
<div class="sax-form-control ArticleSummary">
<div class="row">
<div class="col">
<div class="sax-label"><label for="ifArticleSummary"><span>@Localiser["label.summary"]</span><span class="required">&nbsp;*</span></label></div>
</div>
<div class="fixed right"><div class="sax-info"></div></div>
</div>
<div class="sax-control">
@Html.TextAreaFor(model => model.ArticleSummary, new { @id = "ifArticleSummary", @class = "ArticleSummary sax-textarea", @rows = 6, @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Article_Summary) })
</div>
<div class="sax-message"></div>
</div>
@* Sport *@
<div class="sax-form-control ArticleSportId">
<div class="row">
<div class="col-sm-3">
<div class="sax-label">
<label for="ifArticleSportId"><span>@Localiser["label.sport"]</span><span class="required">&nbsp;*</span></label>
</div>
</div>
<div class="col-sm">
<div class="sax-control row">
@Html.HiddenFor(model => model.ArticleSportId, new { @id = "ifArticleSportId", @class = "ArticleSportId" })
<div class="col">@Html.TextBoxFor(model => model.ArticleSportCaption, new { @id = "ifArticleSportCaption", @class = "ArticleSportCaption sax-input", @readonly = "readonly", @onDblClick = "sax.selectSport()" }) </div>
<div class="fixed"><button class="SelectSport sax-button" style="min-width:auto;margin-left:4px;padding:4px 6px">@Localiser["label.select"]</button></div>
</div>
<div class="sax-message"></div>
</div>
</div>
</div>
@* Region *@
<div class="sax-form-control ArticleRegionId">
<div class="row">
<div class="col-sm-3">
<div class="sax-label">
<label for="ifArticleRegionId"><span>@Localiser["label.region"]</span><span class="required">&nbsp;*</span></label>
</div>
</div>
<div class="col-sm">
<div class="sax-control row">
@Html.HiddenFor(model => model.ArticleRegionId, new { @id = "ifArticleRegionId", @class = "ArticleRegionId" })
<div class="col">@Html.TextBoxFor(model => model.ArticleRegionCaption, new { @id = "ifArticleRegionCaption", @class = "ArticleRegionCaption sax-input", @readonly = "readonly", @onDblClick = "sax.selectRegion()" }) </div>
<div class="fixed"><button class="SelectRegion sax-button" style="min-width:auto;margin-left:4px;padding:4px 6px">@Localiser["label.select"]</button></div>
</div>
<div class="sax-message"></div>
</div>
</div>
</div>
@* Publication *@
<div class="sax-form-control ArticlePublication">
<div class="row">
<div class="col-sm-3">
<div class="sax-label">
<label for="ifArticleRegionId"><span>@Localiser["label.publication"]</span></label>
</div>
</div>
<div class="col-sm">
<div class="sax-control">
<div class="row ArticlePublish">
@Html.HiddenFor(model => model.ArticlePublished, new { @id = "ifArticlePublished" })
<div class="fixed"><div class="pl16 pt4 pr8">@Html.CheckBoxFor(model => model.ArticlePublish, new { @id = "chkArticlePublish", @class = "ArticlePublish" })&nbsp;<span class="" onclick="$('#chkArticlePublish').click()">@Localiser["label.publish"]</span></div></div>
<div class="col">@Html.TextBoxFor(model => model.ArticlePublishOn, new { @id = "ifArticlePublishOn", @class = "sax-input sax-calendar ArticlePublishOn", @readonly = "readonly" })</div>
</div>
<div class="ArticlePublished">
<div class=""><div class="">@Localiser["label.published"]: <span class="ArticlePublishedOn"></span></div></div>
<div class=""><div class="">@Localiser["label.feedback"]: <span class="ArticleFeedback"></span></div></div>
</div>
</div>
@* Segment details *@
<div class="row">
@* Segment body *@
<div class="col">
<div class="sax-article-segment-body"></div>
<div class="sax-article-segment-image hidden"><img src="" alt="" title="" /></div>
</div>
<div class="fixed sax-actions">
@* Segment actions *@
<div class="sax-action sax-add"><img src="~/img/action/add24.png" alt="" title="" /></div>
<div class="sax-action sax-add-image"><img src="~/img/action/image-add-24.png" alt="" title="" /></div>
<div class="sax-action sax-up"><img src="~/img/action/upload24.png" alt="" title="" /></div>
<div class="sax-action sax-down"><img src="~/img/action/download24.png" alt="" title="" /></div>
<div class="sax-action sax-delete"><img src="~/img/action/delete24.png" alt="" title="" /></div>
</div>
<div class="sax-message"></div>
</div>
</div>
</div>
<div class="spacer2"></div>
</div>
<div class="sax-article-panel sax-article-content">
<div class="sax-article-segment-list">
</div>
<div class="sax-panel-item-template">
<div class="sax-panel-item ArticleSegment">
@* Inputs with same name for every segment to ensure they are uploaded as a list. *@
<input type="hidden" name="ArticleContentSegmentBodies" class="ArticleContentSegmentBody" value="" />
<input type="hidden" name="ArticleContentSegmentItemImageIds" class="ArticleContentSegmentItemImageId" value="" />
<input type="hidden" name="ArticleContentSegmentImageIdxs" class="ArticleContentSegmentImageIdx" value="" />
@* Image drop panel *@
<div class="sax-panel-file-drop row">
<div class="col">Drop image here</div>
<div class="fixed">
<img class="ContactImageUploadProgress" src="~/img/animated/progress-basketball-32.gif" style="display:none;margin:8px 4px;" />
</div>
</div>
@* Segment details *@
<div class="row">
@* Segment body *@
<div class="col">
<div class="sax-article-segment-body"></div>
<div class="sax-article-segment-image hidden"><img src="" alt="" title="" /></div>
</div>
<div class="fixed sax-actions">
@* Segment actions *@
<div class="sax-action sax-add"><img src="~/img/action/add24.png" alt="" title="" /></div>
<div class="sax-action sax-add-image"><img src="~/img/action/image-add-24.png" alt="" title="" /></div>
<div class="sax-action sax-up"><img src="~/img/action/upload24.png" alt="" title="" /></div>
<div class="sax-action sax-down"><img src="~/img/action/download24.png" alt="" title="" /></div>
<div class="sax-action sax-delete"><img src="~/img/action/delete24.png" alt="" title="" /></div>
</div>
</div>
</div>
</div>
</div>
}
<div class="spacer2"></div>
</div>
}
</div>
@* Article Image upload dialog and form *@
@@ -11,11 +11,11 @@
<div class="sax-header"><div class="sax-caption">@Localiser["security.caption.signin"]</div></div>
<div class="sax-content">
<div class="spacer4"></div>
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmSignIn", @class = "sax-form", @onsubmit = "return false;" }))
{
<div class="spacer4"></div>
<div class="sax-form-control EmailAddress">
<div class="sax-label">
<label for="ifEmailAddress"><span>@Localiser["label.email.address"]</span><span class="required">&nbsp;*</span></label>
@@ -25,23 +25,19 @@
</div>
<div class="sax-message"></div>
</div>
<div class="spacer4"></div>
<div class="sax-form-control Password">
<div class="row">
<div class="col-6">
<div class="sax-label">
<label for="ifPassword"><span>@Localiser["label.password"]</span><span class="required">&nbsp;*</span></label>
</div>
</div>
<div class="sax-label">
<label for="ifPassword"><span>@Localiser["label.password"]</span><span class="required">&nbsp;*</span></label>
</div>
<div class="sax-control">
@Html.PasswordFor(model => model.Password, new { @id = "ifPassword", @class = "sax-input", @maxlength = @Model.PasswordMaxLength })
</div>
<div class="sax-message"></div>
</div>
<div class="spacer4"></div>
<div class="sax-form-control">
<div class="row">
<div class="col-6">
@@ -53,16 +49,13 @@
</div>
</div>
</div>
<div class="spacer4"></div>
<div class="">
<div id="pbSignIn" class="sax-button-action fullwidth pointer" style="margin:16px 0;">@Localiser["security.caption.signin"]</div>
</div>
}
</div>
</div>
</div>
+20 -5
View File
@@ -35,6 +35,7 @@
sax.data.articleOrganisations = response.organisations;
sax.data.defaultSport = response.defaultSport;
sax.data.defaultRegion = response.defaultRegion;
sax.data.imageContentTypes = response.imageContentTypes;
sax.refreshPaging(response, '#frmArticleFilter', am.refreshResults);
// Menu.
let $mnu = $('.sax-burger ul.sax-dropdown-menu', $pnl.filter).empty();
@@ -165,9 +166,8 @@
sax.clearControlErrors();
am.switchArticleHeader();
$dlg.article.dialog('option', 'title', title);
sax.openDialog($dlg.article, 600, 800);
$('.ArticleHeadline.sax-input', $frm.article).trigger("input");
$('.ArticleSummary.sax-textarea', $frm.article).trigger("input");
sax.openDialog($dlg.article, 800, 1200);
$('.ArticleHeadline.sax-input,.ArticleSummary.sax-textarea', $frm.article).trigger("input");
}
//--------------------------------------------------------------
@@ -304,6 +304,20 @@
{
ed.notificationManager.close();
});
/*
ed.on('paste', function (e)
{
sax.debug('segment.paste');
let paste = (event.clipboardData || window.clipboardData).getData('text');
paste = paste.toUpperCase();
sax.debug(paste);
const selection = window.getSelection();
if (!selection.rangeCount) return false;
selection.deleteFromDocument();
selection.getRangeAt(0).insertNode(document.createTextNode(paste));
event.preventDefault();
});
*/
ed.on('blur', function (e)
{
let ed = tinymce.get(e.target.id);
@@ -315,6 +329,7 @@
});
},
plugins: [
'paste'
//'paste image'
//'link',
//'lists',
@@ -330,7 +345,7 @@
*/
toolbar: [
'undo redo | bold italic underline | fontselect fontsizeselect',
'forecolor backcolor | alignleft aligncenter alignright alignfull | numlist bullist outdent indent'
'forecolor backcolor | alignleft aligncenter alignright alignfull | numlist bullist outdent indent | pastetext'
],
valid_elements: 'p[style],strong,em,span[style],a[href],ul,ol,li',
valid_styles: { '*': 'font-size,font-family,color,background-color,text-decoration,text-align' },
@@ -417,7 +432,7 @@
//sax.debug('onDropArticleImageFile', file, context);
ac.segIdxAddImage = idx;
if (file.size > sax.maxProfileImageSize) return sax.doAlert(sax.dlg.title.imageUpload, sax.msg.uploadFileSizeMax.format(sax.formatFileSize(sax.maxProfileImageSize)));
if (file.type != 'image/jpg' && file.type != 'image/jpeg' && file.type != 'image/png') return sax.doAlert(sax.dlg.title.imageUpload, sax.msg.uploadFileTypeInvalid.format(sax.getFileType(file)));
if (sax.data.imageContentTypes.indexOf(file.type) < 0) return sax.doAlert(sax.dlg.title.imageUpload, sax.msg.uploadFileTypeInvalid.format(sax.getFileType(file)));
$(".UploadMessage", context).text(sax.msg.uploadingFile.format(file.name));
$('img.ArticleImageUploadProgress', context).fadeIn(200);
sax.clearControlError();
@@ -29,7 +29,7 @@
sax.onScorePassword = function (response)
{
var score = (response || {}).score || 0;
sax.$prgPasswordStrength.progressbar("option", "value", score).removeClass('amber green').addClass(score > 3 ? 'green' : score > 2 ? 'amber' : '');
sax.$prgPwordStrength.progressbar("option", "value", score).removeClass('amber green').addClass(score > 3 ? 'green' : score > 2 ? 'amber' : '');
}
//--------------------------------------------------------------
@@ -76,16 +76,17 @@
$('#ifEmailAddress,#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm').on('input', function () { sax.clearControlError(this); });
sax.$frm.signIn.on('keypress', '#ifEmailAddress,#ifPassword,#chkKeepMeSignedIn', function (e) { if (e.which == 13 && $('#ifEmailAddress', sax.$frm.signIn).val() && $('#ifPassword', sax.$frm.signIn).val()) sax.doSignin(); });
sax.$frm.signIn.on('click', '#pbSignIn', function () { sax.doSignin(); }).on('keypress', '#pbSignIn', function (e) { if (e.which == 13) sax.doSignin(); });
sax.$frm.changePassword = $('#frmChangePassword');
sax.$frm.changePassword.on('keypress', '#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm', function (e) { if (e.which == 13) sax.doChangePassword(); });
sax.$frm.changePassword.on('keyup', '#ifPassword', sax.doScorePassword);
sax.$prgPasswordStrength = $('#prgPasswordStrength', sax.$frm.changePassword).progressbar({ 'max': 5 });
sax.$frm.changePassword.on('click', '#pbChangePassword', function () { sax.doChangePassword(); }).on('keypress', '#pbChangePassword', function (e) { if (e.which == 13) sax.doChangePassword(); });
sax.$frm.chgPword = $('#frmChangePassword');
sax.$frm.chgPword.on('keypress', '#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm', function (e) { if (e.which == 13) sax.doChangePassword(); });
sax.$frm.chgPword.on('keyup', '#ifPassword', sax.doScorePassword);
sax.$prgPwordStrength = $('#prgPasswordStrength', sax.$frm.chgPword).progressbar({ 'max': 5 });
$('#pbChangePassword', sax.$frm.chgPword).on('click', function () { sax.doChangePassword(); }).on('keypress', function (e) { if (e.which == 13) sax.doChangePassword(); });
sax.$frm.reqPword = $('#frmRequestPassword');
sax.$frm.reqPword.on('keypress', '#ifEmailAddress', function (e) { if (e.which == 13) sax.doRequestPassword(); });
sax.$frm.reqPword.on('click', '#pbRequestPassword', function () { 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 */
@@ -48,6 +48,7 @@
if (!response || !response.success) return;
sax.data.genders = response.genders;
sax.data.months = response.months;
sax.data.imageContentTypes = response.imageContentTypes;
$('.sax-message', $pnl.proCon).stop(true, false).fadeOut(200).empty();
sax.refreshInput($pnl.proConFrm, 'AccountEmailAddress', response.contact.emailAddress);
sax.refreshSelect($pnl.proConFrm, 'AccountTitle', response.contact.title);
@@ -148,7 +149,7 @@
{
//sax.debug('onDropContactImageFile', file, context);
if (file.size > sax.maxProfileImageSize) return sax.doAlert(sax.dlg.title.imageUpload, sax.msg.uploadFileSizeMax.format(sax.formatFileSize(sax.maxProfileImageSize)));
if (file.type != 'image/jpg' && file.type != 'image/jpeg' && file.type != 'image/png') return sax.doAlert(sax.dlg.title.imageUpload, sax.msg.uploadFileTypeInvalid.format(sax.getFileType(file)));
if ((sax.data.imageContentTypes||[]).indexOf(file.type) < 0) return sax.doAlert(sax.dlg.title.imageUpload, sax.msg.uploadFileTypeInvalid.format(sax.getFileType(file)));
$(".UploadMessage", context).text(sax.msg.uploadingFile.format(file.name));
$('img.ContactImageUploadProgress', context).fadeIn(200);
sax.clearControlError($pnl.contactImageDrag);