Skip to content

Commit

Permalink
Version 2.2.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
dinc5150 committed Nov 17, 2022
2 parents 60eeab1 + d70c264 commit 0e38f33
Show file tree
Hide file tree
Showing 26 changed files with 8,063 additions and 326 deletions.
9 changes: 7 additions & 2 deletions MetaMomentum.Core/MetaMomentum.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net5.0|AnyCPU'">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
var bob = null
angular.module("umbraco")
.controller("DM.MetaMomentum",
function ($scope, $filter, editorState, contentEditingHelper, editorService, mediaHelper, entityResource, $interval) {
var shareImgUpdateInterval;

$scope.sharePreviewType = null;
$scope.showEditSearch = false;
$scope.showEditSocial = false;



$scope.$on('$destroy', function iVeBeenDismissed() {
// say goodbye to your controller here
// release resources, cancel request...
if (angular.isDefined(shareImgUpdateInterval)) {
//Stop interval function from updating share image
$interval.cancel(shareImgUpdateInterval);
shareImgUpdateInterval = undefined;

}

})


if ($scope.model.config.showSocialPreviewFacebook == 1) {
$scope.sharePreviewType = "facebook";
Expand Down Expand Up @@ -93,7 +108,7 @@ angular.module("umbraco")
}

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

function getPositionInString(string, subString, index) {
Expand All @@ -114,7 +129,7 @@ angular.module("umbraco")
if (typeof properties[p] !== "undefined" && properties[p].alias === fallbackTitles[i]) {
if (typeof properties[p].value !== "undefined" && properties[p].value !== "" && properties[p].value !== null)
//Found a fallback property value
$scope.model.value.title = properties[p].value;
$scope.model.value.title = $filter('momentumStripHtml')(properties[p].value, true);
}
}
}
Expand Down Expand Up @@ -149,7 +164,7 @@ angular.module("umbraco")
if (typeof properties[p] !== "undefined" && properties[p].alias === fallbackDescriptions[i]) {
if (typeof properties[p].value !== "undefined" && properties[p].value !== "" && properties[p].value !== null)
//Found a fallback property value
$scope.model.value.description = properties[p].value;
$scope.model.value.description = $filter('momentumStripHtml')(properties[p].value, true);
}
}
}
Expand Down Expand Up @@ -317,7 +332,7 @@ angular.module("umbraco")
multiPicker: false,
submit: function (imgmodel) {
editorService.close();
console.log(imgmodel.selection[0])

$scope.model.value.share.image = imgmodel.selection[0];
$scope.model.value.share.imageUrl = imgmodel.selection[0].image;

Expand Down Expand Up @@ -353,5 +368,23 @@ angular.module("umbraco")
});
}

$scope.openSocialPreview = function () {
$scope.showEditSocial = true;
document.querySelector('#SocialPreview').scrollIntoView({
behavior: 'smooth'
});
}

$scope.toggleAllowSearchEngines = function (e) {
console.log(e)
e.preventDefault();
$scope.model.value.noIndex = !$scope.model.value.noIndex;
console.log($scope.model.value.noIndex)
}

$scope.test = function (evt) {
console.log(evt)
}

init();
});
263 changes: 117 additions & 146 deletions MetaMomentum.UmbracoV10/App_Plugins/MetaMomentum/editorView.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@




.mm-hidden-fields {
Expand All @@ -16,8 +16,8 @@


.mm-preview-header {
width: 610px !important;
display: block;
width:100%;
}

.mm-preview-header button.btn-link {
Expand All @@ -39,3 +39,6 @@
}


.mm-controls {
max-width: 800px;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"propertyEditors": [
{
"alias": "DM.MetaMomentum",
Expand Down Expand Up @@ -95,6 +95,8 @@
"~/App_Plugins/MetaMomentum/metamomentum.css"
],
"javascript": [
"~/App_Plugins/MetaMomentum/editorView.controller.js"
"~/App_Plugins/MetaMomentum/uui-loader.js",
"~/App_Plugins/MetaMomentum/editorView.controller.js",
"~/App_Plugins/MetaMomentum/stripHtml.filter.js"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* @description
* removes html tags from HTML string to produce only text. Additional "stripLineBreaks" parameter will remove all line breaks as well
*/

(function () {
'use strict';

function momentumStripHtml() {
return function (htmlString, stripLineBreaks) {

if (!Utilities.isString(htmlString)) {
return "";
}

if (Utilities.isUndefined(htmlString)) {
return "";
}


var retVal = String(htmlString).replace(/<[^>]+>/gm, '');
if (stripLineBreaks) {
retVal = retVal.replace(/\r?\n|\r/g, ' '); //replace line break with a space
}

return retVal;
};
}

angular.module('umbraco.filters').filter('momentumStripHtml', momentumStripHtml);

})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if (typeof uui === 'undefined') {
var script = document.createElement('script');
script.src = "https://cdn.jsdelivr.net/npm/@umbraco-ui/uui@latest/dist/uui.min.js";
document.head.appendChild(script);
}
14 changes: 12 additions & 2 deletions MetaMomentum.UmbracoV10/MetaMomentum.UmbracoV10.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Content Include="App_Plugins\MetaMomentum\editorView.html" />
<Content Include="App_Plugins\MetaMomentum\metamomentum.css" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Umbraco.Cms" Version="10.0.0" />
<PackageReference Include="Umbraco.Cms" Version="10.3.2" />
</ItemGroup>

<!-- 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 -->
Expand All @@ -24,6 +28,12 @@
<Folder Include="wwwroot" />
</ItemGroup>

<ItemGroup>
<None Include="App_Plugins\MetaMomentum\editorView.controller.js" />
<None Include="App_Plugins\MetaMomentum\package.manifest" />
<None Include="App_Plugins\MetaMomentum\stripHtml.filter.js" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MetaMomentum\MetaMomentum.csproj" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion MetaMomentum.UmbracoV8/App_Data/Models/all.dll.path
Original file line number Diff line number Diff line change
@@ -1 +1 @@
C:\Users\david\AppData\Local\Temp\Temporary ASP.NET Files\vs\612bcd59\7ae4fdd\App_Web_all.generated.cs.8f9494c4.r-pnlrz1.dll
C:\Users\david\AppData\Local\Temp\Temporary ASP.NET Files\vs\612bcd59\7ae4fdd\App_Web_all.generated.cs.8f9494c4.lfsezqvu.dll
Binary file modified MetaMomentum.UmbracoV8/App_Data/Umbraco.sdf
Binary file not shown.
Binary file not shown.
Binary file modified MetaMomentum.UmbracoV9/umbraco/Data/Umbraco.sdf
Binary file not shown.
4 changes: 3 additions & 1 deletion MetaMomentum.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution files", "Solution files", "{EDA63525-2430-4F8E-BA25-A62334658E0A}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
gulpfile.js = gulpfile.js
readme.md = readme.md
readme.nuget.md = readme.nuget.md
umbraco-marketplace.json = umbraco-marketplace.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{BB8F5612-BAD2-4C50-B000-77B528FF42A0}"
Expand All @@ -25,7 +27,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetaMomentum.UmbracoV8", "M
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MetaMomentum.Core", "MetaMomentum.Core\MetaMomentum.Core.csproj", "{CE173229-3B5C-49AF-AF0B-3A0ABAD76291}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetaMomentum.UmbracoV10", "MetaMomentum.UmbracoV10\MetaMomentum.UmbracoV10.csproj", "{FD666001-34C9-4CBD-B1A1-E480ABCF4DAE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MetaMomentum.UmbracoV10", "MetaMomentum.UmbracoV10\MetaMomentum.UmbracoV10.csproj", "{FD666001-34C9-4CBD-B1A1-E480ABCF4DAE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
43 changes: 38 additions & 5 deletions MetaMomentum/App_Plugins/MetaMomentum/editorView.controller.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
var bob = null
angular.module("umbraco")
.controller("DM.MetaMomentum",
function ($scope, $filter, editorState, contentEditingHelper, editorService, mediaHelper, entityResource, $interval) {
var shareImgUpdateInterval;

$scope.sharePreviewType = null;
$scope.showEditSearch = false;
$scope.showEditSocial = false;



$scope.$on('$destroy', function iVeBeenDismissed() {
// say goodbye to your controller here
// release resources, cancel request...
if (angular.isDefined(shareImgUpdateInterval)) {
//Stop interval function from updating share image
$interval.cancel(shareImgUpdateInterval);
shareImgUpdateInterval = undefined;

}

})


if ($scope.model.config.showSocialPreviewFacebook == 1) {
$scope.sharePreviewType = "facebook";
Expand Down Expand Up @@ -93,7 +108,7 @@ angular.module("umbraco")
}

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

function getPositionInString(string, subString, index) {
Expand All @@ -114,7 +129,7 @@ angular.module("umbraco")
if (typeof properties[p] !== "undefined" && properties[p].alias === fallbackTitles[i]) {
if (typeof properties[p].value !== "undefined" && properties[p].value !== "" && properties[p].value !== null)
//Found a fallback property value
$scope.model.value.title = properties[p].value;
$scope.model.value.title = $filter('momentumStripHtml')(properties[p].value, true);
}
}
}
Expand Down Expand Up @@ -149,7 +164,7 @@ angular.module("umbraco")
if (typeof properties[p] !== "undefined" && properties[p].alias === fallbackDescriptions[i]) {
if (typeof properties[p].value !== "undefined" && properties[p].value !== "" && properties[p].value !== null)
//Found a fallback property value
$scope.model.value.description = properties[p].value;
$scope.model.value.description = $filter('momentumStripHtml')(properties[p].value, true);
}
}
}
Expand Down Expand Up @@ -317,7 +332,7 @@ angular.module("umbraco")
multiPicker: false,
submit: function (imgmodel) {
editorService.close();
console.log(imgmodel.selection[0])

$scope.model.value.share.image = imgmodel.selection[0];
$scope.model.value.share.imageUrl = imgmodel.selection[0].image;

Expand Down Expand Up @@ -353,5 +368,23 @@ angular.module("umbraco")
});
}

$scope.openSocialPreview = function () {
$scope.showEditSocial = true;
document.querySelector('#SocialPreview').scrollIntoView({
behavior: 'smooth'
});
}

$scope.toggleAllowSearchEngines = function (e) {
console.log(e)
e.preventDefault();
$scope.model.value.noIndex = !$scope.model.value.noIndex;
console.log($scope.model.value.noIndex)
}

$scope.test = function (evt) {
console.log(evt)
}

init();
});
Loading

0 comments on commit 0e38f33

Please sign in to comment.