-
-
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
f877381
commit 749d873
Showing
46 changed files
with
3,884 additions
and
53 deletions.
There are no files selected for viewing
90 changes: 90 additions & 0 deletions
90
src/Umbraco.Cms.13.x/App_Plugins/DiploGodMode/backoffice/Css/godMode.css
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,90 @@ | ||
.god-mode .umb-panel-header { | ||
position: relative !important; | ||
} | ||
|
||
.god-mode .umb-panel-header-icon { | ||
cursor: default; | ||
border: none; | ||
} | ||
|
||
.god-mode input[type=search]::-webkit-search-cancel-button { | ||
-webkit-appearance: searchfield-cancel-button; | ||
} | ||
|
||
.god-mode .box-opener { | ||
cursor: pointer; | ||
} | ||
|
||
.god-mode .box-opener:hover { | ||
cursor: pointer; | ||
border-bottom: 1px solid #c9c9cb; | ||
box-shadow: 0 8px 6px -6px #c9c9cb; | ||
} | ||
|
||
.god-mode .umb-box-content table th { | ||
background-color: #eee; | ||
} | ||
|
||
.god-mode table tbody .wrap { | ||
white-space: pre-wrap; | ||
} | ||
|
||
.god-mode table tbody button { | ||
text-align: left; | ||
background: none; | ||
padding: 0; | ||
margin: 0; | ||
border: 0; | ||
display: inline; | ||
font: inherit; | ||
text-decoration: underline; | ||
text-decoration-color: #aaa; | ||
} | ||
|
||
.god-mode table tbody button:hover, .god-mode table tbody a:hover { | ||
text-decoration: underline; | ||
text-decoration-color: #2bc37c; | ||
} | ||
|
||
.god-mode table tbody td code { | ||
font-size: smaller; | ||
} | ||
|
||
.god-mode table tbody td { | ||
overflow-wrap: break-word; | ||
word-break: break-all; | ||
} | ||
|
||
.god-mode .true-false { | ||
color: #bbbabf; | ||
} | ||
|
||
.god-mode .god-mode-title { | ||
font-size: 120%; | ||
transition: all 0.7s ease; | ||
display: inline-block; | ||
margin-right: 10px; | ||
} | ||
|
||
.god-mode .god-mode-title:hover { | ||
transform: rotateY(180deg); | ||
transform-style: preserve-3d; | ||
} | ||
|
||
.god-mode .add-on .icon-delete { | ||
color: #aaa; | ||
cursor: pointer; | ||
} | ||
|
||
.god-mode .add-on .icon-delete:hover { | ||
cursor: pointer; | ||
color: #000; | ||
} | ||
|
||
.god-mode .gm-results { | ||
background-color: #fff; | ||
padding: 4px; | ||
font-size: smaller; | ||
border-bottom: 1px solid #e9e9eb; | ||
color: #666; | ||
} |
125 changes: 125 additions & 0 deletions
125
src/Umbraco.Cms.13.x/App_Plugins/DiploGodMode/backoffice/Scripts/GodMode.Config.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,125 @@ | ||
(function () { | ||
'use strict'; | ||
angular.module("umbraco") | ||
.constant("godModeConfig", { | ||
"baseApiUrl": "backoffice/Api/GodModeApi/", | ||
"basePathUrl": "/App_Plugins/DiploGodMode/backoffice/godModeTree/", | ||
"config": { | ||
"version": "10.0.0", | ||
"editTemplateUrl": "#/settings/templates/edit/", | ||
"editDataTypeUrl": "#/settings/datatypes/edit/", | ||
"editDocTypeUrl": "#settings/documentTypes/edit/", | ||
"editPartialUrl": "#/settings/partialViews/edit/", | ||
"editMediaUrl": "#/media/media/edit/", | ||
"editContentUrl": "#/content/content/edit/", | ||
"baseTreeUrl": "#/settings/godModeTree/", | ||
"baseViewUrl": "#/settings/godModeTree/" | ||
} | ||
}) | ||
.directive('godmodeTrueFalse', function () { | ||
return { | ||
restrict: 'E', | ||
scope: { | ||
value: '=' | ||
}, | ||
link: function (scope, element, attrs) { | ||
}, | ||
template: '<span ng-show="value"><i class="icon icon-checkbox"></i> Yes</span><span ng-show="!value"><i class="icon icon-checkbox-empty"></i> No</span>' | ||
}; | ||
}) | ||
.directive('godmodeSortable', function () { | ||
return { | ||
restrict: 'E', | ||
scope: { | ||
column: '@', | ||
sort: "=", | ||
sortBy: "&" | ||
}, | ||
transclude: true, | ||
link: function (scope, element, attrs) { | ||
}, | ||
template: '<a ng-click="sortBy()" ng-transclude></a><i class="icon" ng-show="sort.column === column && !sort.reverse">▲</i><i class="icon" ng-show="sort.column === column && sort.reverse">▼</i>' | ||
}; | ||
}) | ||
.directive('godmodeHeader', function ($route, godModeConfig) { | ||
return { | ||
restrict: 'E', | ||
scope: { | ||
heading: '@', | ||
tooltip: '@', | ||
onReload: '&' | ||
}, | ||
link: function (scope, element, attrs) { | ||
scope.version = godModeConfig.config.version; | ||
}, | ||
templateUrl: "/App_Plugins/DiploGodMode/backoffice/godModeTree/godModeHeader.html" | ||
}; | ||
}) | ||
.directive('clearable', function () { | ||
return { | ||
require: 'ngModel', | ||
link: function (scope, element, attrs, control) { | ||
|
||
let wrapper = angular.element('<div>'); | ||
let button = angular.element('<div>').addClass('close-button'); | ||
|
||
button.bind('click', function () { | ||
control.$setViewValue(''); | ||
element.val(''); | ||
scope.$apply(); | ||
}); | ||
|
||
element.wrap(wrapper); | ||
element.parent().append(button); | ||
} | ||
}; | ||
}) | ||
.filter('godModeFileSize', function () { | ||
return function (bytes, precision) { | ||
if (!bytes) return "N/A"; | ||
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-'; | ||
if (typeof precision === 'undefined') precision = 1; | ||
const units = ['bytes', 'KB', 'MB', 'GB']; | ||
let number = Math.floor(Math.log(bytes) / Math.log(1024)); | ||
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number]; | ||
}; | ||
}) | ||
.filter('godModeUnique', function () { | ||
|
||
return function (items, filterOn) { | ||
|
||
if (filterOn === false) { | ||
return items; | ||
} | ||
|
||
if ((filterOn || angular.isUndefined(filterOn)) && angular.isArray(items)) { | ||
let hashCheck = {}, newItems = []; | ||
|
||
const extractValueToCompare = function (item) { | ||
if (angular.isObject(item) && angular.isString(filterOn)) { | ||
return item[filterOn]; | ||
} else { | ||
return item; | ||
} | ||
}; | ||
|
||
angular.forEach(items, function (item) { | ||
let valueToCheck, isDuplicate = false; | ||
|
||
for (let i = 0; i < newItems.length; i++) { | ||
if (angular.equals(extractValueToCompare(newItems[i]), extractValueToCompare(item))) { | ||
isDuplicate = true; | ||
break; | ||
} | ||
} | ||
if (!isDuplicate) { | ||
newItems.push(item); | ||
} | ||
|
||
}); | ||
items = newItems; | ||
} | ||
return items; | ||
}; | ||
}); | ||
})(); |
136 changes: 136 additions & 0 deletions
136
...Cms.13.x/App_Plugins/DiploGodMode/backoffice/Scripts/GodMode.ContentBrowser.Controller.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,136 @@ | ||
(function () { | ||
'use strict'; | ||
angular.module("umbraco").controller("GodMode.ContentBrowser.Controller", | ||
function ($routeParams, navigationService, godModeResources, godModeConfig, editorService, $scope) { | ||
|
||
const vm = this; | ||
const infiniteMode = $scope.model && $scope.model.infiniteMode; | ||
const param = infiniteMode ? $scope.model.id : null; | ||
|
||
navigationService.syncTree({ tree: $routeParams.tree, path: [-1, $routeParams.method], forceReload: false }); | ||
|
||
vm.config = godModeConfig.config; | ||
vm.criteria = {}; | ||
vm.page = {}; | ||
vm.currentPage = 1; | ||
vm.itemsPerPage = 15; | ||
vm.content = []; | ||
vm.contentTypeAliases = []; | ||
vm.languages = []; | ||
vm.sort = {}; | ||
vm.sort.column = "N.id"; | ||
vm.nuCacheViewer = false; | ||
|
||
vm.triStateOptions = godModeResources.getTriStateOptions(); | ||
vm.criteria.Trashed = vm.triStateOptions[0]; | ||
|
||
godModeResources.getNuCacheType().then(function (data) { | ||
if (data) { | ||
vm.nuCacheViewer = data !== "MessagePack"; | ||
} | ||
}); | ||
|
||
vm.fetchContent = function (orderBy) { | ||
|
||
vm.isLoading = true; | ||
godModeResources.getContentPaged(vm.currentPage, vm.itemsPerPage, vm.criteria, orderBy).then(function (data) { | ||
vm.page = data; | ||
vm.currentPage = vm.page.CurrentPage; | ||
vm.isLoading = false; | ||
}); | ||
}; | ||
|
||
vm.sortBy = function (column) { | ||
vm.sort.column = column; | ||
vm.sort.reverse = !vm.sort.reverse; | ||
var orderBy = vm.sort.column; | ||
|
||
if (orderBy) { | ||
orderBy = vm.sort.reverse ? orderBy + " DESC" : orderBy + " ASC"; | ||
} | ||
|
||
vm.fetchContent(orderBy); | ||
}; | ||
|
||
vm.prevPage = function () { | ||
if (vm.currentPage > 1) { | ||
vm.currentPage--; | ||
vm.fetchContent(vm.sort.column); | ||
} | ||
}; | ||
|
||
vm.nextPage = function () { | ||
if (vm.currentPage < vm.page.TotalPages) { | ||
vm.currentPage++; | ||
vm.fetchContent(vm.sort.column); | ||
} | ||
}; | ||
|
||
vm.setPage = function (pageNumber) { | ||
vm.currentPage = pageNumber; | ||
vm.fetchContent(vm.sort.column); | ||
}; | ||
|
||
vm.filterChange = function () { | ||
vm.currentPage = 1; | ||
vm.page = {}; | ||
vm.fetchContent(vm.sort.column); | ||
}; | ||
|
||
godModeResources.getLanguages().then(function (data) { | ||
|
||
data.push({ | ||
Id: -1, | ||
Name: "No Language", | ||
Culture: null | ||
}) | ||
|
||
vm.languages = data; | ||
}); | ||
|
||
godModeResources.getStandardContentTypeAliases().then(function (data) { | ||
vm.contentTypeAliases = data; | ||
|
||
if (param !== "browse") { | ||
vm.contentTypeAliases.filter(function (elem) { | ||
if (elem === param) { | ||
vm.criteria.Alias = elem; | ||
} | ||
}); | ||
} | ||
|
||
vm.fetchContent(); | ||
}); | ||
|
||
vm.openContent = function (contentId) { | ||
const editor = { | ||
id: contentId, | ||
submit: function () { | ||
vm.fetchContent(); | ||
editorService.close(); | ||
}, | ||
close: function () { | ||
editorService.close(); | ||
} | ||
}; | ||
editorService.contentEditor(editor); | ||
}; | ||
|
||
|
||
vm.openNuCacheViewer = function (id) { | ||
const editor = { | ||
view: godModeConfig.basePathUrl + "nuCacheViewer.html", | ||
id: id, | ||
submit: function () { | ||
vm.fetchContent(); | ||
editorService.close(); | ||
}, | ||
close: function () { | ||
editorService.close(); | ||
} | ||
}; | ||
editorService.open(editor); | ||
}; | ||
|
||
}); | ||
})(); |
Oops, something went wrong.