Skip to content

Commit 0e38f33

Browse files
committed
Version 2.2.0 Release
2 parents 60eeab1 + d70c264 commit 0e38f33

26 files changed

+8063
-326
lines changed

MetaMomentum.Core/MetaMomentum.Core.csproj

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>net6.0;net5.0;net472</TargetFrameworks>
5-
<Version>2.1.1</Version>
5+
<Version>2.2.0</Version>
66
<Description>Core MetaMomentum DLL for reference in class projects</Description>
77
<Company>Digital Momentum</Company>
88
<Product>MetaMomentum for Umbraco 8, 9 &amp; 10</Product>
@@ -14,9 +14,14 @@
1414
<PackageIconUrl>https://user-images.githubusercontent.com/12960162/114866380-d1c98680-9e36-11eb-92d4-a78c1dbf5def.png</PackageIconUrl>
1515
<RepositoryUrl>https://github.com/DigitalMomentum/MetaMomentum</RepositoryUrl>
1616
<RepositoryType>git</RepositoryType>
17-
<PackageTags>Umbraco seo twitter opengraph Umbraco8 Umbraco9 Umbraco10 Datatype PropertyEditor dotnetcore dotnet6 umbraco-marketplace</PackageTags>
17+
<PackageTags>Umbraco seo twitter opengraph Umbraco8 Umbraco9 Umbraco10 Datatype PropertyEditor dotnetcore dotnet6</PackageTags>
1818
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
1919
<PackageReadmeFile>readme.nuget.md</PackageReadmeFile>
20+
<PackageReleaseNotes>
21+
- Update UI to use the new Umbraco UI Library
22+
- RTE / Html fallbacks now strip the HTML tags
23+
- Bug Fixes and performance inprovements
24+
</PackageReleaseNotes>
2025
</PropertyGroup>
2126

2227
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net5.0|AnyCPU'">

MetaMomentum.UmbracoV10/App_Plugins/MetaMomentum/editorView.controller.js

+38-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
1-
var bob = null
21
angular.module("umbraco")
32
.controller("DM.MetaMomentum",
43
function ($scope, $filter, editorState, contentEditingHelper, editorService, mediaHelper, entityResource, $interval) {
4+
var shareImgUpdateInterval;
5+
56
$scope.sharePreviewType = null;
67
$scope.showEditSearch = false;
78
$scope.showEditSocial = false;
89

10+
11+
12+
$scope.$on('$destroy', function iVeBeenDismissed() {
13+
// say goodbye to your controller here
14+
// release resources, cancel request...
15+
if (angular.isDefined(shareImgUpdateInterval)) {
16+
//Stop interval function from updating share image
17+
$interval.cancel(shareImgUpdateInterval);
18+
shareImgUpdateInterval = undefined;
19+
20+
}
21+
22+
})
23+
924

1025
if ($scope.model.config.showSocialPreviewFacebook == 1) {
1126
$scope.sharePreviewType = "facebook";
@@ -93,7 +108,7 @@ angular.module("umbraco")
93108
}
94109

95110
//Todo: Need to find a better way of checking if a fallback property has changed. Works for text but not images
96-
$interval($scope.updateShareImage, 3000);
111+
shareImgUpdateInterval = $interval($scope.updateShareImage, 3000);
97112
}
98113

99114
function getPositionInString(string, subString, index) {
@@ -114,7 +129,7 @@ angular.module("umbraco")
114129
if (typeof properties[p] !== "undefined" && properties[p].alias === fallbackTitles[i]) {
115130
if (typeof properties[p].value !== "undefined" && properties[p].value !== "" && properties[p].value !== null)
116131
//Found a fallback property value
117-
$scope.model.value.title = properties[p].value;
132+
$scope.model.value.title = $filter('momentumStripHtml')(properties[p].value, true);
118133
}
119134
}
120135
}
@@ -149,7 +164,7 @@ angular.module("umbraco")
149164
if (typeof properties[p] !== "undefined" && properties[p].alias === fallbackDescriptions[i]) {
150165
if (typeof properties[p].value !== "undefined" && properties[p].value !== "" && properties[p].value !== null)
151166
//Found a fallback property value
152-
$scope.model.value.description = properties[p].value;
167+
$scope.model.value.description = $filter('momentumStripHtml')(properties[p].value, true);
153168
}
154169
}
155170
}
@@ -317,7 +332,7 @@ angular.module("umbraco")
317332
multiPicker: false,
318333
submit: function (imgmodel) {
319334
editorService.close();
320-
console.log(imgmodel.selection[0])
335+
321336
$scope.model.value.share.image = imgmodel.selection[0];
322337
$scope.model.value.share.imageUrl = imgmodel.selection[0].image;
323338

@@ -353,5 +368,23 @@ angular.module("umbraco")
353368
});
354369
}
355370

371+
$scope.openSocialPreview = function () {
372+
$scope.showEditSocial = true;
373+
document.querySelector('#SocialPreview').scrollIntoView({
374+
behavior: 'smooth'
375+
});
376+
}
377+
378+
$scope.toggleAllowSearchEngines = function (e) {
379+
console.log(e)
380+
e.preventDefault();
381+
$scope.model.value.noIndex = !$scope.model.value.noIndex;
382+
console.log($scope.model.value.noIndex)
383+
}
384+
385+
$scope.test = function (evt) {
386+
console.log(evt)
387+
}
388+
356389
init();
357390
});

MetaMomentum.UmbracoV10/App_Plugins/MetaMomentum/editorView.html

+117-146
Large diffs are not rendered by default.

MetaMomentum.UmbracoV10/App_Plugins/MetaMomentum/metamomentum.css

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-

1+
22

33

44
.mm-hidden-fields {
@@ -16,8 +16,8 @@
1616

1717

1818
.mm-preview-header {
19-
width: 610px !important;
2019
display: block;
20+
width:100%;
2121
}
2222

2323
.mm-preview-header button.btn-link {
@@ -39,3 +39,6 @@
3939
}
4040

4141

42+
.mm-controls {
43+
max-width: 800px;
44+
}

MetaMomentum.UmbracoV10/App_Plugins/MetaMomentum/package.manifest

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"propertyEditors": [
33
{
44
"alias": "DM.MetaMomentum",
@@ -95,6 +95,8 @@
9595
"~/App_Plugins/MetaMomentum/metamomentum.css"
9696
],
9797
"javascript": [
98-
"~/App_Plugins/MetaMomentum/editorView.controller.js"
98+
"~/App_Plugins/MetaMomentum/uui-loader.js",
99+
"~/App_Plugins/MetaMomentum/editorView.controller.js",
100+
"~/App_Plugins/MetaMomentum/stripHtml.filter.js"
99101
]
100102
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* @description
3+
* removes html tags from HTML string to produce only text. Additional "stripLineBreaks" parameter will remove all line breaks as well
4+
*/
5+
6+
(function () {
7+
'use strict';
8+
9+
function momentumStripHtml() {
10+
return function (htmlString, stripLineBreaks) {
11+
12+
if (!Utilities.isString(htmlString)) {
13+
return "";
14+
}
15+
16+
if (Utilities.isUndefined(htmlString)) {
17+
return "";
18+
}
19+
20+
21+
var retVal = String(htmlString).replace(/<[^>]+>/gm, '');
22+
if (stripLineBreaks) {
23+
retVal = retVal.replace(/\r?\n|\r/g, ' '); //replace line break with a space
24+
}
25+
26+
return retVal;
27+
};
28+
}
29+
30+
angular.module('umbraco.filters').filter('momentumStripHtml', momentumStripHtml);
31+
32+
})();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if (typeof uui === 'undefined') {
2+
var script = document.createElement('script');
3+
script.src = "https://cdn.jsdelivr.net/npm/@umbraco-ui/uui@latest/dist/uui.min.js";
4+
document.head.appendChild(script);
5+
}

MetaMomentum.UmbracoV10/MetaMomentum.UmbracoV10.csproj

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
33
<TargetFramework>net6.0</TargetFramework>
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
</PropertyGroup>
7+
<ItemGroup>
8+
<Content Include="App_Plugins\MetaMomentum\editorView.html" />
9+
<Content Include="App_Plugins\MetaMomentum\metamomentum.css" />
10+
</ItemGroup>
711

812
<ItemGroup>
9-
<PackageReference Include="Umbraco.Cms" Version="10.0.0" />
13+
<PackageReference Include="Umbraco.Cms" Version="10.3.2" />
1014
</ItemGroup>
1115

1216
<!-- Force Windows to use ICU. Otherwise Windows 10 2019H1+ will do it, but older Windows 10 and most, if not all, Windows Server editions will run NLS -->
@@ -24,6 +28,12 @@
2428
<Folder Include="wwwroot" />
2529
</ItemGroup>
2630

31+
<ItemGroup>
32+
<None Include="App_Plugins\MetaMomentum\editorView.controller.js" />
33+
<None Include="App_Plugins\MetaMomentum\package.manifest" />
34+
<None Include="App_Plugins\MetaMomentum\stripHtml.filter.js" />
35+
</ItemGroup>
36+
2737
<ItemGroup>
2838
<ProjectReference Include="..\MetaMomentum\MetaMomentum.csproj" />
2939
</ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
C:\Users\david\AppData\Local\Temp\Temporary ASP.NET Files\vs\612bcd59\7ae4fdd\App_Web_all.generated.cs.8f9494c4.r-pnlrz1.dll
1+
C:\Users\david\AppData\Local\Temp\Temporary ASP.NET Files\vs\612bcd59\7ae4fdd\App_Web_all.generated.cs.8f9494c4.lfsezqvu.dll
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

MetaMomentum.sln

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution files", "Solution files", "{EDA63525-2430-4F8E-BA25-A62334658E0A}"
77
ProjectSection(SolutionItems) = preProject
88
.gitignore = .gitignore
9+
gulpfile.js = gulpfile.js
910
readme.md = readme.md
1011
readme.nuget.md = readme.nuget.md
12+
umbraco-marketplace.json = umbraco-marketplace.json
1113
EndProjectSection
1214
EndProject
1315
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{BB8F5612-BAD2-4C50-B000-77B528FF42A0}"
@@ -25,7 +27,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetaMomentum.UmbracoV8", "M
2527
EndProject
2628
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MetaMomentum.Core", "MetaMomentum.Core\MetaMomentum.Core.csproj", "{CE173229-3B5C-49AF-AF0B-3A0ABAD76291}"
2729
EndProject
28-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetaMomentum.UmbracoV10", "MetaMomentum.UmbracoV10\MetaMomentum.UmbracoV10.csproj", "{FD666001-34C9-4CBD-B1A1-E480ABCF4DAE}"
30+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MetaMomentum.UmbracoV10", "MetaMomentum.UmbracoV10\MetaMomentum.UmbracoV10.csproj", "{FD666001-34C9-4CBD-B1A1-E480ABCF4DAE}"
2931
EndProject
3032
Global
3133
GlobalSection(SolutionConfigurationPlatforms) = preSolution

MetaMomentum/App_Plugins/MetaMomentum/editorView.controller.js

+38-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
1-
var bob = null
21
angular.module("umbraco")
32
.controller("DM.MetaMomentum",
43
function ($scope, $filter, editorState, contentEditingHelper, editorService, mediaHelper, entityResource, $interval) {
4+
var shareImgUpdateInterval;
5+
56
$scope.sharePreviewType = null;
67
$scope.showEditSearch = false;
78
$scope.showEditSocial = false;
89

10+
11+
12+
$scope.$on('$destroy', function iVeBeenDismissed() {
13+
// say goodbye to your controller here
14+
// release resources, cancel request...
15+
if (angular.isDefined(shareImgUpdateInterval)) {
16+
//Stop interval function from updating share image
17+
$interval.cancel(shareImgUpdateInterval);
18+
shareImgUpdateInterval = undefined;
19+
20+
}
21+
22+
})
23+
924

1025
if ($scope.model.config.showSocialPreviewFacebook == 1) {
1126
$scope.sharePreviewType = "facebook";
@@ -93,7 +108,7 @@ angular.module("umbraco")
93108
}
94109

95110
//Todo: Need to find a better way of checking if a fallback property has changed. Works for text but not images
96-
$interval($scope.updateShareImage, 3000);
111+
shareImgUpdateInterval = $interval($scope.updateShareImage, 3000);
97112
}
98113

99114
function getPositionInString(string, subString, index) {
@@ -114,7 +129,7 @@ angular.module("umbraco")
114129
if (typeof properties[p] !== "undefined" && properties[p].alias === fallbackTitles[i]) {
115130
if (typeof properties[p].value !== "undefined" && properties[p].value !== "" && properties[p].value !== null)
116131
//Found a fallback property value
117-
$scope.model.value.title = properties[p].value;
132+
$scope.model.value.title = $filter('momentumStripHtml')(properties[p].value, true);
118133
}
119134
}
120135
}
@@ -149,7 +164,7 @@ angular.module("umbraco")
149164
if (typeof properties[p] !== "undefined" && properties[p].alias === fallbackDescriptions[i]) {
150165
if (typeof properties[p].value !== "undefined" && properties[p].value !== "" && properties[p].value !== null)
151166
//Found a fallback property value
152-
$scope.model.value.description = properties[p].value;
167+
$scope.model.value.description = $filter('momentumStripHtml')(properties[p].value, true);
153168
}
154169
}
155170
}
@@ -317,7 +332,7 @@ angular.module("umbraco")
317332
multiPicker: false,
318333
submit: function (imgmodel) {
319334
editorService.close();
320-
console.log(imgmodel.selection[0])
335+
321336
$scope.model.value.share.image = imgmodel.selection[0];
322337
$scope.model.value.share.imageUrl = imgmodel.selection[0].image;
323338

@@ -353,5 +368,23 @@ angular.module("umbraco")
353368
});
354369
}
355370

371+
$scope.openSocialPreview = function () {
372+
$scope.showEditSocial = true;
373+
document.querySelector('#SocialPreview').scrollIntoView({
374+
behavior: 'smooth'
375+
});
376+
}
377+
378+
$scope.toggleAllowSearchEngines = function (e) {
379+
console.log(e)
380+
e.preventDefault();
381+
$scope.model.value.noIndex = !$scope.model.value.noIndex;
382+
console.log($scope.model.value.noIndex)
383+
}
384+
385+
$scope.test = function (evt) {
386+
console.log(evt)
387+
}
388+
356389
init();
357390
});

0 commit comments

Comments
 (0)