-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e889d9
commit db8547d
Showing
26 changed files
with
609 additions
and
598 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@echo off | ||
dotnet build ../src/Our.Umbraco.BlockPreview.csproj --configuration Release /t:rebuild /t:pack -p:PackageOutputPath=../releases/nuget |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
43 changes: 0 additions & 43 deletions
43
src/App_Plugins/Our.Umbraco.BlockPreview/js/controllers/block-list-preview.controller.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/App_Plugins/Our.Umbraco.BlockPreview/js/directives/bind-compile.directive.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* angular-bind-compile v0.1.0 | ||
* https://github.com/emn178/angular-bind-compile | ||
* | ||
* Copyright 2014, [email protected] | ||
* | ||
* Licensed under the MIT license: | ||
* http://www.opensource.org/licenses/MIT | ||
*/ | ||
angular.module('umbraco.filters') | ||
.directive('ngBindCompile', ['$sce', '$compile', function ($sce, $compile) { | ||
return { | ||
restrict: 'A', | ||
compile: function (tElement, tAttrs) { | ||
return function (scope, element, attrs) { | ||
scope.$watch(function () { | ||
return $sce.getTrustedHtml(scope.$eval(attrs.ngBindCompile)); | ||
}, function (value) { | ||
element.html(value); | ||
$compile(element.contents())(scope); | ||
}); | ||
}; | ||
} | ||
}; | ||
}]); |
82 changes: 49 additions & 33 deletions
82
src/App_Plugins/Our.Umbraco.BlockPreview/js/directives/published-check.directive.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,50 @@ | ||
angular.module('umbraco.filters') | ||
.directive('publicationCheck', [function () { | ||
|
||
function setStyle(scope, element) { | ||
//if (typeof scope.settings["hideBlock"] !== "undefined") { | ||
// if (scope.settings.hideBlock === '1') { | ||
// element[0].style.opacity = 0.25; | ||
// return; | ||
// } | ||
//} | ||
|
||
element[0].style.opacity = 1; | ||
return; | ||
} | ||
|
||
function link(scope, element, attrs) { | ||
|
||
setStyle(scope, element); | ||
|
||
scope.$watch('settings', function (newValue, oldValue) { | ||
if (newValue) | ||
setStyle(scope, element); | ||
}, true); | ||
|
||
} | ||
|
||
return { | ||
restrict: 'A', | ||
scope: { | ||
'settings': '=', | ||
}, | ||
link: link, | ||
}; | ||
}]); | ||
.directive('publicationCheck', [function () { | ||
|
||
function setStyle(scope, element) { | ||
if (!scope.settings) { | ||
element[0].style.opacity = 1; | ||
return; | ||
} | ||
if (scope.settings.hideBlock === '1') { | ||
element[0].style.opacity = 0.25; | ||
return; | ||
} | ||
|
||
if (scope.settings.startDate === '' && scope.settings.endDate === '') { | ||
element[0].style.opacity = 1; | ||
return; | ||
} | ||
|
||
if (Date.parse(scope.settings.startDate) > new Date()) { | ||
element[0].style.opacity = 0.25; | ||
return; | ||
} | ||
|
||
if (Date.parse(scope.settings.endDate) < new Date()) { | ||
element[0].style.opacity = 0.25; | ||
return; | ||
} | ||
|
||
element[0].style.opacity = 1; | ||
} | ||
|
||
function link(scope, element, attrs) { | ||
|
||
setStyle(scope, element); | ||
|
||
scope.$watch('settings', function (newValue, oldValue) { | ||
if (newValue) | ||
setStyle(scope, element); | ||
}, true); | ||
|
||
} | ||
|
||
return { | ||
restrict: 'A', | ||
scope: { | ||
'settings': '=', | ||
}, | ||
link: link, | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"name": "Our.Umbraco.BlockPreview", | ||
"version": "1.0.0-alpha003", | ||
"version": "1.0.0-alpha004", | ||
"allowPackageTelemetry": true, | ||
"javascript": [ | ||
"~/App_Plugins/Our.Umbraco.BlockPreview/js/resources/preview.resource.js", | ||
"~/App_Plugins/Our.Umbraco.BlockPreview/js/directives/published-check.directive.js", | ||
"~/App_Plugins/Our.Umbraco.BlockPreview/js/controllers/block-grid-preview.controller.js", | ||
"~/App_Plugins/Our.Umbraco.BlockPreview/js/controllers/block-list-preview.controller.js" | ||
"~/App_Plugins/Our.Umbraco.BlockPreview/js/directives/bind-compile.directive.js", | ||
"~/App_Plugins/Our.Umbraco.BlockPreview/js/controllers/block-preview.controller.js" | ||
] | ||
} |
5 changes: 0 additions & 5 deletions
5
src/App_Plugins/Our.Umbraco.BlockPreview/views/block-grid-preview.html
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
src/App_Plugins/Our.Umbraco.BlockPreview/views/block-list-preview.html
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
src/App_Plugins/Our.Umbraco.BlockPreview/views/block-preview.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div ng-click="block.edit()" ng-focus="block.focus" class="blockelement__draggable-element" ng-controller="Our.Umbraco.BlockPreview.Controllers.BlockPreviewController"> | ||
|
||
<div ng-if="loading === false" | ||
ng-bind-compile="markup" | ||
publication-check | ||
settings="block.settingsData"></div> | ||
|
||
</div> |
Oops, something went wrong.