Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Telerik #75

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions DotNetNuke.FAQs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@
<HintPath>packages\DotNetNuke.Web.9.4.0\lib\net45\DotNetNuke.Web.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="DotNetNuke.Web.Deprecated, Version=9.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\DotNetNuke.Web.Deprecated.9.4.0\lib\net45\DotNetNuke.Web.Deprecated.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="DotNetNuke.WebUtility, Version=4.2.1.783, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\DotNetNuke.Web.9.4.0\lib\net45\DotNetNuke.WebUtility.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -105,10 +101,6 @@
<Reference Include="System.Data" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="Telerik.Web.UI, Version=2013.2.717.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL">
<HintPath>packages\DotNetNuke.Web.Deprecated.9.4.0\lib\net45\Telerik.Web.UI.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
</ItemGroup>
<ItemGroup>
<Import Include="DotNetNuke" />
Expand Down
12 changes: 9 additions & 3 deletions EditFAQs.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<%@ Register TagPrefix="Portal" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.UI.WebControls" Assembly="DotNetNuke.Web" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.UI.WebControls" Assembly="DotNetNuke.Web.Deprecated" %>
<div class="dnnForm dnnEditFAQs dnnClear">
<div class="dnnFormItem">
<dnn:Label id="plQuestionField" runat="server" controlname="txtQuestionField">
Expand Down Expand Up @@ -32,12 +31,12 @@
</div>
<div class="dnnFormItem">
<dnn:Label ID="plPublishDate" runat="server" ControlName="datepickerPublishDate" />
<dnn:DnnDatePicker ID="datepickerPublishDate" runat="server" />&nbsp;
<asp:TextBox runat="server" ID="datepickerPublishDate"></asp:TextBox>&nbsp;
<asp:CompareValidator ID="valPublishDate" resourcekey="valPublishDate.ErrorMessage" Operator="DataTypeCheck" Type="Date" runat="server" Display="Dynamic" ControlToValidate="datepickerPublishDate" CssClass="dnnFormMessage dnnFormError" />
</div>
<div class="dnnFormItem">
<dnn:Label ID="plExpireDate" runat="server" ControlName="datepickerExpireDate" />
<dnn:DnnDatePicker ID="datepickerExpireDate" runat="server" />&nbsp;
<asp:TextBox runat="server" ID="datepickerExpireDate"></asp:TextBox>&nbsp;
<asp:CompareValidator ID="valExpireDate" resourcekey="valExpireDate.ErrorMessage" Operator="DataTypeCheck" Type="Date" runat="server" Display="Dynamic" ControlToValidate="datepickerExpireDate" CssClass="dnnFormMessage dnnFormError" />
<asp:CompareValidator ID="val2ExpireDate" resourcekey="val2ExpireDate.ErrorMessage" Operator="GreaterThanEqual" Type="Date" runat="server" Display="Dynamic" ControlToValidate="datepickerExpireDate" ControlToCompare="datepickerPublishDate" CssClass="dnnFormMessage dnnFormError" />
</div>
Expand All @@ -52,3 +51,10 @@
<Portal:Audit ID="ctlAudit" runat="server">
</Portal:Audit>
</div>

<script type="text/javascript">
$(function () {
new Pikaday({ field: document.getElementById('<%= datepickerPublishDate.ClientID %>'), format: 'M/D/YYYY' });
new Pikaday({ field: document.getElementById('<%= datepickerExpireDate.ClientID %>'), format: 'M/D/YYYY' });
})
</script>
42 changes: 23 additions & 19 deletions EditFAQs.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ private void PopulateCategoriesDropDown()
/// <param name="e">The <see cref="System.EventArgs" /> instance containing the event data.</param>
protected void Page_Load(System.Object sender, System.EventArgs e)
{
if (this.Page.ClientScript.IsClientScriptBlockRegistered("pikaday.min.js") == false)
{
this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Moment.js", "<script language=javascript src=\"https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js\"></script>");
this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "AjaxFaq.js", "<script language=javascript src=\"https://cdn.jsdelivr.net/npm/pikaday/pikaday.min.js\"></script>");
}
Comment on lines +102 to +106
Copy link
Member

Choose a reason for hiding this comment

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

This relies exclusivelly on cdns which could not work in some intranets with external internet access disabled

Copy link
Contributor

Choose a reason for hiding this comment

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

moment is deprecated. It is a pretty easy swap for dayjs. I am happy to help with that if desired. I can also help with converting this away from CDN. Since this is not a frontend project, I guess we would use local versions of the libraries (like we do in DNN)?


if (Page.IsPostBack == false)
{

cmdDelete.Attributes.Add("onClick", "javascript:return confirm(\'" + Localization.GetString("DeleteItem") + "\');");

FAQsController FAQsController = new FAQsController();
Expand All @@ -123,8 +127,8 @@ protected void Page_Load(System.Object sender, System.EventArgs e)
}

chkFaqHide.Checked = FaqItem.FaqHide;
datepickerPublishDate.SelectedDate = FaqItem.PublishDate;
datepickerExpireDate.SelectedDate = FaqItem.ExpireDate;
datepickerPublishDate.Text = FaqItem.PublishDate.ToString();
datepickerExpireDate.Text = FaqItem.ExpireDate.ToString();
teAnswerField.Text = FaqItem.Answer;
txtQuestionField.Text = FaqItem.Question;
UserInfo user = UserController.GetUserById(PortalId, Convert.ToInt32(FaqItem.CreatedByUser));
Expand Down Expand Up @@ -182,8 +186,8 @@ protected void cmdUpdate_Click(System.Object sender, System.EventArgs e)
faq = faqsController.GetFAQ(FaqId);
faq.CategoryId = newCatID;
faq.FaqHide = chkFaqHide.Checked;
faq.PublishDate = datepickerPublishDate.SelectedDate;
faq.ExpireDate = datepickerExpireDate.SelectedDate;
faq.PublishDate = !string.IsNullOrEmpty(datepickerPublishDate.Text) ? Convert.ToDateTime(datepickerPublishDate.Text) : (DateTime?)null;
faq.ExpireDate = !string.IsNullOrEmpty(datepickerExpireDate.Text) ? Convert.ToDateTime(datepickerExpireDate.Text) : (DateTime?)null;
faq.Question = question;
faq.Answer = answer;
faq.DateModified = DateTime.Now;
Expand All @@ -192,20 +196,20 @@ protected void cmdUpdate_Click(System.Object sender, System.EventArgs e)
else
{
faq = new FAQsInfo
{
ItemID = FaqId,
CategoryId = newCatID,
FaqHide = chkFaqHide.Checked,
PublishDate = datepickerPublishDate.SelectedDate,
ExpireDate = datepickerExpireDate.SelectedDate,
Question = question,
Answer = answer,
CreatedByUser = UserId.ToString(),
ViewCount = 0,
DateModified = DateTime.Now,
ModuleID = ModuleId,
CreatedDate = DateTime.Now
};
{
ItemID = FaqId,
CategoryId = newCatID,
FaqHide = chkFaqHide.Checked,
PublishDate = !string.IsNullOrEmpty(datepickerPublishDate.Text) ? Convert.ToDateTime(datepickerPublishDate.Text) : (DateTime?)null,
ExpireDate = !string.IsNullOrEmpty(datepickerExpireDate.Text) ? Convert.ToDateTime(datepickerExpireDate.Text) : (DateTime?)null,
Question = question,
Answer = answer,
CreatedByUser = UserId.ToString(),
ViewCount = 0,
DateModified = DateTime.Now,
ModuleID = ModuleId,
CreatedDate = DateTime.Now
};
faqsController.AddFAQ(faq);
}
Response.Redirect(Globals.NavigateURL(), true);
Expand Down
48 changes: 25 additions & 23 deletions EditFAQs.ascx.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 1 addition & 17 deletions FAQs.ascx
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
<%@ Control Language="C#" Inherits="DotNetNuke.Modules.FAQs.FAQs" AutoEventWireup="True" CodeBehind="FAQs.ascx.cs" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.UI.WebControls" Assembly="DotNetNuke.Web" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.UI.WebControls" Assembly="DotNetNuke.Web.Deprecated" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<div class="dnnForm dnnFAQs dnnClear">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="width: 1px; vertical-align: top;">
<asp:Panel ID="pnlShowCategories" runat="server" Visible="false">
<asp:MultiView ID="mvShowCategoryType" runat="server" ActiveViewIndex="0">
<asp:View ID="vShowCategoryTypeList" runat="server">
<div class="categoryList">
<dnn:DnnListBox runat="server" ID="listCategories" CssClass="categoryListControl" OnItemDataBound="listCategories_ItemDataBound">
<itemtemplate>
<asp:CheckBox ID="chkCategory" runat="server" Text='<%# Eval("FaqCategoryName") %>' OnCheckedChanged="chkCategory_CheckedChanged" AutoPostBack="true" />
</itemtemplate>
</dnn:DnnListBox>
</div>
</asp:View>
Comment on lines -12 to -20
Copy link
Member

Choose a reason for hiding this comment

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

This removes a feature from the module

<asp:View ID="vShowCategoryTypeTree" runat="server">
<div class="categoryTree" style="margin-right: 20px;">
<dnn:DnnTreeView ID="treeCategories" runat="server" CssClass="categoryTreeControl"
ShowLineImages="False" OnNodeClick="treeCategories_NodeClick" OnNodeDataBound="treeCategories_NodeDataBound">
<databindings>
<telerik:RadTreeNodeBinding Expanded="true" />
</databindings>
</dnn:DnnTreeView>
<asp:TreeView runat="server" ID="treeCategories" OnSelectedNodeChanged="treeCategories_SelectedNodeChanged"></asp:TreeView>
</div>
</asp:View>
</asp:MultiView>
Expand Down
Loading