Skip to content

Commit

Permalink
ABS4: Summernote is now the primary HTML editor
Browse files Browse the repository at this point in the history
  • Loading branch information
muratcakir committed Feb 24, 2018
1 parent b2ac077 commit 31c83c6
Show file tree
Hide file tree
Showing 24 changed files with 300 additions and 227 deletions.
8 changes: 4 additions & 4 deletions CREDITS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ Copyright: Copyright Andrey Taritsyn 2014
License: Apache License 2.0 (Apache)


CKEditor
summernote
---------------------------------------------
WebSite: http://ckeditor.com/
Copyright: &copy 2014 CKSource - Frederico Knabben
License: GNU Library General Public License (LGPL)
WebSite: https://summernote.org/
Copyright: Copyright (c) 2015~ Summernote Team (https://github.com/orgs/summernote/people)
License: MIT


DotNetOpenAuth
Expand Down
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Release Notes
# Release Notes

## SmartStore.NET 3.1.0
### Breaking changes
Expand All @@ -22,6 +22,7 @@

### New Features
* 1203 MegaMenu shrinker and *Brands* virtual menu item
* [Summernote](https://summernote.org/) is now the primary HTML editor
* #431 Added option to randomize the display order for slides on each request
* #1258 Add option to filter shipping and payment methods by a specific customer role
* #1247 Allow to import non system customer roles in customer import
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ public AdminAreaSettings()
{
GridPageSize = 25;
DisplayProductPictures = true;
RichEditorFlavor = "RichEditor";
}

public int GridPageSize { get; set; }

public bool DisplayProductPictures { get; set; }

public string RichEditorFlavor { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text;
using System;
using System.Text;
using System.Web.Mvc;
using System.Web.WebPages;
using SmartStore.Core.Domain.Common;
Expand Down Expand Up @@ -96,9 +97,10 @@ public static HelperResult LabeledCurrencyName<T>(this HtmlHelper<T> helper, int
return new HelperResult(writer => writer.Write(sb.ToString()));
}

[Obsolete]
public static string RichEditorFlavor(this HtmlHelper helper)
{
return EngineContext.Current.Resolve<AdminAreaSettings>().RichEditorFlavor.NullEmpty() ?? "RichEditor";
return "Html";
}

public static GridEditActionCommandBuilder Localize(this GridEditActionCommandBuilder builder, Localizer T)
Expand Down
28 changes: 28 additions & 0 deletions src/Presentation/SmartStore.Web/Administration/Content/_admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,21 @@ table.payment-method-features td {
box-shadow: none;
}

.note-editor-preview {
border: 1px solid $input-border-color;
min-height: 100px;
max-height: 350px;
overflow-x: hidden;
overflow-y: auto;
padding: $input-padding-y $input-padding-x;
cursor: default;

&.empty {
min-height: initial;
//color: $text-muted;
}
}

.note-editor {
border-color: $input-border-color !important;
border-radius: $input-border-radius !important;
Expand Down Expand Up @@ -1400,7 +1415,20 @@ table.payment-method-features td {
}

.note-para > .btn-group:last-child .dropdown-menu.show {
// Fix: the para popover button groups should not wrap
display: flex !important;
}

.dropdown-style > .dropdown-item > * {
// Fix: Summernote does not remove the BS4 bottom margin of para style dropdown items
margin-bottom: 0;
}

.note-color + .btn-group > .btn {
// Fix: the fontsize button width should not change (toolbar flickers)
padding-left: 0.5rem;
padding-right: 0.5rem;
min-width: 50px;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,7 @@
<Content Include="Views\Common\GenericAttributes.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Shared\EditorTemplates\RichEditor.SummerNote.cshtml" />
<Content Include="Views\Shared\EditorTemplates\Html.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Product\EditorTemplates\AttributeControlType.cshtml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
@Html.SmartLabelFor(model => model.Body)
</td>
<td class="adminData wide">
@Html.EditorFor(x => x.Body, Html.RichEditorFlavor())
@Html.EditorFor(x => x.Body, "Html")
@Html.ValidationMessageFor(model => model.Body)
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
@Html.SmartLabelFor(model => model.Body)
</td>
<td class="adminData wide">
@Html.EditorFor(model => model.Body, "RichEditor")
@Html.EditorFor(model => model.Body, "Html", new { lazy = false })
@Html.ValidationMessageFor(model => model.Body)
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
@Html.SmartLabelFor(model => model.Locales[item].Description)
</td>
<td class="adminData wide">
@Html.EditorFor(model => model.Locales[item].Description, Html.RichEditorFlavor())
@Html.EditorFor(model => model.Locales[item].Description, "Html")
@Html.ValidationMessageFor(model => model.Locales[item].Description)
</td>
</tr>
Expand All @@ -72,7 +72,7 @@
@Html.SmartLabelFor(model => model.Locales[item].BottomDescription)
</td>
<td class="adminData wide">
@Html.EditorFor(model => model.Locales[item].BottomDescription, Html.RichEditorFlavor())
@Html.EditorFor(model => model.Locales[item].BottomDescription, "Html")
@Html.ValidationMessageFor(model => model.Locales[item].BottomDescription)
</td>
</tr>
Expand Down Expand Up @@ -121,7 +121,7 @@
@Html.SmartLabelFor(model => model.Description)
</td>
<td class="adminData wide">
@Html.EditorFor(x => x.Description, Html.RichEditorFlavor())
@Html.EditorFor(x => x.Description, "Html")
@Html.ValidationMessageFor(model => model.Description)
</td>
</tr>
Expand All @@ -130,7 +130,7 @@
@Html.SmartLabelFor(model => model.BottomDescription)
</td>
<td class="adminData wide">
@Html.EditorFor(x => x.BottomDescription, Html.RichEditorFlavor())
@Html.EditorFor(x => x.BottomDescription, "Html")
@Html.ValidationMessageFor(model => model.BottomDescription)
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@
</li>
<li>
<div class="name">
<a href="http://ckeditor.com/" rel="nofollow" target="AboutTargetWin">CKEditor</a>
<a href="https://summernote.org/" rel="nofollow" target="AboutTargetWin">summernote</a>
</div>
<div class="copyright">
&copy 2018 CKSource - Frederico Knabben
&copy 2015~ Summernote Team (https://github.com/orgs/summernote/people)
</div>
@LGPLLicense()
@MITLicense()
</li>
<li>
<div class="name">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
@Html.SmartLabelFor(model => model.Locales[item].Description)
</td>
<td class="adminData wide">
@Html.EditorFor(model => model.Locales[item].Description, Html.RichEditorFlavor())
@Html.EditorFor(model => model.Locales[item].Description, "Html")
@Html.ValidationMessageFor(model => model.Locales[item].Description)
</td>
</tr>
Expand All @@ -72,7 +72,7 @@
@Html.SmartLabelFor(model => model.Description)
</td>
<td class="adminData wide">
@Html.EditorFor(x => x.Description, Html.RichEditorFlavor())
@Html.EditorFor(x => x.Description, "Html")
@Html.ValidationMessageFor(model => model.Description)
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
@Html.SmartLabelFor(model => model.Full)
</td>
<td class="adminData wide">
@Html.EditorFor(x => x.Full, Html.RichEditorFlavor())
@Html.EditorFor(x => x.Full, "Html")
@Html.ValidationMessageFor(model => model.Full)
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
@Html.SmartLabelFor(model => model.Locales[item].FullDescription)
</td>
<td class="adminData wide">
@Html.EditorFor(model => model.Locales[item].FullDescription, Html.RichEditorFlavor())
@Html.EditorFor(model => model.Locales[item].FullDescription, "Html")
@Html.ValidationMessageFor(model => model.Locales[item].FullDescription)
</td>
</tr>
Expand Down Expand Up @@ -101,7 +101,7 @@
@Html.SmartLabelFor(model => model.FullDescription)
</td>
<td class="adminData wide">
@Html.EditorFor(x => x.FullDescription, Html.RichEditorFlavor())
@Html.EditorFor(x => x.FullDescription, "Html")
@Html.ValidationMessageFor(model => model.FullDescription)
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
@Html.SmartLabelFor(model => model.Locales[item].FullDescription)
</td>
<td class="adminData wide">
@Html.EditorFor(model => model.Locales[item].FullDescription, Html.RichEditorFlavor())
@Html.EditorFor(model => model.Locales[item].FullDescription, "Html")
@Html.ValidationMessageFor(model => model.Locales[item].FullDescription)
</td>
</tr>
Expand Down Expand Up @@ -162,7 +162,7 @@
@Html.SmartLabelFor(model => model.FullDescription)
</td>
<td class="adminData wide">
@Html.EditorFor(x => x.FullDescription, Html.RichEditorFlavor())
@Html.EditorFor(x => x.FullDescription, "Html")
@Html.ValidationMessageFor(model => model.FullDescription)
</td>
</tr>
Expand Down Expand Up @@ -457,7 +457,7 @@
@Html.SmartLabelFor(model => model.UserAgreementText)
</td>
<td class="adminData wide">
@Html.EditorFor(model => model.UserAgreementText, Html.RichEditorFlavor())
@Html.EditorFor(model => model.UserAgreementText, "Html")
@Html.ValidationMessageFor(model => model.UserAgreementText)
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
@Html.SmartLabelFor(model => model.Locales[item].Description)
</td>
<td class="adminData wide">
@Html.EditorFor(model => model.Locales[item].Description, Html.RichEditorFlavor())
@Html.EditorFor(model => model.Locales[item].Description, "Html")
@Html.ValidationMessageFor(model => model.Locales[item].Description)
</td>
</tr>
Expand Down Expand Up @@ -87,7 +87,7 @@
@Html.SmartLabelFor(model => model.Description)
</td>
<td class="adminData wide">
@Html.EditorFor(x => x.Description, Html.RichEditorFlavor())
@Html.EditorFor(x => x.Description, "Html")
@Html.ValidationMessageFor(model => model.Description)
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
@Html.SmartLabelFor(model => model.Body)
</td>
<td class="adminData wide">
@Html.EditorFor(model => model.Body, Html.RichEditorFlavor())
@Html.EditorFor(model => model.Body, "Html")
@Html.ValidationMessageFor(model => model.Body)
</td>
</tr>
Expand Down
Loading

0 comments on commit 31c83c6

Please sign in to comment.