From f7d2105aa17217c8dd60d136f86ec57338945032 Mon Sep 17 00:00:00 2001 From: rxtur Date: Sun, 13 Mar 2016 16:09:47 -0500 Subject: [PATCH 001/141] Some fixes, mostly in BlogRoll widget (3.2.1.5) --- .../Properties/AssemblyInfo.cs | 2 +- .../Providers/CacheProvider/CacheBase.cs | 5 ++++ .../Providers/CacheProvider/CacheProvider.cs | 24 +++++++++++++++++ .../Providers/XmlProvider/BlogRoll.cs | 6 ++++- .../AppCode/Api/SettingsController.cs | 4 +++ .../App_GlobalResources/labels.ru.resx | 4 +-- .../Custom/Widgets/BlogRoll/BlogRoll.cs | 9 ++++--- .../Custom/Widgets/BlogRoll/edit.cshtml | 27 ++++++++++--------- .../Custom/Widgets/LinkList/edit.cshtml | 2 +- .../Custom/Widgets/LinkList/widget.cshtml | 2 +- .../app/custom/widgets/widgetController.js | 4 +-- .../admin/app/settings/advancedView.html | 4 +++ .../admin/app/settings/settingController.js | 13 +++++++++ 13 files changed, 83 insertions(+), 23 deletions(-) diff --git a/BlogEngine/BlogEngine.Core/Properties/AssemblyInfo.cs b/BlogEngine/BlogEngine.Core/Properties/AssemblyInfo.cs index 60a2173a2..eb84c7302 100644 --- a/BlogEngine/BlogEngine.Core/Properties/AssemblyInfo.cs +++ b/BlogEngine/BlogEngine.Core/Properties/AssemblyInfo.cs @@ -19,5 +19,5 @@ [assembly: CLSCompliant(false)] [assembly: ComVisible(false)] [assembly: AllowPartiallyTrustedCallers] -[assembly: AssemblyVersion("3.2.1.4")] +[assembly: AssemblyVersion("3.2.1.5")] [assembly: SecurityRules(SecurityRuleSet.Level1)] diff --git a/BlogEngine/BlogEngine.Core/Providers/CacheProvider/CacheBase.cs b/BlogEngine/BlogEngine.Core/Providers/CacheProvider/CacheBase.cs index e36f83570..566352cad 100644 --- a/BlogEngine/BlogEngine.Core/Providers/CacheProvider/CacheBase.cs +++ b/BlogEngine/BlogEngine.Core/Providers/CacheProvider/CacheBase.cs @@ -79,6 +79,11 @@ public abstract class CacheBase : IEnumerable /// public abstract object Remove(string key); + /// + /// Reset cache provider + /// + public abstract void Reset(); + IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); diff --git a/BlogEngine/BlogEngine.Core/Providers/CacheProvider/CacheProvider.cs b/BlogEngine/BlogEngine.Core/Providers/CacheProvider/CacheProvider.cs index 80f41aa6b..3edd2abec 100644 --- a/BlogEngine/BlogEngine.Core/Providers/CacheProvider/CacheProvider.cs +++ b/BlogEngine/BlogEngine.Core/Providers/CacheProvider/CacheProvider.cs @@ -154,5 +154,29 @@ public override object Remove(string key) { return _cache.Remove(_keyPrefix + key); } + + /// + /// Reset cache provider + /// + public override void Reset() + { + var keys = new System.Collections.Specialized.StringCollection(); + foreach (var item in _cache) + { + var x = (DictionaryEntry)item; + keys.Add(x.Key.ToString()); + } + if (keys.Count > 0) + { + foreach (var key in keys) + { + if (key.StartsWith(_keyPrefix)) + { + // Utils.Log(key); + _cache.Remove(key); + } + } + } + } } } diff --git a/BlogEngine/BlogEngine.Core/Providers/XmlProvider/BlogRoll.cs b/BlogEngine/BlogEngine.Core/Providers/XmlProvider/BlogRoll.cs index 68feebf02..7c1493b78 100644 --- a/BlogEngine/BlogEngine.Core/Providers/XmlProvider/BlogRoll.cs +++ b/BlogEngine/BlogEngine.Core/Providers/XmlProvider/BlogRoll.cs @@ -101,9 +101,13 @@ public override List FillBlogRoll() public override void InsertBlogRollItem(BlogRollItem blogRollItem) { var blogRolls = BlogRollItem.BlogRolls; + if(blogRolls == null) + { + blogRolls = new List(); + } blogRolls.Add(blogRollItem); - this.WriteBlogRollFile(blogRolls); + WriteBlogRollFile(blogRolls); } /// diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/SettingsController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/SettingsController.cs index 6e72115d0..f0d733a80 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/SettingsController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/SettingsController.cs @@ -38,6 +38,10 @@ public HttpResponseMessage Put([FromBody]Settings settings, string action = "") return Request.CreateResponse(HttpStatusCode.OK, retMsg); } } + else if(action == "clearCache") + { + BlogEngine.Core.Blog.CurrentInstance.Cache.Reset(); + } else { repository.Update(settings); diff --git a/BlogEngine/BlogEngine.NET/App_GlobalResources/labels.ru.resx b/BlogEngine/BlogEngine.NET/App_GlobalResources/labels.ru.resx index 2515ad442..3c0c88b72 100644 --- a/BlogEngine/BlogEngine.NET/App_GlobalResources/labels.ru.resx +++ b/BlogEngine/BlogEngine.NET/App_GlobalResources/labels.ru.resx @@ -1607,10 +1607,10 @@ Разрешить - Все запили + Все записи - Все запили отмеченные как + Все записи отмеченные как Пожалуйста выберите другой email адрес diff --git a/BlogEngine/BlogEngine.NET/Custom/Widgets/BlogRoll/BlogRoll.cs b/BlogEngine/BlogEngine.NET/Custom/Widgets/BlogRoll/BlogRoll.cs index 9fe635235..86780f4d5 100644 --- a/BlogEngine/BlogEngine.NET/Custom/Widgets/BlogRoll/BlogRoll.cs +++ b/BlogEngine/BlogEngine.NET/Custom/Widgets/BlogRoll/BlogRoll.cs @@ -128,11 +128,14 @@ public void Add(NameValueCollection form) br.Xfn = GetXfnString(form); int largestSortIndex = -1; - foreach (BlogRollItem brExisting in BlogRollItem.BlogRolls) + if(BlogRollItem.BlogRolls != null && BlogRollItem.BlogRolls.Count > 0) { - if (brExisting.SortIndex > largestSortIndex) + foreach (BlogRollItem brExisting in BlogRollItem.BlogRolls) { - largestSortIndex = brExisting.SortIndex; + if (brExisting.SortIndex > largestSortIndex) + { + largestSortIndex = brExisting.SortIndex; + } } } br.SortIndex = largestSortIndex + 1; diff --git a/BlogEngine/BlogEngine.NET/Custom/Widgets/BlogRoll/edit.cshtml b/BlogEngine/BlogEngine.NET/Custom/Widgets/BlogRoll/edit.cshtml index e66e39163..609671c6b 100644 --- a/BlogEngine/BlogEngine.NET/Custom/Widgets/BlogRoll/edit.cshtml +++ b/BlogEngine/BlogEngine.NET/Custom/Widgets/BlogRoll/edit.cshtml @@ -173,22 +173,25 @@ XFN - - @foreach (var roll in rolls) - { - - - @roll.Title - - - @roll.Description - @roll.Xfn - - } + @if (rolls == null || rolls.Count == 0) { @Resources.labels.empty } + else + { + foreach (var roll in rolls) + { + + + @roll.Title + + + @roll.Description + @roll.Xfn + + } + } diff --git a/BlogEngine/BlogEngine.NET/Custom/Widgets/LinkList/edit.cshtml b/BlogEngine/BlogEngine.NET/Custom/Widgets/LinkList/edit.cshtml index 8236c3506..6c3467153 100644 --- a/BlogEngine/BlogEngine.NET/Custom/Widgets/LinkList/edit.cshtml +++ b/BlogEngine/BlogEngine.NET/Custom/Widgets/LinkList/edit.cshtml @@ -10,7 +10,7 @@ var hdnId = ""; var widgetId = Request.QueryString["id"]; - var updateLink = BlogEngine.Core.Utils.RelativeOrAbsoluteWebRoot + + var updateLink = BlogEngine.Core.Utils.RelativeWebRoot + "Custom/Widgets/LinkList/edit.cshtml?id=" + widgetId; var settings = Common.GetSettings(widgetId); var linkList = new LinkList(widgetId); diff --git a/BlogEngine/BlogEngine.NET/Custom/Widgets/LinkList/widget.cshtml b/BlogEngine/BlogEngine.NET/Custom/Widgets/LinkList/widget.cshtml index 42bd4bfa4..d5c738c55 100644 --- a/BlogEngine/BlogEngine.NET/Custom/Widgets/LinkList/widget.cshtml +++ b/BlogEngine/BlogEngine.NET/Custom/Widgets/LinkList/widget.cshtml @@ -6,7 +6,7 @@ diff --git a/BlogEngine/BlogEngine.NET/admin/app/settings/settingController.js b/BlogEngine/BlogEngine.NET/admin/app/settings/settingController.js index 2ee198ef1..3f659c93d 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/settings/settingController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/settings/settingController.js @@ -105,6 +105,19 @@ .error(function () { toastr.error($rootScope.lbl.failed); }); } + $scope.clearCache = function () { + dataService.updateItem("/api/settings?action=clearCache", $scope.settings) + .success(function (data) { + if (data) { + toastr.error(data); + } + else { + toastr.success($rootScope.lbl.completed); + } + }) + .error(function () { toastr.error($rootScope.lbl.failed); }); + } + $scope.loadTheme = function () { var theme = $("#selDesktopTheme option:selected").text(); window.location.assign("#/shared/package?id=" + theme); From d37be24ab87096173d2018ebdadc24e8560d4f53 Mon Sep 17 00:00:00 2001 From: Farzin Seyfolahi Date: Mon, 14 Mar 2016 18:37:37 -0700 Subject: [PATCH 002/141] Toggle arrow in sidebar removed and toolbar is open by default and Widgets improved. --- .../admin/app/custom/widgets/widgetView.html | 207 ++++++++---------- .../admin/themes/standard/css/styles.css | 2 +- .../admin/themes/standard/css/styles.css.map | 4 +- .../themes/standard/sass/layout/_header.scss | 16 +- .../themes/standard/sass/layout/_sidebar.scss | 25 --- .../standard/sass/pages/custom/_widgets.scss | 71 ++++++ .../admin/themes/standard/sass/styles.scss | 5 +- .../admin/themes/standard/sidebar.cshtml | 3 +- 8 files changed, 181 insertions(+), 152 deletions(-) create mode 100644 BlogEngine/BlogEngine.NET/admin/themes/standard/sass/pages/custom/_widgets.scss diff --git a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html index c76dac93e..fbb6346a1 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html +++ b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html @@ -1,151 +1,134 @@ -
- +
+

{{lbl.widgets}}

- +
- -
public bool ShowTitle { get; set; } + /// + /// Show uninstall widget button if was installed from gallery + /// + public bool ShowUnistall { get; set; } } } diff --git a/BlogEngine/BlogEngine.Core/Properties/AssemblyInfo.cs b/BlogEngine/BlogEngine.Core/Properties/AssemblyInfo.cs index 069f71f5e..092644e94 100644 --- a/BlogEngine/BlogEngine.Core/Properties/AssemblyInfo.cs +++ b/BlogEngine/BlogEngine.Core/Properties/AssemblyInfo.cs @@ -19,5 +19,5 @@ [assembly: CLSCompliant(false)] [assembly: ComVisible(false)] [assembly: AllowPartiallyTrustedCallers] -[assembly: AssemblyVersion("3.2.2.0")] +[assembly: AssemblyVersion("3.2.2.1")] [assembly: SecurityRules(SecurityRuleSet.Level1)] diff --git a/BlogEngine/BlogEngine.Core/Web/BlogCulture.cs b/BlogEngine/BlogEngine.Core/Web/BlogCulture.cs index c0e2fbb75..79555c0a5 100644 --- a/BlogEngine/BlogEngine.Core/Web/BlogCulture.cs +++ b/BlogEngine/BlogEngine.Core/Web/BlogCulture.cs @@ -497,6 +497,7 @@ void AddJavaScriptResources() AddResource("incorrectSimpleCaptcha"); AddResource("indent"); AddResource("industry"); + AddResource("information"); AddResource("insertImage"); AddResource("insertVideo"); AddResource("install"); diff --git a/BlogEngine/BlogEngine.NET/App_Data/datastore/widgets/be_WIDGET_ZONE.xml b/BlogEngine/BlogEngine.NET/App_Data/datastore/widgets/be_WIDGET_ZONE.xml index 72981ebb8..01f7f9b5b 100644 --- a/BlogEngine/BlogEngine.NET/App_Data/datastore/widgets/be_WIDGET_ZONE.xml +++ b/BlogEngine/BlogEngine.NET/App_Data/datastore/widgets/be_WIDGET_ZONE.xml @@ -7,6 +7,6 @@ PostList Newsletter CommentList - LinkList MonthList + TwitterTimeline \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/App_Data/packagefiles.xml b/BlogEngine/BlogEngine.NET/App_Data/packagefiles.xml index c47afcfa8..b7e353dfa 100644 --- a/BlogEngine/BlogEngine.NET/App_Data/packagefiles.xml +++ b/BlogEngine/BlogEngine.NET/App_Data/packagefiles.xml @@ -1,3 +1,7 @@  + + + + \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/App_Data/packages.xml b/BlogEngine/BlogEngine.NET/App_Data/packages.xml index 3b8e67f8d..57343fc76 100644 --- a/BlogEngine/BlogEngine.NET/App_Data/packages.xml +++ b/BlogEngine/BlogEngine.NET/App_Data/packages.xml @@ -1,3 +1,4 @@  + \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj b/BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj index 56f320b80..b9fdf837c 100644 --- a/BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj +++ b/BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj @@ -585,19 +585,33 @@ + + + + + + + + + + + + + + diff --git a/BlogEngine/BlogEngine.NET/Custom/Widgets/TwitterTimeline/edit.cshtml b/BlogEngine/BlogEngine.NET/Custom/Widgets/TwitterTimeline/edit.cshtml new file mode 100644 index 000000000..3498adc0e --- /dev/null +++ b/BlogEngine/BlogEngine.NET/Custom/Widgets/TwitterTimeline/edit.cshtml @@ -0,0 +1,53 @@ +@using BlogEngine.NET.Custom.Widgets +@{ + var appId = "717752735521636352"; + var twitId = "blogenginenet"; + + var widgetId = Request.QueryString["id"]; + var settings = Common.GetSettings(widgetId); + + Validation.Add("txtAppId", Validator.Required("Field is required")); + Validation.Add("txtTwitId", Validator.Required("Field is required")); + + if (IsPost) + { + if (Validation.IsValid()) + { + settings["appId"] = Request.Form["txtAppId"]; + settings["twitId"] = Request.Form["txtTwitId"]; + + Common.SaveSettings(settings, widgetId); + @: + } + } + if (settings != null && settings.Count > 0) + { + appId = settings["appId"]; + twitId = settings["twitId"]; + } +} + + + + + + + + +
+
+
+ + + @Html.ValidationMessage("txtAppId") +
+
+ + + @Html.ValidationMessage("txtTwitId") +
+ +
+
+ + \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/Custom/Widgets/TwitterTimeline/widget.cshtml b/BlogEngine/BlogEngine.NET/Custom/Widgets/TwitterTimeline/widget.cshtml new file mode 100644 index 000000000..086e7c38f --- /dev/null +++ b/BlogEngine/BlogEngine.NET/Custom/Widgets/TwitterTimeline/widget.cshtml @@ -0,0 +1,28 @@ +@using BlogEngine.NET.Custom.Widgets +@{ + var settings = Common.GetSettings(Model.Id); + var TwitId = "blogenginenet"; + var AppId = "717752735521636352"; + if (settings != null && settings.Count > 0) + { + TwitId = HttpUtility.HtmlDecode(settings["TwitId"]); + AppId = HttpUtility.HtmlDecode(settings["AppId"]); + } +} +
+ @if (!string.IsNullOrEmpty(TwitId)) + { + + + } +
\ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/Custom/Widgets/TwitterTimeline/widget.xml b/BlogEngine/BlogEngine.NET/Custom/Widgets/TwitterTimeline/widget.xml new file mode 100644 index 000000000..2feff635a --- /dev/null +++ b/BlogEngine/BlogEngine.NET/Custom/Widgets/TwitterTimeline/widget.xml @@ -0,0 +1,9 @@ + + + TwitterTimeline + Twitter Timeline widget for BlogEngine.NET 3.3 and above + BlogEngine.NET + + 3.3.0.0 + http://dnbe.net/v01/images/TwitterTimeline.png + \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetController.js b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetController.js index 79a8c48a3..0edd90798 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetController.js @@ -193,6 +193,19 @@ }); } + $scope.uninstallPackage = function (pkgId) { + spinOn(); + dataService.updateItem("/api/packages/uninstall/" + pkgId, pkgId) + .success(function (data) { + toastr.success($rootScope.lbl.completed); + $scope.load(); + }) + .error(function () { + toastr.error($rootScope.lbl.failed); + spinOff(); + }); + } + $scope.load(); $(document).ready(function () { diff --git a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetGalleryController.js b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetGalleryController.js index 9283609bd..f17d21931 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetGalleryController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetGalleryController.js @@ -100,6 +100,13 @@ $scope.selectedRating = rating; } + $scope.checkStar = function (item, rating) { + if (item === rating) { + return true; + } + return false; + } + $scope.load(); $(document).ready(function () { diff --git a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html index d1e001d6c..86c40548f 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html +++ b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html @@ -96,20 +96,22 @@

{{lbl.widgets}}

-
+

Available Widgets

  • {{ iw.Title }} -
    -
-
+

Widget Zone ({{widgetZones.titles[0]}})

From 804c37b322e44a838a3c8b4bf9985cd1dd66231c Mon Sep 17 00:00:00 2001 From: rxtur Date: Mon, 11 Apr 2016 13:01:18 -0500 Subject: [PATCH 022/141] Missed file. --- .../BlogEngine.NET/admin/app/custom/widgets/widgetView.html | 1 + 1 file changed, 1 insertion(+) diff --git a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html index 86c40548f..81bed76f7 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html +++ b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html @@ -105,6 +105,7 @@

Available Widgets

+
From a8a45e4a4d3df8c8c507094187cb499b236c05e3 Mon Sep 17 00:00:00 2001 From: geonewlitho Date: Thu, 14 Apr 2016 17:23:14 +1000 Subject: [PATCH 023/141] fix for #53 Contact form js is now working again --- BlogEngine/BlogEngine.NET/Scripts/contact.js | 116 +++++++++---------- BlogEngine/BlogEngine.NET/contact.aspx | 96 +++++++-------- 2 files changed, 106 insertions(+), 106 deletions(-) diff --git a/BlogEngine/BlogEngine.NET/Scripts/contact.js b/BlogEngine/BlogEngine.NET/Scripts/contact.js index 518171a64..03634fc92 100644 --- a/BlogEngine/BlogEngine.NET/Scripts/contact.js +++ b/BlogEngine/BlogEngine.NET/Scripts/contact.js @@ -1,59 +1,59 @@ -function beginSendMessage() { - if (BlogEngine.$('<%=txtAttachment.ClientID %>') && BlogEngine.$('<%=txtAttachment.ClientID %>').value.length > 0) - return true; - - if (!Page_ClientValidate('contact')) - return false; - - var recaptchaResponseField = document.getElementById('recaptcha_response_field'); - var recaptchaResponse = recaptchaResponseField ? recaptchaResponseField.value : ""; - - var recaptchaChallengeField = document.getElementById('recaptcha_challenge_field'); - var recaptchaChallenge = recaptchaChallengeField ? recaptchaChallengeField.value : ""; - - var name = BlogEngine.$('<%=txtName.ClientID %>').value; - var email = BlogEngine.$('<%=txtEmail.ClientID %>').value; - var subject = BlogEngine.$('<%=txtSubject.ClientID %>').value; - var message = BlogEngine.$('<%=txtMessage.ClientID %>').value; - var sep = '-||-'; - var arg = name + sep + email + sep + subject + sep + message + sep + recaptchaResponse + sep + recaptchaChallenge; - WebForm_DoCallback('__Page', arg, endSendMessage, 'contact', onSendError, false) - - BlogEngine.$('<%=btnSend.ClientID %>').disabled = true; - - return false; -} - -function endSendMessage(arg, context) { - - if (arg == "RecaptchaIncorrect") { - displayIncorrectCaptchaMessage(); - BlogEngine.$('<%=btnSend.ClientID %>').disabled = false; - - if (document.getElementById('recaptcha_response_field')) { - Recaptcha.reload(); - } - } - else { - if (document.getElementById("spnCaptchaIncorrect")) document.getElementById("spnCaptchaIncorrect").style.display = "none"; - - BlogEngine.$('<%=btnSend.ClientID %>').disabled = false; - var form = BlogEngine.$('<%=divForm.ClientID %>') - var thanks = BlogEngine.$('thanks'); - - form.style.display = 'none'; - thanks.innerHTML = arg; - } -} - -function displayIncorrectCaptchaMessage() { - if (document.getElementById("spnCaptchaIncorrect")) document.getElementById("spnCaptchaIncorrect").style.display = ""; -} - -function onSendError(err, context) { - if (document.getElementById('recaptcha_response_field')) { - Recaptcha.reload(); - } - BlogEngine.$('<%=btnSend.ClientID %>').disabled = false; - alert("Sorry, but the following occurred while attemping to send your message: " + err); +function beginSendMessage() { + if ($('[data-id="txtAttachment"]').length > 0 && $('[data-id="txtAttachment"]').val().length > 0) + return true; + + if (!Page_ClientValidate('contact')) + return false; + + var recaptchaResponseField = $('#recaptcha_response_field'); + var recaptchaResponse = recaptchaResponseField.length > 0 ? recaptchaResponseField.val() : ""; + + var recaptchaChallengeField = $('#recaptcha_challenge_field'); + var recaptchaChallenge = recaptchaChallengeField.length > 0 ? recaptchaChallengeField.val() : ""; + + var name = $('[data-id="txtName"]').val(); + var email = $('[data-id="txtEmail"]').val(); + var subject = $('[data-id="txtSubject"]').val(); + var message = $('[data-id="txtMessage"]').val(); + var sep = '-||-'; + var arg = name + sep + email + sep + subject + sep + message + sep + recaptchaResponse + sep + recaptchaChallenge; + WebForm_DoCallback('__Page', arg, endSendMessage, 'contact', onSendError, false) + + $('[data-id="btnSend"]').attr("disabled", true); + + return false; +} + +function endSendMessage(arg, context) { + + if (arg == "RecaptchaIncorrect") { + displayIncorrectCaptchaMessage(); + $('[data-id="btnSend"]').attr("disabled", ""); + + if ($('#recaptcha_response_field').length > 0) { + Recaptcha.reload(); + } + } + else { + if ($("#spnCaptchaIncorrect")) $("#spnCaptchaIncorrect").css("display", "none"); + + $('[data-id="btnSend').attr("disabled", ""); + var form = $('[data-id="divForm'); + var thanks = $('#thanks'); + + form.css("display", "none"); + thanks.html(arg); + } +} + +function displayIncorrectCaptchaMessage() { + if ($("#spnCaptchaIncorrect")) $("#spnCaptchaIncorrect").css("display", "none"); +} + +function onSendError(err, context) { + if ($('#recaptcha_response_field')) { + Recaptcha.reload(); + } + $('[data-id="btnSend"]').css("display", "none"); + alert("Sorry, but the following occurred while attemping to send your message: " + err); } \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/contact.aspx b/BlogEngine/BlogEngine.NET/contact.aspx index 464ef2f97..96ea8a684 100644 --- a/BlogEngine/BlogEngine.NET/contact.aspx +++ b/BlogEngine/BlogEngine.NET/contact.aspx @@ -1,49 +1,49 @@ -<%@ Page Language="C#" AutoEventWireup="true" Inherits="contact" ValidateRequest="false" Codebehind="contact.aspx.cs" %> -<%@ Import Namespace="BlogEngine.Core" %> - - -
-
-

<%=Resources.labels.contact %>

-
<%=BlogSettings.Instance.ContactFormMessage %>
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - - -
- - -
- - <%=BlogSettings.Instance.ContactErrorMessage %>. -
-
-
-
-
<%=BlogSettings.Instance.ContactThankMessage %>
-
-
-
- +<%@ Page Language="C#" AutoEventWireup="true" Inherits="contact" ValidateRequest="false" Codebehind="contact.aspx.cs" %> +<%@ Import Namespace="BlogEngine.Core" %> + + +
+
+

<%=Resources.labels.contact %>

+
<%=BlogSettings.Instance.ContactFormMessage %>
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + + +
+ + +
+ + <%=BlogSettings.Instance.ContactErrorMessage %>. +
+
+
+
+
<%=BlogSettings.Instance.ContactThankMessage %>
+
+
+
+
\ No newline at end of file From 720c28ee5e3165a494566865f4efd01cfa5a53c1 Mon Sep 17 00:00:00 2001 From: Farzin Seyfolahi Date: Sat, 16 Apr 2016 20:26:35 +0430 Subject: [PATCH 024/141] improve some style in the Widgets. --- .../admin/app/custom/widgets/widgetView.html | 169 +++++++++--------- .../admin/themes/standard/css/styles.css | 2 +- .../admin/themes/standard/css/styles.css.map | 2 +- .../standard/scss/pages/custom/_widgets.scss | 85 +++++++++ 4 files changed, 168 insertions(+), 90 deletions(-) diff --git a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html index 81bed76f7..0c88775b9 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html +++ b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html @@ -4,17 +4,14 @@