Skip to content

Commit 585dc88

Browse files
committed
Merge branch 'release/4.3.1'
Minor maintenance release containing some bug fixes and minor feature improvements. Summary - Significant cleanup of the CKEditor plugin used for the `HtmlViewComponent` (acecc86) - Fixes a major bug which prevented topics with an empty `TopicListViewComponent` from being saved (d12e3d4) - Addresses a confusing user interface decision where a removed attribute value would continue to be displayed as placeholder text (752f9da) CKEditor - Removed extraneous toolbars (110a9ac, 619360e), and tidied up the formatting and layout of the default toolbar (6fdf1a3, 37d06d3, 168b6ce) - Removed features that shouldn't be used in most cases, such as underline (2e60363), custom fonts (6056f01), and duplicate buttons (33f88a0) - Removed all customer-oriented customizations and styles (74712c0); these can now be overwritten on a per client basis - Removed out-of-the-box Spell Check As You Type (SCAYT), in favor of browser default spell check (a4790fe, 3bb9de4) - Removed commented out items that weren't being actively used (f997f5e, 8ad4bb3) - Cleaned up formatting of files and introduced modern commenting and indentation standards (99c9eb9, 9ee289e, 452fd19) - Fixed some issues with the default stylesheet (3175936, 2c02393, b3966c5) Bug Fixes - Fixed but where removing an empty `TopicListViewComponent` from the interface would break ASP.NET Core data binding (af5e765) - Updated `InheritedAttributes` to use values from the `DerivedTopic` so that when a value is deleted, it doesn't reappear as a placheolder (15ea21f) - Updated the `::placeholder` pseudoclass so it's clearer what is an explicitly defined value and what is an inherited value (c56c188)
2 parents 8c8a224 + eec2f75 commit 585dc88

11 files changed

Lines changed: 127 additions & 192 deletions

File tree

OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/TopicList/Default.cshtml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@
88

99
@if (Model.TopicList.Count > 1) {
1010
<select
11-
asp-for ="Value"
12-
asp-items ="Model.TopicList"
13-
class ="@Model.AttributeDescriptor.CssClass form-control form-inline"
14-
disabled =@(!Model.AttributeDescriptor.IsEnabled)
15-
required =@Model.AttributeDescriptor.IsRequired
16-
>
11+
asp-for ="Value"
12+
asp-items ="Model.TopicList"
13+
class ="@Model.AttributeDescriptor.CssClass form-control form-inline"
14+
disabled =@(!Model.AttributeDescriptor.IsEnabled)
15+
required =@Model.AttributeDescriptor.IsRequired>
1716
</select>
17+
}
18+
else {
19+
<input type="hidden" asp-for="AttributeDescriptor.Key" />
20+
<input type="hidden" asp-for="AttributeDescriptor.ContentType" />
21+
<input type="hidden" asp-for="Value" />
1822
}

OnTopic.Editor.AspNetCore/Controllers/EditorController.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@ bool isModal
176176
}
177177

178178
//Set inherited attribute value, if available
179-
topicViewModel.InheritedAttributes.Add(attribute.Key, isNew? null : CurrentTopic.Attributes.GetValue(attribute.Key));
179+
topicViewModel.InheritedAttributes.Add(
180+
attribute.Key,
181+
isNew? null : CurrentTopic.DerivedTopic?.Attributes.GetValue(attribute.Key)
182+
);
180183

181184
}
182185

OnTopic.Editor.AspNetCore/OnTopic.Editor.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<ItemGroup>
2828
<FrameworkReference Include="Microsoft.AspNetCore.App" />
29-
<PackageReference Include="GitVersionTask" Version="5.3.5">
29+
<PackageReference Include="GitVersionTask" Version="5.3.7">
3030
<PrivateAssets>all</PrivateAssets>
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3232
</PackageReference>

OnTopic.Editor.AspNetCore/Shared/Scripts/CkEditor/CustomConfig.js

Lines changed: 59 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,82 @@
1+
/*==============================================================================================================================
2+
| Author Ignia, LLC
3+
| Client Ignia, LLC
4+
| Project OnTopic Editor
5+
\=============================================================================================================================*/
16
/*
27
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
38
For licensing, see LICENSE.html or http://ckeditor.com/license
49
*/
510

11+
/*==============================================================================================================================
12+
| METHOD: EDITOR CONFIG
13+
\-----------------------------------------------------------------------------------------------------------------------------*/
14+
/**
15+
* Provides configuration settings for CKEditor.
16+
*/
617
CKEDITOR.editorConfig = function( config ) {
7-
//Define changes to default configuration here. For example:
8-
//config.language = 'fr';
9-
//config.uiColor = '#AADC6E';
10-
//config.extraPlugins = 'a11ychecker';
11-
config.removePlugins = 'autosave';
18+
config.removePlugins = 'autosave,scayt';
1219
config.allowedContent = true;
1320
config.baseHref = '/';
1421
config.skin = 'moono-lisa';
15-
//config.uiColor = '#CFCFCF';
16-
//config.height = '515px';
17-
//config.resize_maxHeight = '800';
1822
config.resize_maxWidth = '800';
1923
config.fillEmptyBlocks = false;
2024
config.shiftEnterMode = CKEDITOR.ENTER_BR;
2125
config.contentsCss = '/_content/OnTopic.Editor.AspNetCore/Shared/Styles/CKEditor.css';
26+
config.disableNativeSpellChecker = false;
2227
config.toolbar = [
23-
{ name: 'document', items: [ 'Source' ] },
24-
{ name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', '-', 'Undo', 'Redo' ] },
25-
{ name: 'blocks', items: [ 'ShowBlocks', 'RemoveFormat' ] },
26-
{ name: 'editing', items: [ 'Scayt' ] },
27-
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
28-
{ name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar' ] },
28+
{
29+
name : 'document',
30+
items : ['Source']
31+
},
32+
{
33+
name : 'clipboard',
34+
items : ['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste']
35+
},
36+
{
37+
name : 'blocks',
38+
items : ['ShowBlocks', 'RemoveFormat']
39+
},
40+
{
41+
name : 'links',
42+
items : ['Link', 'Unlink', 'Anchor']
43+
},
44+
{
45+
name : 'insert',
46+
items : ['Image', 'Table', 'HorizontalRule', 'SpecialChar']
47+
},
2948
'/',
30-
{ name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
31-
{ name: 'position', items: [ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', '-', 'Outdent', 'Indent' ] },
32-
{ name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Blockquote' ] },
33-
'/',
34-
{ name: 'styles', items: ['Styles', 'Format'] },
35-
{ name: 'tools', items: [ 'Find', 'Replace', 'SelectAll', 'Maximize' ] }
49+
{
50+
name : 'styles',
51+
items : ['Format']
52+
},
53+
{
54+
name : 'basicstyles',
55+
items : ['Bold', 'Italic', 'Strike', 'Subscript', 'Superscript']
56+
},
57+
{
58+
name : 'position',
59+
items : ['JustifyLeft', 'JustifyCenter', 'JustifyRight']
60+
},
61+
{
62+
name : 'paragraph',
63+
items : ['NumberedList', 'BulletedList', 'Outdent', 'Indent', '-', 'Blockquote']
64+
},
65+
{
66+
name : 'tools',
67+
items : ['Find', 'Replace', 'SelectAll', 'Maximize']
68+
}
3669
];
3770
config.toolbarCanCollapse = true;
38-
config.toolbar_Full = [
39-
['Source','-','Save','NewPage','Preview','-','Templates'],
40-
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
41-
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
42-
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
43-
'/',
44-
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
45-
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
46-
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
47-
['Link','Unlink','Anchor'],
48-
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
49-
'/',
50-
['Styles','Format','Font','FontSize'],
51-
['TextColor','BGColor'],
52-
['Maximize', 'ShowBlocks','-','About']
53-
];
54-
config.toolbar_Basic = [
55-
['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink','-','About']
56-
];
57-
config.toolbar_OnTopic = [
58-
['Preview','Source','Undo','Redo','ShowBlocks','RemoveFormat'],
59-
['Bold','Italic','Cut','Copy','Paste','PasteText','Scayt'],
60-
['Styles'], //,'Format'
61-
'/',
62-
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','Outdent','Indent'],
63-
['NumberedList','BulletedList','Link','Unlink','Anchor'],
64-
['CreateDiv','Image','Table','HorizontalRule','SpecialChar'],
65-
['Find','Replace','SelectAll','Maximize'],
66-
];
67-
//Set font names
68-
config.font_names =
69-
'Tahoma/Tahoma, Arial/Arial, sans-serif;' +
70-
'Times New Roman/Times New Roman, Times, serif;' +
71-
'Verdana';
72-
//Call external styles set definition for Styles dropdown menu
73-
config.stylesCombo_stylesSet = 'OnTopicStyleSet:/_content/OnTopic.Editor.AspNetCore/Shared/Scripts/CkEditor/StylesSet.js';
74-
//Set classes for styles defined in styles set
7571
config.bodyClass = 'CKEPanel';
76-
7772
};
7873

74+
/*==============================================================================================================================
75+
| METHOD: INSTANCE READY
76+
\-----------------------------------------------------------------------------------------------------------------------------*/
77+
/**
78+
* Provides late binding rules to initialize once the editor instance is ready.
79+
*/
7980
CKEDITOR.on('instanceReady', function (ev) {
8081
var blockTags = ['div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'pre', 'ul', 'ol', 'li', 'br'];
8182
var rules = {

OnTopic.Editor.AspNetCore/Shared/Scripts/CkEditor/StylesSet.js

Lines changed: 0 additions & 93 deletions
This file was deleted.

OnTopic.Editor.AspNetCore/Shared/Styles/Base/_forms.scss

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,18 @@ section.attribute input.error {
156156
// SUPPORTING STYLES
157157
//----------------------------------------------------------------------------------------------
158158
.instructions {
159-
font-size: rem-calc(16);
160-
font-style: italic;
161-
color: $grey-medium;
162-
159+
font-size : rem-calc(16);
160+
font-style : italic;
161+
color : $grey-medium;
163162
&.error {
164-
color: $red;
163+
color : $red;
165164
}
165+
}
166+
167+
//----------------------------------------------------------------------------------------------
168+
// PLACEHOLDERS
169+
//----------------------------------------------------------------------------------------------
170+
::placeholder,
171+
::-webkit-input-placeholder {
172+
color : $grey-lighter !important;
166173
}
Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,50 @@
1-
@import url('https://fonts.googleapis.com/css?family=Lato:300,400');
1+
//==============================================================================================
2+
// CKEDITOR
3+
//----------------------------------------------------------------------------------------------
4+
// Custom stylesheet to be used within the CKEditor. As this implementation should be
5+
// implementation agnostic, this defines a very basic set of style preferences. In practice, we
6+
// expect most implementions will want to establish a custom configuration, style set, and style
7+
// sheet for CKEditor, thus overriding this implementation.
8+
//==============================================================================================
9+
10+
//----------------------------------------------------------------------------------------------
11+
// FONTS
12+
//----------------------------------------------------------------------------------------------
13+
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400&display=swap');
14+
15+
//----------------------------------------------------------------------------------------------
16+
// BODY
17+
//----------------------------------------------------------------------------------------------
218
body {
3-
background-color: #FFF;
4-
font-family: "Lato", Helvetica, Arial, sans-serif;
5-
font-size: 16px;
6-
color: #333;
7-
}
19+
background-color : #FFF;
20+
font-family : "Lato", Helvetica, Arial, sans-serif;
21+
font-size : 16px;
22+
color : #333;
23+
}
24+
25+
//----------------------------------------------------------------------------------------------
26+
// HEADINGS
27+
//----------------------------------------------------------------------------------------------
828
h1,
929
h2,
1030
h3 {
11-
font-family: "Lato Light", Helvetica, Arial, sans-serif;
31+
font-weight : 300;
1232
}
1333
h1 {
14-
font-size: 32px;
34+
font-size : 32px;
1535
}
1636
h2 {
17-
font-size: 28px;
37+
font-size : 28px;
1838
}
1939
h3 {
20-
font-size: 24px;
40+
font-size : 24px;
2141
}
2242
h4 {
23-
font-size: 18px;
43+
font-size : 18px;
2444
}
2545
h5 {
26-
font-size: 16px;
46+
font-size : 16px;
2747
}
2848
h6 {
29-
font-size: 14px;
30-
}
31-
.Heading {
32-
font-family: "Lato", Helvetica, Arial, sans-serif;
49+
font-size : 14px;
3350
}

OnTopic.Editor.AspNetCore/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)