Browse Source

refactor

pull/19919/head
Berkan Sasmaz 2 years ago
parent
commit
662eb75cd1
  1. 820
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/abp/jquery/abp.jquery.js
  2. 1342
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/abp/utils/abp-utils.umd.js
  3. 820
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/bootstrap-daterangepicker/daterangepicker.css
  4. 3156
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/bootstrap-daterangepicker/daterangepicker.js
  5. 10
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/bootstrap/js/bootstrap.enable.popovers.everywhere.js
  6. 10
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/bootstrap/js/bootstrap.enable.tooltips.everywhere.js
  7. 0
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/codemirror/mode/sas/sas.js
  8. 42
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/jquery-form/jquery.form.min.js
  9. 864
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js
  10. 46
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/tui-editor/toastui-editor-all.min.js
  11. 28
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/tui-editor/toastui-editor-plugin-code-syntax-highlight-all.min.js
  12. 342
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/tui-editor/toastui-editor-plugin-code-syntax-highlight.min.css
  13. 12
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/tui-editor/toastui-editor.min.css
  14. 1392
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/yarn.lock
  15. 4
      modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentGetListInput.cs
  16. 4
      modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentSettingsDto.cs
  17. 11
      modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/ICommentAdminAppService.cs
  18. 1
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationAutoMapperProfile.cs
  19. 43
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs
  20. 8
      modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/Volo/CmsKit/Admin/Comments/CommentAdminClientProxy.Generated.cs
  21. 20
      modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Comments/CommentAdminController.cs
  22. 26
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebModule.cs
  23. 5
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Approve/Index.cshtml
  24. 1
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Approve/Index.cshtml.cs
  25. 17
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Approve/PrismjsScriptBundleContributorDocsExtension.cs
  26. 312
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Approve/index.js
  27. 10
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml
  28. 2
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml.cs
  29. 10
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml
  30. 4
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml.cs
  31. 5
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/index.js
  32. 12
      modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Comments/CommentApproveState.cs
  33. 12
      modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Comments/CommentApproveStateType.cs
  34. 7
      modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Settings/AppSettings.cs
  35. 8
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/Comment.cs
  36. 6
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/ICommentRepository.cs
  37. 2
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Settings/CmsKitSettingDefinitionProvider.cs
  38. 25
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Comments/EfCoreCommentRepository.cs
  39. 71
      modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Comments/MongoCommentRepository.cs
  40. 9
      modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs

820
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/abp/jquery/abp.jquery.js

@ -1,411 +1,411 @@
var abp = abp || {}; var abp = abp || {};
(function($) { (function($) {
if (!$) { if (!$) {
throw "abp/jquery library requires the jquery library included to the page!"; throw "abp/jquery library requires the jquery library included to the page!";
} }
// ABP CORE OVERRIDES ///////////////////////////////////////////////////// // ABP CORE OVERRIDES /////////////////////////////////////////////////////
abp.message._showMessage = function (message, title) { abp.message._showMessage = function (message, title) {
alert((title || '') + ' ' + message); alert((title || '') + ' ' + message);
return $.Deferred(function ($dfd) { return $.Deferred(function ($dfd) {
$dfd.resolve(); $dfd.resolve();
}); });
}; };
abp.message.confirm = function (message, titleOrCallback, callback) { abp.message.confirm = function (message, titleOrCallback, callback) {
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
callback = titleOrCallback; callback = titleOrCallback;
} }
var result = confirm(message); var result = confirm(message);
callback && callback(result); callback && callback(result);
return $.Deferred(function ($dfd) { return $.Deferred(function ($dfd) {
$dfd.resolve(result); $dfd.resolve(result);
}); });
}; };
abp.utils.isFunction = function (obj) { abp.utils.isFunction = function (obj) {
return $.isFunction(obj); return $.isFunction(obj);
}; };
// JQUERY EXTENSIONS ////////////////////////////////////////////////////// // JQUERY EXTENSIONS //////////////////////////////////////////////////////
$.fn.findWithSelf = function (selector) { $.fn.findWithSelf = function (selector) {
return this.filter(selector).add(this.find(selector)); return this.filter(selector).add(this.find(selector));
}; };
// DOM //////////////////////////////////////////////////////////////////// // DOM ////////////////////////////////////////////////////////////////////
abp.dom = abp.dom || {}; abp.dom = abp.dom || {};
abp.dom.onNodeAdded = function (callback) { abp.dom.onNodeAdded = function (callback) {
abp.event.on('abp.dom.nodeAdded', callback); abp.event.on('abp.dom.nodeAdded', callback);
}; };
abp.dom.onNodeRemoved = function (callback) { abp.dom.onNodeRemoved = function (callback) {
abp.event.on('abp.dom.nodeRemoved', callback); abp.event.on('abp.dom.nodeRemoved', callback);
}; };
var mutationObserverCallback = function (mutationsList) { var mutationObserverCallback = function (mutationsList) {
for (var i = 0; i < mutationsList.length; i++) { for (var i = 0; i < mutationsList.length; i++) {
var mutation = mutationsList[i]; var mutation = mutationsList[i];
if (mutation.type === 'childList') { if (mutation.type === 'childList') {
if (mutation.addedNodes && mutation.removedNodes.length) { if (mutation.addedNodes && mutation.removedNodes.length) {
for (var k = 0; k < mutation.removedNodes.length; k++) { for (var k = 0; k < mutation.removedNodes.length; k++) {
abp.event.trigger( abp.event.trigger(
'abp.dom.nodeRemoved', 'abp.dom.nodeRemoved',
{ {
$el: $(mutation.removedNodes[k]) $el: $(mutation.removedNodes[k])
} }
); );
} }
} }
if (mutation.addedNodes && mutation.addedNodes.length) { if (mutation.addedNodes && mutation.addedNodes.length) {
for (var j = 0; j < mutation.addedNodes.length; j++) { for (var j = 0; j < mutation.addedNodes.length; j++) {
abp.event.trigger( abp.event.trigger(
'abp.dom.nodeAdded', 'abp.dom.nodeAdded',
{ {
$el: $(mutation.addedNodes[j]) $el: $(mutation.addedNodes[j])
} }
); );
} }
} }
} }
} }
}; };
$(function(){ $(function(){
new MutationObserver(mutationObserverCallback).observe( new MutationObserver(mutationObserverCallback).observe(
$('body')[0], $('body')[0],
{ {
subtree: true, subtree: true,
childList: true childList: true
} }
); );
}); });
// AJAX /////////////////////////////////////////////////////////////////// // AJAX ///////////////////////////////////////////////////////////////////
abp.ajax = function (userOptions) { abp.ajax = function (userOptions) {
userOptions = userOptions || {}; userOptions = userOptions || {};
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
options.success = undefined; options.success = undefined;
options.error = undefined; options.error = undefined;
var xhr = null; var xhr = null;
var promise = $.Deferred(function ($dfd) { var promise = $.Deferred(function ($dfd) {
xhr = $.ajax(options) xhr = $.ajax(options)
.done(function (data, textStatus, jqXHR) { .done(function (data, textStatus, jqXHR) {
$dfd.resolve(data); $dfd.resolve(data);
userOptions.success && userOptions.success(data); userOptions.success && userOptions.success(data);
}).fail(function (jqXHR) { }).fail(function (jqXHR) {
if(jqXHR.statusText === 'abort') { if(jqXHR.statusText === 'abort') {
//ajax request is abort, ignore error handle. //ajax request is abort, ignore error handle.
return; return;
} }
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
} else { } else {
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
} }
}); });
}).promise(); }).promise();
promise['jqXHR'] = xhr; promise['jqXHR'] = xhr;
return promise; return promise;
}; };
$.extend(abp.ajax, { $.extend(abp.ajax, {
defaultOpts: { defaultOpts: {
dataType: 'json', dataType: 'json',
type: 'POST', type: 'POST',
contentType: 'application/json', contentType: 'application/json',
headers: { headers: {
'X-Requested-With': 'XMLHttpRequest' 'X-Requested-With': 'XMLHttpRequest'
} }
}, },
defaultError: { defaultError: {
message: 'An error has occurred!', message: 'An error has occurred!',
details: 'Error detail not sent by server.' details: 'Error detail not sent by server.'
}, },
defaultError401: { defaultError401: {
message: 'You are not authenticated!', message: 'You are not authenticated!',
details: 'You should be authenticated (sign in) in order to perform this operation.' details: 'You should be authenticated (sign in) in order to perform this operation.'
}, },
defaultError403: { defaultError403: {
message: 'You are not authorized!', message: 'You are not authorized!',
details: 'You are not allowed to perform this operation.' details: 'You are not allowed to perform this operation.'
}, },
defaultError404: { defaultError404: {
message: 'Resource not found!', message: 'Resource not found!',
details: 'The resource requested could not found on the server.' details: 'The resource requested could not found on the server.'
}, },
logError: function (error) { logError: function (error) {
abp.log.error(error); abp.log.error(error);
}, },
showError: function (error) { showError: function (error) {
if (error.details) { if (error.details) {
return abp.message.error(error.details, error.message); return abp.message.error(error.details, error.message);
} else { } else {
return abp.message.error(error.message || abp.ajax.defaultError.message); return abp.message.error(error.message || abp.ajax.defaultError.message);
} }
}, },
handleTargetUrl: function (targetUrl) { handleTargetUrl: function (targetUrl) {
if (!targetUrl) { if (!targetUrl) {
location.href = abp.appPath; location.href = abp.appPath;
} else { } else {
location.href = targetUrl; location.href = targetUrl;
} }
}, },
handleErrorStatusCode: function (status) { handleErrorStatusCode: function (status) {
switch (status) { switch (status) {
case 401: case 401:
abp.ajax.handleUnAuthorizedRequest( abp.ajax.handleUnAuthorizedRequest(
abp.ajax.showError(abp.ajax.defaultError401), abp.ajax.showError(abp.ajax.defaultError401),
abp.appPath abp.appPath
); );
break; break;
case 403: case 403:
abp.ajax.showError(abp.ajax.defaultError403); abp.ajax.showError(abp.ajax.defaultError403);
break; break;
case 404: case 404:
abp.ajax.showError(abp.ajax.defaultError404); abp.ajax.showError(abp.ajax.defaultError404);
break; break;
default: default:
abp.ajax.showError(abp.ajax.defaultError); abp.ajax.showError(abp.ajax.defaultError);
break; break;
} }
}, },
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
if (userOptions.abpHandleError !== false) { if (userOptions.abpHandleError !== false) {
abp.ajax.handleErrorStatusCode(jqXHR.status); abp.ajax.handleErrorStatusCode(jqXHR.status);
} }
$dfd.reject.apply(this, arguments); $dfd.reject.apply(this, arguments);
userOptions.error && userOptions.error.apply(this, arguments); userOptions.error && userOptions.error.apply(this, arguments);
}, },
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
var messagePromise = null; var messagePromise = null;
var responseJSON = jqXHR.responseJSON ? jqXHR.responseJSON : JSON.parse(jqXHR.responseText); var responseJSON = jqXHR.responseJSON ? jqXHR.responseJSON : JSON.parse(jqXHR.responseText);
if (userOptions.abpHandleError !== false) { if (userOptions.abpHandleError !== false) {
messagePromise = abp.ajax.showError(responseJSON.error); messagePromise = abp.ajax.showError(responseJSON.error);
} }
abp.ajax.logError(responseJSON.error); abp.ajax.logError(responseJSON.error);
$dfd && $dfd.reject(responseJSON.error, jqXHR); $dfd && $dfd.reject(responseJSON.error, jqXHR);
userOptions.error && userOptions.error(responseJSON.error, jqXHR); userOptions.error && userOptions.error(responseJSON.error, jqXHR);
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
abp.ajax.handleUnAuthorizedRequest(messagePromise); abp.ajax.handleUnAuthorizedRequest(messagePromise);
} }
}, },
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
if (messagePromise) { if (messagePromise) {
messagePromise.done(function () { messagePromise.done(function () {
abp.ajax.handleTargetUrl(targetUrl); abp.ajax.handleTargetUrl(targetUrl);
}); });
} else { } else {
abp.ajax.handleTargetUrl(targetUrl); abp.ajax.handleTargetUrl(targetUrl);
} }
}, },
blockUI: function (options) { blockUI: function (options) {
if (options.blockUI) { if (options.blockUI) {
if (options.blockUI === true) { //block whole page if (options.blockUI === true) { //block whole page
abp.ui.setBusy(); abp.ui.setBusy();
} else { //block an element } else { //block an element
abp.ui.setBusy(options.blockUI); abp.ui.setBusy(options.blockUI);
} }
} }
}, },
unblockUI: function (options) { unblockUI: function (options) {
if (options.blockUI) { if (options.blockUI) {
if (options.blockUI === true) { //unblock whole page if (options.blockUI === true) { //unblock whole page
abp.ui.clearBusy(); abp.ui.clearBusy();
} else { //unblock an element } else { //unblock an element
abp.ui.clearBusy(options.blockUI); abp.ui.clearBusy(options.blockUI);
} }
} }
}, },
ajaxSendHandler: function (event, request, settings) { ajaxSendHandler: function (event, request, settings) {
var token = abp.security.antiForgery.getToken(); var token = abp.security.antiForgery.getToken();
if (!token) { if (!token) {
return; return;
} }
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
} }
} }
}); });
$(document).ajaxSend(function (event, request, settings) { $(document).ajaxSend(function (event, request, settings) {
return abp.ajax.ajaxSendHandler(event, request, settings); return abp.ajax.ajaxSendHandler(event, request, settings);
}); });
abp.event.on('abp.configurationInitialized', function () { abp.event.on('abp.configurationInitialized', function () {
var l = abp.localization.getResource('AbpUi'); var l = abp.localization.getResource('AbpUi');
abp.ajax.defaultError.message = l('DefaultErrorMessage'); abp.ajax.defaultError.message = l('DefaultErrorMessage');
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
}); });
// RESOURCE LOADER //////////////////////////////////////////////////////// // RESOURCE LOADER ////////////////////////////////////////////////////////
/* UrlStates enum */ /* UrlStates enum */
var UrlStates = { var UrlStates = {
LOADING: 'LOADING', LOADING: 'LOADING',
LOADED: 'LOADED', LOADED: 'LOADED',
FAILED: 'FAILED' FAILED: 'FAILED'
}; };
/* UrlInfo class */ /* UrlInfo class */
function UrlInfo(url) { function UrlInfo(url) {
this.url = url; this.url = url;
this.state = UrlStates.LOADING; this.state = UrlStates.LOADING;
this.loadCallbacks = []; this.loadCallbacks = [];
this.failCallbacks = []; this.failCallbacks = [];
} }
UrlInfo.prototype.succeed = function () { UrlInfo.prototype.succeed = function () {
this.state = UrlStates.LOADED; this.state = UrlStates.LOADED;
for (var i = 0; i < this.loadCallbacks.length; i++) { for (var i = 0; i < this.loadCallbacks.length; i++) {
this.loadCallbacks[i](); this.loadCallbacks[i]();
} }
}; };
UrlInfo.prototype.failed = function () { UrlInfo.prototype.failed = function () {
this.state = UrlStates.FAILED; this.state = UrlStates.FAILED;
for (var i = 0; i < this.failCallbacks.length; i++) { for (var i = 0; i < this.failCallbacks.length; i++) {
this.failCallbacks[i](); this.failCallbacks[i]();
} }
}; };
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
switch (this.state) { switch (this.state) {
case UrlStates.LOADED: case UrlStates.LOADED:
loadCallback && loadCallback(); loadCallback && loadCallback();
break; break;
case UrlStates.FAILED: case UrlStates.FAILED:
failCallback && failCallback(); failCallback && failCallback();
break; break;
case UrlStates.LOADING: case UrlStates.LOADING:
this.addCallbacks(loadCallback, failCallback); this.addCallbacks(loadCallback, failCallback);
break; break;
} }
}; };
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
loadCallback && this.loadCallbacks.push(loadCallback); loadCallback && this.loadCallbacks.push(loadCallback);
failCallback && this.failCallbacks.push(failCallback); failCallback && this.failCallbacks.push(failCallback);
}; };
/* ResourceLoader API */ /* ResourceLoader API */
abp.ResourceLoader = (function () { abp.ResourceLoader = (function () {
var _urlInfos = {}; var _urlInfos = {};
function getCacheKey(url) { function getCacheKey(url) {
return url; return url;
} }
function appendTimeToUrl(url) { function appendTimeToUrl(url) {
if (url.indexOf('?') < 0) { if (url.indexOf('?') < 0) {
url += '?'; url += '?';
} else { } else {
url += '&'; url += '&';
} }
url += '_=' + new Date().getTime(); url += '_=' + new Date().getTime();
return url; return url;
} }
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
var cacheKey = getCacheKey(url); var cacheKey = getCacheKey(url);
var urlInfo = _urlInfos[cacheKey]; var urlInfo = _urlInfos[cacheKey];
if (urlInfo) { if (urlInfo) {
urlInfo.handleCallbacks(loadCallback, failCallback); urlInfo.handleCallbacks(loadCallback, failCallback);
return; return;
} }
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); _urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
urlInfo.addCallbacks(loadCallback, failCallback); urlInfo.addCallbacks(loadCallback, failCallback);
serverLoader(urlInfo); serverLoader(urlInfo);
}; };
var _loadScript = function (url, loadCallback, failCallback) { var _loadScript = function (url, loadCallback, failCallback) {
var nonce = document.body.nonce || document.body.getAttribute('nonce'); var nonce = document.body.nonce || document.body.getAttribute('nonce');
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
$.get({ $.get({
url: url, url: url,
dataType: 'text' dataType: 'text'
}) })
.done(function (script) { .done(function (script) {
if(nonce){ if(nonce){
$.globalEval(script, { nonce: nonce}); $.globalEval(script, { nonce: nonce});
}else{ }else{
$.globalEval(script); $.globalEval(script);
} }
urlInfo.succeed(); urlInfo.succeed();
}) })
.fail(function () { .fail(function () {
urlInfo.failed(); urlInfo.failed();
}); });
}); });
}; };
var _loadStyle = function (url) { var _loadStyle = function (url) {
_loadFromUrl(url, undefined, undefined, function (urlInfo) { _loadFromUrl(url, undefined, undefined, function (urlInfo) {
$('<link/>', { $('<link/>', {
rel: 'stylesheet', rel: 'stylesheet',
type: 'text/css', type: 'text/css',
href: appendTimeToUrl(url) href: appendTimeToUrl(url)
}).appendTo('head'); }).appendTo('head');
}); });
}; };
return { return {
loadScript: _loadScript, loadScript: _loadScript,
loadStyle: _loadStyle loadStyle: _loadStyle
} }
})(); })();
})(jQuery); })(jQuery);

1342
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/abp/utils/abp-utils.umd.js

File diff suppressed because it is too large

820
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/bootstrap-daterangepicker/daterangepicker.css

@ -1,410 +1,410 @@
.daterangepicker { .daterangepicker {
position: absolute; position: absolute;
color: inherit; color: inherit;
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
border: 1px solid #ddd; border: 1px solid #ddd;
width: 278px; width: 278px;
max-width: none; max-width: none;
padding: 0; padding: 0;
margin-top: 7px; margin-top: 7px;
top: 100px; top: 100px;
left: 20px; left: 20px;
z-index: 3001; z-index: 3001;
display: none; display: none;
font-family: arial; font-family: arial;
font-size: 15px; font-size: 15px;
line-height: 1em; line-height: 1em;
} }
.daterangepicker:before, .daterangepicker:after { .daterangepicker:before, .daterangepicker:after {
position: absolute; position: absolute;
display: inline-block; display: inline-block;
border-bottom-color: rgba(0, 0, 0, 0.2); border-bottom-color: rgba(0, 0, 0, 0.2);
content: ''; content: '';
} }
.daterangepicker:before { .daterangepicker:before {
top: -7px; top: -7px;
border-right: 7px solid transparent; border-right: 7px solid transparent;
border-left: 7px solid transparent; border-left: 7px solid transparent;
border-bottom: 7px solid #ccc; border-bottom: 7px solid #ccc;
} }
.daterangepicker:after { .daterangepicker:after {
top: -6px; top: -6px;
border-right: 6px solid transparent; border-right: 6px solid transparent;
border-bottom: 6px solid #fff; border-bottom: 6px solid #fff;
border-left: 6px solid transparent; border-left: 6px solid transparent;
} }
.daterangepicker.opensleft:before { .daterangepicker.opensleft:before {
right: 9px; right: 9px;
} }
.daterangepicker.opensleft:after { .daterangepicker.opensleft:after {
right: 10px; right: 10px;
} }
.daterangepicker.openscenter:before { .daterangepicker.openscenter:before {
left: 0; left: 0;
right: 0; right: 0;
width: 0; width: 0;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
.daterangepicker.openscenter:after { .daterangepicker.openscenter:after {
left: 0; left: 0;
right: 0; right: 0;
width: 0; width: 0;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
.daterangepicker.opensright:before { .daterangepicker.opensright:before {
left: 9px; left: 9px;
} }
.daterangepicker.opensright:after { .daterangepicker.opensright:after {
left: 10px; left: 10px;
} }
.daterangepicker.drop-up { .daterangepicker.drop-up {
margin-top: -7px; margin-top: -7px;
} }
.daterangepicker.drop-up:before { .daterangepicker.drop-up:before {
top: initial; top: initial;
bottom: -7px; bottom: -7px;
border-bottom: initial; border-bottom: initial;
border-top: 7px solid #ccc; border-top: 7px solid #ccc;
} }
.daterangepicker.drop-up:after { .daterangepicker.drop-up:after {
top: initial; top: initial;
bottom: -6px; bottom: -6px;
border-bottom: initial; border-bottom: initial;
border-top: 6px solid #fff; border-top: 6px solid #fff;
} }
.daterangepicker.single .daterangepicker .ranges, .daterangepicker.single .drp-calendar { .daterangepicker.single .daterangepicker .ranges, .daterangepicker.single .drp-calendar {
float: none; float: none;
} }
.daterangepicker.single .drp-selected { .daterangepicker.single .drp-selected {
display: none; display: none;
} }
.daterangepicker.show-calendar .drp-calendar { .daterangepicker.show-calendar .drp-calendar {
display: block; display: block;
} }
.daterangepicker.show-calendar .drp-buttons { .daterangepicker.show-calendar .drp-buttons {
display: block; display: block;
} }
.daterangepicker.auto-apply .drp-buttons { .daterangepicker.auto-apply .drp-buttons {
display: none; display: none;
} }
.daterangepicker .drp-calendar { .daterangepicker .drp-calendar {
display: none; display: none;
max-width: 270px; max-width: 270px;
} }
.daterangepicker .drp-calendar.left { .daterangepicker .drp-calendar.left {
padding: 8px 0 8px 8px; padding: 8px 0 8px 8px;
} }
.daterangepicker .drp-calendar.right { .daterangepicker .drp-calendar.right {
padding: 8px; padding: 8px;
} }
.daterangepicker .drp-calendar.single .calendar-table { .daterangepicker .drp-calendar.single .calendar-table {
border: none; border: none;
} }
.daterangepicker .calendar-table .next span, .daterangepicker .calendar-table .prev span { .daterangepicker .calendar-table .next span, .daterangepicker .calendar-table .prev span {
color: #fff; color: #fff;
border: solid black; border: solid black;
border-width: 0 2px 2px 0; border-width: 0 2px 2px 0;
border-radius: 0; border-radius: 0;
display: inline-block; display: inline-block;
padding: 3px; padding: 3px;
} }
.daterangepicker .calendar-table .next span { .daterangepicker .calendar-table .next span {
transform: rotate(-45deg); transform: rotate(-45deg);
-webkit-transform: rotate(-45deg); -webkit-transform: rotate(-45deg);
} }
.daterangepicker .calendar-table .prev span { .daterangepicker .calendar-table .prev span {
transform: rotate(135deg); transform: rotate(135deg);
-webkit-transform: rotate(135deg); -webkit-transform: rotate(135deg);
} }
.daterangepicker .calendar-table th, .daterangepicker .calendar-table td { .daterangepicker .calendar-table th, .daterangepicker .calendar-table td {
white-space: nowrap; white-space: nowrap;
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
min-width: 32px; min-width: 32px;
width: 32px; width: 32px;
height: 24px; height: 24px;
line-height: 24px; line-height: 24px;
font-size: 12px; font-size: 12px;
border-radius: 4px; border-radius: 4px;
border: 1px solid transparent; border: 1px solid transparent;
white-space: nowrap; white-space: nowrap;
cursor: pointer; cursor: pointer;
} }
.daterangepicker .calendar-table { .daterangepicker .calendar-table {
border: 1px solid #fff; border: 1px solid #fff;
border-radius: 4px; border-radius: 4px;
background-color: #fff; background-color: #fff;
} }
.daterangepicker .calendar-table table { .daterangepicker .calendar-table table {
width: 100%; width: 100%;
margin: 0; margin: 0;
border-spacing: 0; border-spacing: 0;
border-collapse: collapse; border-collapse: collapse;
} }
.daterangepicker td.available:hover, .daterangepicker th.available:hover { .daterangepicker td.available:hover, .daterangepicker th.available:hover {
background-color: #eee; background-color: #eee;
border-color: transparent; border-color: transparent;
color: inherit; color: inherit;
} }
.daterangepicker td.week, .daterangepicker th.week { .daterangepicker td.week, .daterangepicker th.week {
font-size: 80%; font-size: 80%;
color: #ccc; color: #ccc;
} }
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date { .daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
background-color: #fff; background-color: #fff;
border-color: transparent; border-color: transparent;
color: #999; color: #999;
} }
.daterangepicker td.in-range { .daterangepicker td.in-range {
background-color: #ebf4f8; background-color: #ebf4f8;
border-color: transparent; border-color: transparent;
color: #000; color: #000;
border-radius: 0; border-radius: 0;
} }
.daterangepicker td.start-date { .daterangepicker td.start-date {
border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px;
} }
.daterangepicker td.end-date { .daterangepicker td.end-date {
border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;
} }
.daterangepicker td.start-date.end-date { .daterangepicker td.start-date.end-date {
border-radius: 4px; border-radius: 4px;
} }
.daterangepicker td.active, .daterangepicker td.active:hover { .daterangepicker td.active, .daterangepicker td.active:hover {
background-color: #357ebd; background-color: #357ebd;
border-color: transparent; border-color: transparent;
color: #fff; color: #fff;
} }
.daterangepicker th.month { .daterangepicker th.month {
width: auto; width: auto;
} }
.daterangepicker td.disabled, .daterangepicker option.disabled { .daterangepicker td.disabled, .daterangepicker option.disabled {
color: #999; color: #999;
cursor: not-allowed; cursor: not-allowed;
text-decoration: line-through; text-decoration: line-through;
} }
.daterangepicker select.monthselect, .daterangepicker select.yearselect { .daterangepicker select.monthselect, .daterangepicker select.yearselect {
font-size: 12px; font-size: 12px;
padding: 1px; padding: 1px;
height: auto; height: auto;
margin: 0; margin: 0;
cursor: default; cursor: default;
} }
.daterangepicker select.monthselect { .daterangepicker select.monthselect {
margin-right: 2%; margin-right: 2%;
width: 56%; width: 56%;
} }
.daterangepicker select.yearselect { .daterangepicker select.yearselect {
width: 40%; width: 40%;
} }
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect { .daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {
width: 50px; width: 50px;
margin: 0 auto; margin: 0 auto;
background: #eee; background: #eee;
border: 1px solid #eee; border: 1px solid #eee;
padding: 2px; padding: 2px;
outline: 0; outline: 0;
font-size: 12px; font-size: 12px;
} }
.daterangepicker .calendar-time { .daterangepicker .calendar-time {
text-align: center; text-align: center;
margin: 4px auto 0 auto; margin: 4px auto 0 auto;
line-height: 30px; line-height: 30px;
position: relative; position: relative;
} }
.daterangepicker .calendar-time select.disabled { .daterangepicker .calendar-time select.disabled {
color: #ccc; color: #ccc;
cursor: not-allowed; cursor: not-allowed;
} }
.daterangepicker .drp-buttons { .daterangepicker .drp-buttons {
clear: both; clear: both;
text-align: right; text-align: right;
padding: 8px; padding: 8px;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
display: none; display: none;
line-height: 12px; line-height: 12px;
vertical-align: middle; vertical-align: middle;
} }
.daterangepicker .drp-selected { .daterangepicker .drp-selected {
display: inline-block; display: inline-block;
font-size: 12px; font-size: 12px;
padding-right: 8px; padding-right: 8px;
} }
.daterangepicker .drp-buttons .btn { .daterangepicker .drp-buttons .btn {
margin-left: 8px; margin-left: 8px;
font-size: 12px; font-size: 12px;
font-weight: bold; font-weight: bold;
padding: 4px 8px; padding: 4px 8px;
} }
.daterangepicker.show-ranges.single.rtl .drp-calendar.left { .daterangepicker.show-ranges.single.rtl .drp-calendar.left {
border-right: 1px solid #ddd; border-right: 1px solid #ddd;
} }
.daterangepicker.show-ranges.single.ltr .drp-calendar.left { .daterangepicker.show-ranges.single.ltr .drp-calendar.left {
border-left: 1px solid #ddd; border-left: 1px solid #ddd;
} }
.daterangepicker.show-ranges.rtl .drp-calendar.right { .daterangepicker.show-ranges.rtl .drp-calendar.right {
border-right: 1px solid #ddd; border-right: 1px solid #ddd;
} }
.daterangepicker.show-ranges.ltr .drp-calendar.left { .daterangepicker.show-ranges.ltr .drp-calendar.left {
border-left: 1px solid #ddd; border-left: 1px solid #ddd;
} }
.daterangepicker .ranges { .daterangepicker .ranges {
float: none; float: none;
text-align: left; text-align: left;
margin: 0; margin: 0;
} }
.daterangepicker.show-calendar .ranges { .daterangepicker.show-calendar .ranges {
margin-top: 8px; margin-top: 8px;
} }
.daterangepicker .ranges ul { .daterangepicker .ranges ul {
list-style: none; list-style: none;
margin: 0 auto; margin: 0 auto;
padding: 0; padding: 0;
width: 100%; width: 100%;
} }
.daterangepicker .ranges li { .daterangepicker .ranges li {
font-size: 12px; font-size: 12px;
padding: 8px 12px; padding: 8px 12px;
cursor: pointer; cursor: pointer;
} }
.daterangepicker .ranges li:hover { .daterangepicker .ranges li:hover {
background-color: #eee; background-color: #eee;
} }
.daterangepicker .ranges li.active { .daterangepicker .ranges li.active {
background-color: #08c; background-color: #08c;
color: #fff; color: #fff;
} }
/* Larger Screen Styling */ /* Larger Screen Styling */
@media (min-width: 564px) { @media (min-width: 564px) {
.daterangepicker { .daterangepicker {
width: auto; width: auto;
} }
.daterangepicker .ranges ul { .daterangepicker .ranges ul {
width: 140px; width: 140px;
} }
.daterangepicker.single .ranges ul { .daterangepicker.single .ranges ul {
width: 100%; width: 100%;
} }
.daterangepicker.single .drp-calendar.left { .daterangepicker.single .drp-calendar.left {
clear: none; clear: none;
} }
.daterangepicker.single .ranges, .daterangepicker.single .drp-calendar { .daterangepicker.single .ranges, .daterangepicker.single .drp-calendar {
float: left; float: left;
} }
.daterangepicker { .daterangepicker {
direction: ltr; direction: ltr;
text-align: left; text-align: left;
} }
.daterangepicker .drp-calendar.left { .daterangepicker .drp-calendar.left {
clear: left; clear: left;
margin-right: 0; margin-right: 0;
} }
.daterangepicker .drp-calendar.left .calendar-table { .daterangepicker .drp-calendar.left .calendar-table {
border-right: none; border-right: none;
border-top-right-radius: 0; border-top-right-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
} }
.daterangepicker .drp-calendar.right { .daterangepicker .drp-calendar.right {
margin-left: 0; margin-left: 0;
} }
.daterangepicker .drp-calendar.right .calendar-table { .daterangepicker .drp-calendar.right .calendar-table {
border-left: none; border-left: none;
border-top-left-radius: 0; border-top-left-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
.daterangepicker .drp-calendar.left .calendar-table { .daterangepicker .drp-calendar.left .calendar-table {
padding-right: 8px; padding-right: 8px;
} }
.daterangepicker .ranges, .daterangepicker .drp-calendar { .daterangepicker .ranges, .daterangepicker .drp-calendar {
float: left; float: left;
} }
} }
@media (min-width: 730px) { @media (min-width: 730px) {
.daterangepicker .ranges { .daterangepicker .ranges {
width: auto; width: auto;
} }
.daterangepicker .ranges { .daterangepicker .ranges {
float: left; float: left;
} }
.daterangepicker.rtl .ranges { .daterangepicker.rtl .ranges {
float: right; float: right;
} }
.daterangepicker .drp-calendar.left { .daterangepicker .drp-calendar.left {
clear: none !important; clear: none !important;
} }
} }

3156
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/bootstrap-daterangepicker/daterangepicker.js

File diff suppressed because it is too large

10
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/bootstrap/js/bootstrap.enable.popovers.everywhere.js

@ -1,5 +1,5 @@
(function () { (function () {
[].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')).map(function (popoverTriggerEl) { [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')).map(function (popoverTriggerEl) {
return new bootstrap.Popover(popoverTriggerEl) return new bootstrap.Popover(popoverTriggerEl)
}) })
})(); })();

10
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/bootstrap/js/bootstrap.enable.tooltips.everywhere.js

@ -1,5 +1,5 @@
(function () { (function () {
[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function (tooltipTriggerEl) { [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl) return new bootstrap.Tooltip(tooltipTriggerEl)
}); });
})(); })();

0
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/codemirror/mode/sas/sas.js

42
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/jquery-form/jquery.form.min.js

File diff suppressed because one or more lines are too long

864
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js

@ -1,432 +1,432 @@
// Unobtrusive validation support library for jQuery and jQuery Validate // Unobtrusive validation support library for jQuery and jQuery Validate
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// @version v3.2.12 // @version v3.2.12
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */ /*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
/*global document: false, jQuery: false */ /*global document: false, jQuery: false */
(function (factory) { (function (factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define("jquery.validate.unobtrusive", ['jquery-validation'], factory); define("jquery.validate.unobtrusive", ['jquery-validation'], factory);
} else if (typeof module === 'object' && module.exports) { } else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports // CommonJS-like environments that support module.exports
module.exports = factory(require('jquery-validation')); module.exports = factory(require('jquery-validation'));
} else { } else {
// Browser global // Browser global
jQuery.validator.unobtrusive = factory(jQuery); jQuery.validator.unobtrusive = factory(jQuery);
} }
}(function ($) { }(function ($) {
var $jQval = $.validator, var $jQval = $.validator,
adapters, adapters,
data_validation = "unobtrusiveValidation"; data_validation = "unobtrusiveValidation";
function setValidationValues(options, ruleName, value) { function setValidationValues(options, ruleName, value) {
options.rules[ruleName] = value; options.rules[ruleName] = value;
if (options.message) { if (options.message) {
options.messages[ruleName] = options.message; options.messages[ruleName] = options.message;
} }
} }
function splitAndTrim(value) { function splitAndTrim(value) {
return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g); return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g);
} }
function escapeAttributeValue(value) { function escapeAttributeValue(value) {
// As mentioned on http://api.jquery.com/category/selectors/ // As mentioned on http://api.jquery.com/category/selectors/
return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1"); return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1");
} }
function getModelPrefix(fieldName) { function getModelPrefix(fieldName) {
return fieldName.substr(0, fieldName.lastIndexOf(".") + 1); return fieldName.substr(0, fieldName.lastIndexOf(".") + 1);
} }
function appendModelPrefix(value, prefix) { function appendModelPrefix(value, prefix) {
if (value.indexOf("*.") === 0) { if (value.indexOf("*.") === 0) {
value = value.replace("*.", prefix); value = value.replace("*.", prefix);
} }
return value; return value;
} }
function onError(error, inputElement) { // 'this' is the form element function onError(error, inputElement) { // 'this' is the form element
var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"), var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"),
replaceAttrValue = container.attr("data-valmsg-replace"), replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null; replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null;
container.removeClass("field-validation-valid").addClass("field-validation-error"); container.removeClass("field-validation-valid").addClass("field-validation-error");
error.data("unobtrusiveContainer", container); error.data("unobtrusiveContainer", container);
if (replace) { if (replace) {
container.empty(); container.empty();
error.removeClass("input-validation-error").appendTo(container); error.removeClass("input-validation-error").appendTo(container);
} }
else { else {
error.hide(); error.hide();
} }
} }
function onErrors(event, validator) { // 'this' is the form element function onErrors(event, validator) { // 'this' is the form element
var container = $(this).find("[data-valmsg-summary=true]"), var container = $(this).find("[data-valmsg-summary=true]"),
list = container.find("ul"); list = container.find("ul");
if (list && list.length && validator.errorList.length) { if (list && list.length && validator.errorList.length) {
list.empty(); list.empty();
container.addClass("validation-summary-errors").removeClass("validation-summary-valid"); container.addClass("validation-summary-errors").removeClass("validation-summary-valid");
$.each(validator.errorList, function () { $.each(validator.errorList, function () {
$("<li />").html(this.message).appendTo(list); $("<li />").html(this.message).appendTo(list);
}); });
} }
} }
function onSuccess(error) { // 'this' is the form element function onSuccess(error) { // 'this' is the form element
var container = error.data("unobtrusiveContainer"); var container = error.data("unobtrusiveContainer");
if (container) { if (container) {
var replaceAttrValue = container.attr("data-valmsg-replace"), var replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null; replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null;
container.addClass("field-validation-valid").removeClass("field-validation-error"); container.addClass("field-validation-valid").removeClass("field-validation-error");
error.removeData("unobtrusiveContainer"); error.removeData("unobtrusiveContainer");
if (replace) { if (replace) {
container.empty(); container.empty();
} }
} }
} }
function onReset(event) { // 'this' is the form element function onReset(event) { // 'this' is the form element
var $form = $(this), var $form = $(this),
key = '__jquery_unobtrusive_validation_form_reset'; key = '__jquery_unobtrusive_validation_form_reset';
if ($form.data(key)) { if ($form.data(key)) {
return; return;
} }
// Set a flag that indicates we're currently resetting the form. // Set a flag that indicates we're currently resetting the form.
$form.data(key, true); $form.data(key, true);
try { try {
$form.data("validator").resetForm(); $form.data("validator").resetForm();
} finally { } finally {
$form.removeData(key); $form.removeData(key);
} }
$form.find(".validation-summary-errors") $form.find(".validation-summary-errors")
.addClass("validation-summary-valid") .addClass("validation-summary-valid")
.removeClass("validation-summary-errors"); .removeClass("validation-summary-errors");
$form.find(".field-validation-error") $form.find(".field-validation-error")
.addClass("field-validation-valid") .addClass("field-validation-valid")
.removeClass("field-validation-error") .removeClass("field-validation-error")
.removeData("unobtrusiveContainer") .removeData("unobtrusiveContainer")
.find(">*") // If we were using valmsg-replace, get the underlying error .find(">*") // If we were using valmsg-replace, get the underlying error
.removeData("unobtrusiveContainer"); .removeData("unobtrusiveContainer");
} }
function validationInfo(form) { function validationInfo(form) {
var $form = $(form), var $form = $(form),
result = $form.data(data_validation), result = $form.data(data_validation),
onResetProxy = $.proxy(onReset, form), onResetProxy = $.proxy(onReset, form),
defaultOptions = $jQval.unobtrusive.options || {}, defaultOptions = $jQval.unobtrusive.options || {},
execInContext = function (name, args) { execInContext = function (name, args) {
var func = defaultOptions[name]; var func = defaultOptions[name];
func && $.isFunction(func) && func.apply(form, args); func && $.isFunction(func) && func.apply(form, args);
}; };
if (!result) { if (!result) {
result = { result = {
options: { // options structure passed to jQuery Validate's validate() method options: { // options structure passed to jQuery Validate's validate() method
errorClass: defaultOptions.errorClass || "input-validation-error", errorClass: defaultOptions.errorClass || "input-validation-error",
errorElement: defaultOptions.errorElement || "span", errorElement: defaultOptions.errorElement || "span",
errorPlacement: function () { errorPlacement: function () {
onError.apply(form, arguments); onError.apply(form, arguments);
execInContext("errorPlacement", arguments); execInContext("errorPlacement", arguments);
}, },
invalidHandler: function () { invalidHandler: function () {
onErrors.apply(form, arguments); onErrors.apply(form, arguments);
execInContext("invalidHandler", arguments); execInContext("invalidHandler", arguments);
}, },
messages: {}, messages: {},
rules: {}, rules: {},
success: function () { success: function () {
onSuccess.apply(form, arguments); onSuccess.apply(form, arguments);
execInContext("success", arguments); execInContext("success", arguments);
} }
}, },
attachValidation: function () { attachValidation: function () {
$form $form
.off("reset." + data_validation, onResetProxy) .off("reset." + data_validation, onResetProxy)
.on("reset." + data_validation, onResetProxy) .on("reset." + data_validation, onResetProxy)
.validate(this.options); .validate(this.options);
}, },
validate: function () { // a validation function that is called by unobtrusive Ajax validate: function () { // a validation function that is called by unobtrusive Ajax
$form.validate(); $form.validate();
return $form.valid(); return $form.valid();
} }
}; };
$form.data(data_validation, result); $form.data(data_validation, result);
} }
return result; return result;
} }
$jQval.unobtrusive = { $jQval.unobtrusive = {
adapters: [], adapters: [],
parseElement: function (element, skipAttach) { parseElement: function (element, skipAttach) {
/// <summary> /// <summary>
/// Parses a single HTML element for unobtrusive validation attributes. /// Parses a single HTML element for unobtrusive validation attributes.
/// </summary> /// </summary>
/// <param name="element" domElement="true">The HTML element to be parsed.</param> /// <param name="element" domElement="true">The HTML element to be parsed.</param>
/// <param name="skipAttach" type="Boolean">[Optional] true to skip attaching the /// <param name="skipAttach" type="Boolean">[Optional] true to skip attaching the
/// validation to the form. If parsing just this single element, you should specify true. /// validation to the form. If parsing just this single element, you should specify true.
/// If parsing several elements, you should specify false, and manually attach the validation /// If parsing several elements, you should specify false, and manually attach the validation
/// to the form when you are finished. The default is false.</param> /// to the form when you are finished. The default is false.</param>
var $element = $(element), var $element = $(element),
form = $element.parents("form")[0], form = $element.parents("form")[0],
valInfo, rules, messages; valInfo, rules, messages;
if (!form) { // Cannot do client-side validation without a form if (!form) { // Cannot do client-side validation without a form
return; return;
} }
valInfo = validationInfo(form); valInfo = validationInfo(form);
valInfo.options.rules[element.name] = rules = {}; valInfo.options.rules[element.name] = rules = {};
valInfo.options.messages[element.name] = messages = {}; valInfo.options.messages[element.name] = messages = {};
$.each(this.adapters, function () { $.each(this.adapters, function () {
var prefix = "data-val-" + this.name, var prefix = "data-val-" + this.name,
message = $element.attr(prefix), message = $element.attr(prefix),
paramValues = {}; paramValues = {};
if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy) if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy)
prefix += "-"; prefix += "-";
$.each(this.params, function () { $.each(this.params, function () {
paramValues[this] = $element.attr(prefix + this); paramValues[this] = $element.attr(prefix + this);
}); });
this.adapt({ this.adapt({
element: element, element: element,
form: form, form: form,
message: message, message: message,
params: paramValues, params: paramValues,
rules: rules, rules: rules,
messages: messages messages: messages
}); });
} }
}); });
$.extend(rules, { "__dummy__": true }); $.extend(rules, { "__dummy__": true });
if (!skipAttach) { if (!skipAttach) {
valInfo.attachValidation(); valInfo.attachValidation();
} }
}, },
parse: function (selector) { parse: function (selector) {
/// <summary> /// <summary>
/// Parses all the HTML elements in the specified selector. It looks for input elements decorated /// Parses all the HTML elements in the specified selector. It looks for input elements decorated
/// with the [data-val=true] attribute value and enables validation according to the data-val-* /// with the [data-val=true] attribute value and enables validation according to the data-val-*
/// attribute values. /// attribute values.
/// </summary> /// </summary>
/// <param name="selector" type="String">Any valid jQuery selector.</param> /// <param name="selector" type="String">Any valid jQuery selector.</param>
// $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one // $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one
// element with data-val=true // element with data-val=true
var $selector = $(selector), var $selector = $(selector),
$forms = $selector.parents() $forms = $selector.parents()
.addBack() .addBack()
.filter("form") .filter("form")
.add($selector.find("form")) .add($selector.find("form"))
.has("[data-val=true]"); .has("[data-val=true]");
$selector.find("[data-val=true]").each(function () { $selector.find("[data-val=true]").each(function () {
$jQval.unobtrusive.parseElement(this, true); $jQval.unobtrusive.parseElement(this, true);
}); });
$forms.each(function () { $forms.each(function () {
var info = validationInfo(this); var info = validationInfo(this);
if (info) { if (info) {
info.attachValidation(); info.attachValidation();
} }
}); });
} }
}; };
adapters = $jQval.unobtrusive.adapters; adapters = $jQval.unobtrusive.adapters;
adapters.add = function (adapterName, params, fn) { adapters.add = function (adapterName, params, fn) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary> /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used /// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param> /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
/// <param name="params" type="Array" optional="true">[Optional] An array of parameter names (strings) that will /// <param name="params" type="Array" optional="true">[Optional] An array of parameter names (strings) that will
/// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and /// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and
/// mmmm is the parameter name).</param> /// mmmm is the parameter name).</param>
/// <param name="fn" type="Function">The function to call, which adapts the values from the HTML /// <param name="fn" type="Function">The function to call, which adapts the values from the HTML
/// attributes into jQuery Validate rules and/or messages.</param> /// attributes into jQuery Validate rules and/or messages.</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" /> /// <returns type="jQuery.validator.unobtrusive.adapters" />
if (!fn) { // Called with no params, just a function if (!fn) { // Called with no params, just a function
fn = params; fn = params;
params = []; params = [];
} }
this.push({ name: adapterName, params: params, adapt: fn }); this.push({ name: adapterName, params: params, adapt: fn });
return this; return this;
}; };
adapters.addBool = function (adapterName, ruleName) { adapters.addBool = function (adapterName, ruleName) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
/// the jQuery Validate validation rule has no parameter values.</summary> /// the jQuery Validate validation rule has no parameter values.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used /// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param> /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value /// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
/// of adapterName will be used instead.</param> /// of adapterName will be used instead.</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" /> /// <returns type="jQuery.validator.unobtrusive.adapters" />
return this.add(adapterName, function (options) { return this.add(adapterName, function (options) {
setValidationValues(options, ruleName || adapterName, true); setValidationValues(options, ruleName || adapterName, true);
}); });
}; };
adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) { adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
/// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and /// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and
/// one for min-and-max). The HTML parameters are expected to be named -min and -max.</summary> /// one for min-and-max). The HTML parameters are expected to be named -min and -max.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used /// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param> /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
/// <param name="minRuleName" type="String">The name of the jQuery Validate rule to be used when you only /// <param name="minRuleName" type="String">The name of the jQuery Validate rule to be used when you only
/// have a minimum value.</param> /// have a minimum value.</param>
/// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only /// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only
/// have a maximum value.</param> /// have a maximum value.</param>
/// <param name="minMaxRuleName" type="String">The name of the jQuery Validate rule to be used when you /// <param name="minMaxRuleName" type="String">The name of the jQuery Validate rule to be used when you
/// have both a minimum and maximum value.</param> /// have both a minimum and maximum value.</param>
/// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that /// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
/// contains the minimum value. The default is "min".</param> /// contains the minimum value. The default is "min".</param>
/// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that /// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
/// contains the maximum value. The default is "max".</param> /// contains the maximum value. The default is "max".</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" /> /// <returns type="jQuery.validator.unobtrusive.adapters" />
return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) { return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) {
var min = options.params.min, var min = options.params.min,
max = options.params.max; max = options.params.max;
if (min && max) { if (min && max) {
setValidationValues(options, minMaxRuleName, [min, max]); setValidationValues(options, minMaxRuleName, [min, max]);
} }
else if (min) { else if (min) {
setValidationValues(options, minRuleName, min); setValidationValues(options, minRuleName, min);
} }
else if (max) { else if (max) {
setValidationValues(options, maxRuleName, max); setValidationValues(options, maxRuleName, max);
} }
}); });
}; };
adapters.addSingleVal = function (adapterName, attribute, ruleName) { adapters.addSingleVal = function (adapterName, attribute, ruleName) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
/// the jQuery Validate validation rule has a single value.</summary> /// the jQuery Validate validation rule has a single value.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used /// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute(where nnnn is the adapter name).</param> /// in the data-val-nnnn HTML attribute(where nnnn is the adapter name).</param>
/// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value. /// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value.
/// The default is "val".</param> /// The default is "val".</param>
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value /// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
/// of adapterName will be used instead.</param> /// of adapterName will be used instead.</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" /> /// <returns type="jQuery.validator.unobtrusive.adapters" />
return this.add(adapterName, [attribute || "val"], function (options) { return this.add(adapterName, [attribute || "val"], function (options) {
setValidationValues(options, ruleName || adapterName, options.params[attribute]); setValidationValues(options, ruleName || adapterName, options.params[attribute]);
}); });
}; };
$jQval.addMethod("__dummy__", function (value, element, params) { $jQval.addMethod("__dummy__", function (value, element, params) {
return true; return true;
}); });
$jQval.addMethod("regex", function (value, element, params) { $jQval.addMethod("regex", function (value, element, params) {
var match; var match;
if (this.optional(element)) { if (this.optional(element)) {
return true; return true;
} }
match = new RegExp(params).exec(value); match = new RegExp(params).exec(value);
return (match && (match.index === 0) && (match[0].length === value.length)); return (match && (match.index === 0) && (match[0].length === value.length));
}); });
$jQval.addMethod("nonalphamin", function (value, element, nonalphamin) { $jQval.addMethod("nonalphamin", function (value, element, nonalphamin) {
var match; var match;
if (nonalphamin) { if (nonalphamin) {
match = value.match(/\W/g); match = value.match(/\W/g);
match = match && match.length >= nonalphamin; match = match && match.length >= nonalphamin;
} }
return match; return match;
}); });
if ($jQval.methods.extension) { if ($jQval.methods.extension) {
adapters.addSingleVal("accept", "mimtype"); adapters.addSingleVal("accept", "mimtype");
adapters.addSingleVal("extension", "extension"); adapters.addSingleVal("extension", "extension");
} else { } else {
// for backward compatibility, when the 'extension' validation method does not exist, such as with versions // for backward compatibility, when the 'extension' validation method does not exist, such as with versions
// of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for // of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for
// validating the extension, and ignore mime-type validations as they are not supported. // validating the extension, and ignore mime-type validations as they are not supported.
adapters.addSingleVal("extension", "extension", "accept"); adapters.addSingleVal("extension", "extension", "accept");
} }
adapters.addSingleVal("regex", "pattern"); adapters.addSingleVal("regex", "pattern");
adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"); adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");
adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range"); adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range");
adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength"); adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength");
adapters.add("equalto", ["other"], function (options) { adapters.add("equalto", ["other"], function (options) {
var prefix = getModelPrefix(options.element.name), var prefix = getModelPrefix(options.element.name),
other = options.params.other, other = options.params.other,
fullOtherName = appendModelPrefix(other, prefix), fullOtherName = appendModelPrefix(other, prefix),
element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0]; element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0];
setValidationValues(options, "equalTo", element); setValidationValues(options, "equalTo", element);
}); });
adapters.add("required", function (options) { adapters.add("required", function (options) {
// jQuery Validate equates "required" with "mandatory" for checkbox elements // jQuery Validate equates "required" with "mandatory" for checkbox elements
if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") { if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") {
setValidationValues(options, "required", true); setValidationValues(options, "required", true);
} }
}); });
adapters.add("remote", ["url", "type", "additionalfields"], function (options) { adapters.add("remote", ["url", "type", "additionalfields"], function (options) {
var value = { var value = {
url: options.params.url, url: options.params.url,
type: options.params.type || "GET", type: options.params.type || "GET",
data: {} data: {}
}, },
prefix = getModelPrefix(options.element.name); prefix = getModelPrefix(options.element.name);
$.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) { $.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) {
var paramName = appendModelPrefix(fieldName, prefix); var paramName = appendModelPrefix(fieldName, prefix);
value.data[paramName] = function () { value.data[paramName] = function () {
var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']"); var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']");
// For checkboxes and radio buttons, only pick up values from checked fields. // For checkboxes and radio buttons, only pick up values from checked fields.
if (field.is(":checkbox")) { if (field.is(":checkbox")) {
return field.filter(":checked").val() || field.filter(":hidden").val() || ''; return field.filter(":checked").val() || field.filter(":hidden").val() || '';
} }
else if (field.is(":radio")) { else if (field.is(":radio")) {
return field.filter(":checked").val() || ''; return field.filter(":checked").val() || '';
} }
return field.val(); return field.val();
}; };
}); });
setValidationValues(options, "remote", value); setValidationValues(options, "remote", value);
}); });
adapters.add("password", ["min", "nonalphamin", "regex"], function (options) { adapters.add("password", ["min", "nonalphamin", "regex"], function (options) {
if (options.params.min) { if (options.params.min) {
setValidationValues(options, "minlength", options.params.min); setValidationValues(options, "minlength", options.params.min);
} }
if (options.params.nonalphamin) { if (options.params.nonalphamin) {
setValidationValues(options, "nonalphamin", options.params.nonalphamin); setValidationValues(options, "nonalphamin", options.params.nonalphamin);
} }
if (options.params.regex) { if (options.params.regex) {
setValidationValues(options, "regex", options.params.regex); setValidationValues(options, "regex", options.params.regex);
} }
}); });
adapters.add("fileextensions", ["extensions"], function (options) { adapters.add("fileextensions", ["extensions"], function (options) {
setValidationValues(options, "extension", options.params.extensions); setValidationValues(options, "extension", options.params.extensions);
}); });
$(function () { $(function () {
$jQval.unobtrusive.parse(document); $jQval.unobtrusive.parse(document);
}); });
return $jQval.unobtrusive; return $jQval.unobtrusive;
})); }));

46
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/tui-editor/toastui-editor-all.min.js

File diff suppressed because one or more lines are too long

28
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/tui-editor/toastui-editor-plugin-code-syntax-highlight-all.min.js

File diff suppressed because one or more lines are too long

342
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/tui-editor/toastui-editor-plugin-code-syntax-highlight.min.css

@ -1,171 +1,171 @@
/*! /*!
* TOAST UI Editor : Code Syntax Highlight Plugin * TOAST UI Editor : Code Syntax Highlight Plugin
* @version 3.0.0 | Thu Jun 17 2021 * @version 3.0.0 | Thu Jun 17 2021
* @author NHN FE Development Lab <dl_javascript@nhn.com> * @author NHN FE Development Lab <dl_javascript@nhn.com>
* @license MIT * @license MIT
*/ */
/* prevent to create draggable box in IE with prism */ /* prevent to create draggable box in IE with prism */
pre[class*="language-"] { pre[class*="language-"] {
overflow: visible; overflow: visible;
} }
.toastui-editor-ww-code-block-highlighting { .toastui-editor-ww-code-block-highlighting {
position: relative; position: relative;
} }
.toastui-editor-ww-code-block-highlighting:after { .toastui-editor-ww-code-block-highlighting:after {
content: attr(data-language); content: attr(data-language);
position: absolute; position: absolute;
display: inline-block; display: inline-block;
top: 10px; top: 10px;
right: 10px; right: 10px;
height: 24px; height: 24px;
padding: 3px 30px 0 10px; padding: 3px 30px 0 10px;
font-weight: bold; font-weight: bold;
font-size: 13px; font-size: 13px;
color: #333; color: #333;
background-color: #e5e9ea; background-color: #e5e9ea;
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMzAgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMwIDMwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6IzU1NTU1NTt9Cjwvc3R5bGU+CjxnPgoJPGc+CgkJPGc+CgkJCTxnPgoJCQkJPGc+CgkJCQkJPHBhdGggY2xhc3M9InN0MCIgZD0iTTE1LjUsMTIuNWwyLDJMMTIsMjBoLTJ2LTJMMTUuNSwxMi41eiBNMTgsMTBsMiwybC0xLjUsMS41bC0yLTJMMTgsMTB6Ii8+CgkJCQk8L2c+CgkJCTwvZz4KCQk8L2c+Cgk8L2c+CjwvZz4KPC9zdmc+Cg=='); background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMzAgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMwIDMwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6IzU1NTU1NTt9Cjwvc3R5bGU+CjxnPgoJPGc+CgkJPGc+CgkJCTxnPgoJCQkJPGc+CgkJCQkJPHBhdGggY2xhc3M9InN0MCIgZD0iTTE1LjUsMTIuNWwyLDJMMTIsMjBoLTJ2LTJMMTUuNSwxMi41eiBNMTgsMTBsMiwybC0xLjUsMS41bC0yLTJMMTgsMTB6Ii8+CgkJCQk8L2c+CgkJCTwvZz4KCQk8L2c+Cgk8L2c+CjwvZz4KPC9zdmc+Cg==');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: right; background-position: right;
background-size: 30px 30px; background-size: 30px 30px;
border-radius: 2px; border-radius: 2px;
cursor: pointer; cursor: pointer;
} }
.toastui-editor-code-block-language { .toastui-editor-code-block-language {
position: fixed; position: fixed;
display: inline-block; display: inline-block;
right: 35px; right: 35px;
z-index: 100; z-index: 100;
} }
.toastui-editor-code-block-language-input { .toastui-editor-code-block-language-input {
position: relative; position: relative;
display: inline-block; display: inline-block;
padding: 0 22px 0 10px; padding: 0 22px 0 10px;
width: 112px; width: 112px;
height: 26px; height: 26px;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 2px; border-radius: 2px;
background-color: #fff; background-color: #fff;
cursor: pointer; cursor: pointer;
} }
.toastui-editor-code-block-language-input input { .toastui-editor-code-block-language-input input {
margin: 0; margin: 0;
padding: 0; padding: 0;
height: 100%; height: 100%;
width: 100%; width: 100%;
background-color: #fff; background-color: #fff;
color: #222; color: #222;
border: none; border: none;
outline: none; outline: none;
} }
.toastui-editor-code-block-language-input input::placeholder { .toastui-editor-code-block-language-input input::placeholder {
color: #ccc; color: #ccc;
} }
.toastui-editor-code-block-language-input input::-ms-clear { .toastui-editor-code-block-language-input input::-ms-clear {
display: none; display: none;
} }
.toastui-editor-code-block-language .toastui-editor-code-block-language-input::after { .toastui-editor-code-block-language .toastui-editor-code-block-language-input::after {
content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6IzIyMjIyMjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLWQtc2lkZSI+CgkJPHBvbHlnb24gaWQ9IlJlY3RhbmdsZS03IiBjbGFzcz0ic3QwIiBwb2ludHM9IjIsNSAxMCw1IDYsMTAgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K'); content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6IzIyMjIyMjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLWQtc2lkZSI+CgkJPHBvbHlnb24gaWQ9IlJlY3RhbmdsZS03IiBjbGFzcz0ic3QwIiBwb2ludHM9IjIsNSAxMCw1IDYsMTAgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K');
position: absolute; position: absolute;
display: inline-block; display: inline-block;
top: 7px; top: 7px;
right: 5px; right: 5px;
width: 12px; width: 12px;
height: 14px; height: 14px;
} }
.toastui-editor-code-block-language.active .toastui-editor-code-block-language-input::after { .toastui-editor-code-block-language.active .toastui-editor-code-block-language-input::after {
content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6IzIyMjIyMjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLXVwLXNpZGUiPgoJCTxwb2x5Z29uIGlkPSJSZWN0YW5nbGUtNyIgY2xhc3M9InN0MCIgcG9pbnRzPSIyLDkgMTAsOSA2LDQgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K'); content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6IzIyMjIyMjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLXVwLXNpZGUiPgoJCTxwb2x5Z29uIGlkPSJSZWN0YW5nbGUtNyIgY2xhc3M9InN0MCIgcG9pbnRzPSIyLDkgMTAsOSA2LDQgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K');
} }
.toastui-editor-code-block-language-list { .toastui-editor-code-block-language-list {
position: fixed; position: fixed;
margin-top: -1px; margin-top: -1px;
width: 144px; width: 144px;
border: solid 1px #ccc; border: solid 1px #ccc;
border-bottom-left-radius: 2px; border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px; border-bottom-right-radius: 2px;
} }
.toastui-editor-code-block-language-list .buttons { .toastui-editor-code-block-language-list .buttons {
max-height: 169px; max-height: 169px;
overflow: auto; overflow: auto;
padding: 0; padding: 0;
} }
.toastui-editor-code-block-language-list button { .toastui-editor-code-block-language-list button {
width: 100%; width: 100%;
background-color: #fff; background-color: #fff;
border: none; border: none;
outline: 0; outline: 0;
padding: 0 10px; padding: 0 10px;
font-size: 13px; font-size: 13px;
line-height: 24px; line-height: 24px;
text-align: left; text-align: left;
color: #222; color: #222;
cursor: pointer; cursor: pointer;
} }
.toastui-editor-code-block-language-list button.active { .toastui-editor-code-block-language-list button.active {
color: #4b96e6; color: #4b96e6;
font-weight: bold; font-weight: bold;
} }
.toastui-editor-code-block-language-list button:hover { .toastui-editor-code-block-language-list button:hover {
background-color: #f4f7f8; background-color: #f4f7f8;
} }
.toastui-editor-dark .toastui-editor-code-block-language-input input::placeholder { .toastui-editor-dark .toastui-editor-code-block-language-input input::placeholder {
color: #eee; color: #eee;
} }
.toastui-editor-dark .toastui-editor-ww-code-block-highlighting:after { .toastui-editor-dark .toastui-editor-ww-code-block-highlighting:after {
background-color: #232428; background-color: #232428;
border: 1px solid #393b42; border: 1px solid #393b42;
color: #eee; color: #eee;
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMzAgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMwIDMwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6I2ZmZjt9Cjwvc3R5bGU+CjxnPgoJPGc+CgkJPGc+CgkJCTxnPgoJCQkJPGc+CgkJCQkJPHBhdGggY2xhc3M9InN0MCIgZD0iTTE1LjUsMTIuNWwyLDJMMTIsMjBoLTJ2LTJMMTUuNSwxMi41eiBNMTgsMTBsMiwybC0xLjUsMS41bC0yLTJMMTgsMTB6Ii8+CgkJCQk8L2c+CgkJCTwvZz4KCQk8L2c+Cgk8L2c+CjwvZz4KPC9zdmc+Cg=='); background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMzAgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMwIDMwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6I2ZmZjt9Cjwvc3R5bGU+CjxnPgoJPGc+CgkJPGc+CgkJCTxnPgoJCQkJPGc+CgkJCQkJPHBhdGggY2xhc3M9InN0MCIgZD0iTTE1LjUsMTIuNWwyLDJMMTIsMjBoLTJ2LTJMMTUuNSwxMi41eiBNMTgsMTBsMiwybC0xLjUsMS41bC0yLTJMMTgsMTB6Ii8+CgkJCQk8L2c+CgkJCTwvZz4KCQk8L2c+Cgk8L2c+CjwvZz4KPC9zdmc+Cg==');
} }
.toastui-editor-dark .toastui-editor-code-block-language span { .toastui-editor-dark .toastui-editor-code-block-language span {
border: 1px solid #494c56; border: 1px solid #494c56;
background-color: #121212; background-color: #121212;
} }
.toastui-editor-dark .toastui-editor-code-block-language input { .toastui-editor-dark .toastui-editor-code-block-language input {
background-color: #121212; background-color: #121212;
color: #eee; color: #eee;
} }
.toastui-editor-dark .toastui-editor-code-block-language-list { .toastui-editor-dark .toastui-editor-code-block-language-list {
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08); box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
border: 1px solid #494c56; border: 1px solid #494c56;
border-radius: 2px; border-radius: 2px;
} }
.toastui-editor-dark .toastui-editor-code-block-language-list button { .toastui-editor-dark .toastui-editor-code-block-language-list button {
color: #eee; color: #eee;
background-color: #121212; background-color: #121212;
} }
.toastui-editor-dark .toastui-editor-code-block-language-list button.active { .toastui-editor-dark .toastui-editor-code-block-language-list button.active {
color: #4b96e6; color: #4b96e6;
} }
.toastui-editor-dark .toastui-editor-code-block-language-list button:hover { .toastui-editor-dark .toastui-editor-code-block-language-list button:hover {
background-color: #36383f; background-color: #36383f;
} }
.toastui-editor-dark .toastui-editor-code-block-language .toastui-editor-code-block-language-input::after { .toastui-editor-dark .toastui-editor-code-block-language .toastui-editor-code-block-language-input::after {
content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6I2ZmZjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLWQtc2lkZSI+CgkJPHBvbHlnb24gaWQ9IlJlY3RhbmdsZS03IiBjbGFzcz0ic3QwIiBwb2ludHM9IjIsNSAxMCw1IDYsMTAgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K'); content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6I2ZmZjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLWQtc2lkZSI+CgkJPHBvbHlnb24gaWQ9IlJlY3RhbmdsZS03IiBjbGFzcz0ic3QwIiBwb2ludHM9IjIsNSAxMCw1IDYsMTAgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K');
} }
.toastui-editor-dark .toastui-editor-code-block-language.active .toastui-editor-code-block-language-input::after { .toastui-editor-dark .toastui-editor-code-block-language.active .toastui-editor-code-block-language-input::after {
content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6I2ZmZjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLXVwLXNpZGUiPgoJCTxwb2x5Z29uIGlkPSJSZWN0YW5nbGUtNyIgY2xhc3M9InN0MCIgcG9pbnRzPSIyLDkgMTAsOSA2LDQgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K'); content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6I2ZmZjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLXVwLXNpZGUiPgoJCTxwb2x5Z29uIGlkPSJSZWN0YW5nbGUtNyIgY2xhc3M9InN0MCIgcG9pbnRzPSIyLDkgMTAsOSA2LDQgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K');
} }

12
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/tui-editor/toastui-editor.min.css

File diff suppressed because one or more lines are too long

1392
modules/cms-kit/host/Volo.CmsKit.Web.Unified/yarn.lock

File diff suppressed because it is too large

4
modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentGetListInput.cs

@ -19,7 +19,5 @@ public class CommentGetListInput : PagedAndSortedResultRequestDto
public DateTime? CreationEndDate { get; set; } public DateTime? CreationEndDate { get; set; }
public CommentApproveStateType commentApproveStateType { get; set; } public CommentApproveState CommentApproveState { get; set; }
} }

4
modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentSettingsDto.cs

@ -1,11 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Text;
namespace Volo.CmsKit.Admin.Comments; namespace Volo.CmsKit.Admin.Comments;
[Serializable] [Serializable]
public class SettingsDto public class SettingsDto
{ {
public bool RequireApprovement { get; set; } public bool CommentRequireApprovement { get; set; }
} }

11
modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/ICommentAdminAppService.cs

@ -13,14 +13,13 @@ public interface ICommentAdminAppService : IApplicationService
Task DeleteAsync(Guid id); Task DeleteAsync(Guid id);
Task UpdateApprovalStatusAsync(Guid id, CommentApprovalDto commentApprovalDto); Task UpdateApprovalStatusAsync(Guid id, CommentApprovalDto input);
Task SetSettings(SettingsDto settingsDto); Task SetSettingsAsync(SettingsDto input);
Task<SettingsDto> GetSettings(); Task<SettingsDto> GetSettingsAsync();
Task<int> GetWaitingCommentCount(); Task<int> GetWaitingCountAsync();
Task<PagedResultDto<CommentWithAuthorDto>> GetWaitingCommentsWithRepliesAsync(CommentGetListInput input);
Task<PagedResultDto<CommentWithAuthorDto>> GetWaitingWithRepliesAsync(CommentGetListInput input);
} }

1
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationAutoMapperProfile.cs

@ -34,6 +34,7 @@ public class CmsKitAdminApplicationAutoMapperProfile : Profile
CreateMap<BlogPost, BlogPostListDto>() CreateMap<BlogPost, BlogPostListDto>()
.Ignore(d => d.BlogName) .Ignore(d => d.BlogName)
.MapExtraProperties(); .MapExtraProperties();
CreateMap<CreateBlogPostDto, BlogPost>(MemberList.Source).MapExtraProperties(); CreateMap<CreateBlogPostDto, BlogPost>(MemberList.Source).MapExtraProperties();
CreateMap<UpdateBlogPostDto, BlogPost>(MemberList.Source).MapExtraProperties(); CreateMap<UpdateBlogPostDto, BlogPost>(MemberList.Source).MapExtraProperties();

43
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs

@ -38,7 +38,7 @@ public class CommentAdminAppService : CmsKitAdminAppServiceBase, ICommentAdminAp
input.Author, input.Author,
input.CreationStartDate, input.CreationStartDate,
input.CreationEndDate, input.CreationEndDate,
input.commentApproveStateType input.CommentApproveState
); );
@ -52,7 +52,7 @@ public class CommentAdminAppService : CmsKitAdminAppServiceBase, ICommentAdminAp
input.Sorting, input.Sorting,
input.MaxResultCount, input.MaxResultCount,
input.SkipCount, input.SkipCount,
input.commentApproveStateType input.CommentApproveState
); );
var dtos = comments.Select(queryResultItem => var dtos = comments.Select(queryResultItem =>
@ -85,41 +85,35 @@ public class CommentAdminAppService : CmsKitAdminAppServiceBase, ICommentAdminAp
public async Task UpdateApprovalStatusAsync(Guid id, CommentApprovalDto commentApprovalDto) public async Task UpdateApprovalStatusAsync(Guid id, CommentApprovalDto input)
{ {
var comment = await CommentRepository.GetAsync(id); var comment = await CommentRepository.GetAsync(id);
comment.IsApproved = commentApprovalDto.IsApproved; comment.SetApprovalStatus(input.IsApproved);
await CommentRepository.UpdateAsync(comment); await CommentRepository.UpdateAsync(comment);
} }
public async Task SetSettings(SettingsDto settingsDto) public async Task SetSettingsAsync(SettingsDto input)
{ {
await _settingManager.SetGlobalAsync(AppSettings.RequireApprovement, settingsDto.RequireApprovement.ToString()); await _settingManager.SetGlobalAsync(AppSettings.CommentRequireApprovement, input.CommentRequireApprovement.ToString());
} }
public async Task<SettingsDto> GetSettings() public async Task<SettingsDto> GetSettingsAsync()
{ {
string approvalSettingValue = await _settingManager.GetOrNullGlobalAsync(AppSettings.RequireApprovement); var isRequireApprovementEnabled = bool.Parse(await _settingManager.GetOrNullGlobalAsync(AppSettings.CommentRequireApprovement));
if (bool.TryParse(approvalSettingValue, out bool isApprovalRequired)) return new SettingsDto
{ {
SettingsDto settings = new SettingsDto CommentRequireApprovement = isRequireApprovementEnabled
{ };
RequireApprovement = isApprovalRequired
};
return settings;
}
return null;
} }
public async Task<int> GetWaitingCommentCount()
public async Task<int> GetWaitingCountAsync()
{ {
var count = await CommentRepository.GetCountAsync(commentApproveStateType: CommentApproveStateType.Waiting); return (int) await CommentRepository.GetCountAsync(commentApproveState: CommentApproveState.Waiting);
return (int)(count);
} }
public async Task<PagedResultDto<CommentWithAuthorDto>> GetWaitingCommentsWithRepliesAsync(CommentGetListInput input) public async Task<PagedResultDto<CommentWithAuthorDto>> GetWaitingWithRepliesAsync(CommentGetListInput input)
{ {
var totalCount = await CommentRepository.GetCountAsync( var totalCount = await CommentRepository.GetCountAsync(
input.Text, input.Text,
@ -128,10 +122,9 @@ public class CommentAdminAppService : CmsKitAdminAppServiceBase, ICommentAdminAp
input.Author, input.Author,
input.CreationStartDate, input.CreationStartDate,
input.CreationEndDate, input.CreationEndDate,
CommentApproveStateType.Waiting CommentApproveState.Waiting
); );
var comments = await CommentRepository.GetListAsync( var comments = await CommentRepository.GetListAsync(
input.Text, input.Text,
input.EntityType, input.EntityType,
@ -142,7 +135,7 @@ public class CommentAdminAppService : CmsKitAdminAppServiceBase, ICommentAdminAp
input.Sorting, input.Sorting,
input.MaxResultCount, input.MaxResultCount,
input.SkipCount, input.SkipCount,
CommentApproveStateType.Waiting CommentApproveState.Waiting
); );
var dtos = comments.Select(queryResultItem => var dtos = comments.Select(queryResultItem =>

8
modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/Volo/CmsKit/Admin/Comments/CommentAdminClientProxy.Generated.cs

@ -41,12 +41,12 @@ public partial class CommentAdminClientProxy : ClientProxyBase<ICommentAdminAppS
}); });
} }
public virtual async Task UpdateApprovalStatusAsync(Guid id, CommentApprovalDto commentApprovalDto) public virtual async Task UpdateApprovalStatusAsync(Guid id, CommentApprovalDto input)
{ {
await RequestAsync(nameof(UpdateApprovalStatusAsync), new ClientProxyRequestTypeValue await RequestAsync(nameof(UpdateApprovalStatusAsync), new ClientProxyRequestTypeValue
{ {
{ typeof(Guid), id }, { typeof(Guid), id },
{ typeof(CommentApprovalDto), commentApprovalDto } { typeof(CommentApprovalDto), input }
}); });
} }
@ -68,9 +68,9 @@ public partial class CommentAdminClientProxy : ClientProxyBase<ICommentAdminAppS
throw new System.NotImplementedException(); throw new System.NotImplementedException();
} }
public virtual async Task<PagedResultDto<CommentWithAuthorDto>> GetWaitingCommentsWithRepliesAsync(CommentGetListInput input) public virtual async Task<PagedResultDto<CommentWithAuthorDto>> GetWaitingWithRepliesAsync(CommentGetListInput input)
{ {
return await RequestAsync<PagedResultDto<CommentWithAuthorDto>>(nameof(GetWaitingCommentsWithRepliesAsync), new ClientProxyRequestTypeValue return await RequestAsync<PagedResultDto<CommentWithAuthorDto>>(nameof(GetWaitingWithRepliesAsync), new ClientProxyRequestTypeValue
{ {
{ typeof(CommentGetListInput), input } { typeof(CommentGetListInput), input }
}); });

20
modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Comments/CommentAdminController.cs

@ -52,41 +52,41 @@ public class CommentAdminController : CmsKitAdminController, ICommentAdminAppSer
[HttpPost] [HttpPost]
[Route("{id}")] [Route("{id}")]
[Authorize(CmsKitAdminPermissions.Comments.Update)] [Authorize(CmsKitAdminPermissions.Comments.Update)]
public Task UpdateApprovalStatusAsync(Guid id, CommentApprovalDto commentApprovalDto) public Task UpdateApprovalStatusAsync(Guid id, CommentApprovalDto input)
{ {
return CommentAdminAppService.UpdateApprovalStatusAsync(id, commentApprovalDto); return CommentAdminAppService.UpdateApprovalStatusAsync(id, input);
} }
[HttpPost] [HttpPost]
[Route("settings")] [Route("settings")]
[Authorize(CmsKitAdminPermissions.Comments.Default)] [Authorize(CmsKitAdminPermissions.Comments.Default)]
public Task SetSettings(SettingsDto settingsDto) public Task SetSettingsAsync(SettingsDto input)
{ {
return CommentAdminAppService.SetSettings(settingsDto); return CommentAdminAppService.SetSettingsAsync(input);
} }
[HttpGet] [HttpGet]
[Route("settings")] [Route("settings")]
[Authorize(CmsKitAdminPermissions.Comments.Default)] [Authorize(CmsKitAdminPermissions.Comments.Default)]
public Task<SettingsDto> GetSettings() public Task<SettingsDto> GetSettingsAsync()
{ {
return CommentAdminAppService.GetSettings(); return CommentAdminAppService.GetSettingsAsync();
} }
[HttpGet] [HttpGet]
[Route("waiting-count")] [Route("waiting-count")]
[Authorize(CmsKitAdminPermissions.Comments.Default)] [Authorize(CmsKitAdminPermissions.Comments.Default)]
public Task<int> GetWaitingCommentCount() public Task<int> GetWaitingCountAsync()
{ {
return CommentAdminAppService.GetWaitingCommentCount(); return CommentAdminAppService.GetWaitingCountAsync();
} }
[HttpGet] [HttpGet]
[Route("waiting")] [Route("waiting")]
[Authorize(CmsKitAdminPermissions.Comments.Default)] [Authorize(CmsKitAdminPermissions.Comments.Default)]
public Task<PagedResultDto<CommentWithAuthorDto>> GetWaitingCommentsWithRepliesAsync(CommentGetListInput input) public Task<PagedResultDto<CommentWithAuthorDto>> GetWaitingWithRepliesAsync(CommentGetListInput input)
{ {
return CommentAdminAppService.GetWaitingCommentsWithRepliesAsync(input); return CommentAdminAppService.GetWaitingWithRepliesAsync(input);
} }
} }

26
modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebModule.cs

@ -3,7 +3,9 @@ using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.MarkdownIt;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Prismjs; using Volo.Abp.AspNetCore.Mvc.UI.Packages.Prismjs;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.PageToolbars; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.PageToolbars;
using Volo.Abp.AutoMapper; using Volo.Abp.AutoMapper;
using Volo.Abp.Http.ProxyScripting.Generators.JQuery; using Volo.Abp.Http.ProxyScripting.Generators.JQuery;
@ -57,6 +59,7 @@ public class CmsKitAdminWebModule : AbpModule
{ {
options.MenuContributors.Add(new CmsKitAdminMenuContributor()); options.MenuContributors.Add(new CmsKitAdminMenuContributor());
}); });
Configure<AbpBundlingOptions>(options => Configure<AbpBundlingOptions>(options =>
{ {
options.ScriptBundles options.ScriptBundles
@ -64,8 +67,14 @@ public class CmsKitAdminWebModule : AbpModule
configuration => configuration =>
{ {
configuration.AddFiles("/client-proxies/cms-kit-admin-proxy.js"); configuration.AddFiles("/client-proxies/cms-kit-admin-proxy.js");
})
.Configure(StandardBundles.Scripts.Global,
configuration =>
{
configuration.AddContributors(typeof(MarkdownItScriptContributor));
}); });
}); });
Configure<AbpVirtualFileSystemOptions>(options => Configure<AbpVirtualFileSystemOptions>(options =>
{ {
options.FileSets.AddEmbedded<CmsKitAdminWebModule>("Volo.CmsKit.Admin.Web"); options.FileSets.AddEmbedded<CmsKitAdminWebModule>("Volo.CmsKit.Admin.Web");
@ -96,6 +105,7 @@ public class CmsKitAdminWebModule : AbpModule
options.Conventions.AuthorizePage("/CmsKit/Menus/MenuItems/UpdateModal", CmsKitAdminPermissions.Menus.Update); options.Conventions.AuthorizePage("/CmsKit/Menus/MenuItems/UpdateModal", CmsKitAdminPermissions.Menus.Update);
options.Conventions.AuthorizeFolder("/CmsKit/Menus/MenuItems", CmsKitAdminPermissions.Menus.Update); options.Conventions.AuthorizeFolder("/CmsKit/Menus/MenuItems", CmsKitAdminPermissions.Menus.Update);
options.Conventions.AuthorizeFolder("/CmsKit/GlobalResources", CmsKitAdminPermissions.GlobalResources.Default); options.Conventions.AuthorizeFolder("/CmsKit/GlobalResources", CmsKitAdminPermissions.GlobalResources.Default);
// TODO: Add /CmsKit/Comments/Approve/Index page
}); });
Configure<RazorPagesOptions>(options => Configure<RazorPagesOptions>(options =>
@ -179,21 +189,7 @@ public class CmsKitAdminWebModule : AbpModule
}); });
}); });
//Configure<AbpBundleContributorOptions>(options =>
//{
// options
// .Extensions<PrismjsScriptBundleContributor>()
// .Add<PrismjsScriptBundleContributorDocsExtension>();
//});
Configure<AbpBundlingOptions>(options =>
{
options.ScriptBundles.Configure(
"Volo.Abp.AspNetCore.Mvc.UI.Packages.MarkdownIt.MarkdownItScriptContributor",
bundle =>
{
bundle.AddFiles("/libs/markdown-it/markdown-it.min.js");
});
});
Configure<DynamicJavaScriptProxyOptions>(options => Configure<DynamicJavaScriptProxyOptions>(options =>
{ {
options.DisableModule(CmsKitAdminRemoteServiceConsts.ModuleName); options.DisableModule(CmsKitAdminRemoteServiceConsts.ModuleName);

5
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Approve/Index.cshtml

@ -29,13 +29,10 @@
<abp-script src="/client-proxies/cms-kit-common-proxy.js" /> <abp-script src="/client-proxies/cms-kit-common-proxy.js" />
<abp-script src="/client-proxies/cms-kit-admin-proxy.js" /> <abp-script src="/client-proxies/cms-kit-admin-proxy.js" />
<abp-script src="/Pages/CmsKit/Comments/Approve/index.js" /> <abp-script src="/Pages/CmsKit/Comments/Approve/index.js" />
<abp-script type="typeof(MarkdownItScriptContributor)" />
</abp-script-bundle> </abp-script-bundle>
<abp-script type="typeof(MarkdownItScriptContributor)" />
@* <script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js"></script> *@
} }
<abp-card class="mb-4"> <abp-card class="mb-4">
<abp-card-body> <abp-card-body>
<div id="CmsKitCommentsWrapper"> <div id="CmsKitCommentsWrapper">

1
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Approve/Index.cshtml.cs

@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.Comments.Approve; namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.Comments.Approve;
public class IndexModel : CmsKitAdminPageModel public class IndexModel : CmsKitAdminPageModel
{ {
public string EntityType { get; set; } public string EntityType { get; set; }

17
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Approve/PrismjsScriptBundleContributorDocsExtension.cs

@ -1,17 +0,0 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.Comments.Approve;
public class PrismjsScriptBundleContributorDocsExtension : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
//AddPlugins(context);
context.Files.Add("~/libs/markdown-it/markdown-it.min.js");
}
//private static void AddPlugins(IBundleConfigurationContext context)
//{
// context.Files.AddIfNotContains("/libs/markdown-it/markdown-it.min.js");
//}
}

312
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Approve/index.js

@ -1,177 +1,173 @@
 $(function () {
var l = abp.localization.getResource("CmsKit");
$(function () { var commentsService = volo.cmsKit.admin.comments.commentAdmin;
var l = abp.localization.getResource("CmsKit"); var detailsModal = new abp.ModalManager(abp.appPath + "CmsKit/Comments/DetailsModal");
var commentsService = volo.cmsKit.admin.comments.commentAdmin; moment()._locale.preparse = (string) => string;
moment()._locale.postformat = (string) => string;
var detailsModal = new abp.ModalManager(abp.appPath + "CmsKit/Comments/DetailsModal"); var getFormattedDate = function ($datePicker) {
if (!$datePicker.val()) {
return null;
}
var momentDate = moment($datePicker.val(), $datePicker.data('daterangepicker').locale.format);
return momentDate.isValid() ? momentDate.toISOString() : null;
};
$('.singledatepicker').daterangepicker({
"singleDatePicker": true,
"showDropdowns": true,
"autoUpdateInput": false,
"autoApply": true,
"opens": "center",
"drops": "auto"
});
moment()._locale.preparse = (string) => string;
moment()._locale.postformat = (string) => string;
var getFormattedDate = function ($datePicker) { $('.singledatepicker').attr('autocomplete', 'off');
if (!$datePicker.val()) {
return null; $('.singledatepicker').on('apply.daterangepicker', function (ev, picker) {
} $(this).val(picker.startDate.format('l'));
var momentDate = moment($datePicker.val(), $datePicker.data('daterangepicker').locale.format); });
return momentDate.isValid() ? momentDate.toISOString() : null;
};
var filterForm = $('#CmsKitCommentsFilterForm');
$('.singledatepicker').daterangepicker({ var getFilter = function () {
"singleDatePicker": true, var filterObj = filterForm.serializeFormToObject();
"showDropdowns": true,
"autoUpdateInput": false, filterObj.creationStartDate = getFormattedDate($('#CreationStartDate'));
"autoApply": true, filterObj.creationEndDate = getFormattedDate($('#CreationEndDate'));
"opens": "center",
"drops": "auto" return filterObj;
}); };
var _dataTable = $('#CommentsTable').DataTable(abp.libs.datatables.normalizeConfiguration({
$('.singledatepicker').attr('autocomplete', 'off'); processing: true,
serverSide: true,
$('.singledatepicker').on('apply.daterangepicker', function (ev, picker) { paging: true,
$(this).val(picker.startDate.format('l')); scrollX: true,
}); searching: false,
scrollCollapse: true,
ajax: abp.libs.datatables.createAjax(commentsService.getWaitingCommentsWithReplies, getFilter),
var filterForm = $('#CmsKitCommentsFilterForm'); columnDefs: [
{
var getFilter = function () { width: "10%",
var filterObj = filterForm.serializeFormToObject(); title: l("Actions"),
targets: 0,
filterObj.creationStartDate = getFormattedDate($('#CreationStartDate')); orderable: false,
filterObj.creationEndDate = getFormattedDate($('#CreationEndDate')); rowAction: {
items: [
return filterObj; {
}; text: function (data) {
return l('Approve');
var _dataTable = $('#CommentsTable').DataTable(abp.libs.datatables.normalizeConfiguration({
processing: true,
serverSide: true,
paging: true,
scrollX: true,
searching: false,
scrollCollapse: true,
ajax: abp.libs.datatables.createAjax(commentsService.getWaitingCommentsWithReplies, getFilter),
columnDefs: [
{
width: "10%",
title: l("Actions"),
targets: 0,
orderable: false,
rowAction: {
items: [
{
text: function (data) {
return l('Approve');
},
action: function (data) {
var newApprovalStatus = true;
commentsService
.updateApprovalStatus(data.record.id, { IsApproved: newApprovalStatus })
.then(function () {
_dataTable.ajax.reloadEx();
var message = newApprovalStatus ? l('ApprovedSuccessfully') : l('ApprovalRevokedSuccessfully');
abp.notify.success(message);
})
.catch(function (error) {
abp.notify.error(error.message);
});
}
}, },
{ action: function (data) {
text: function (data) { var newApprovalStatus = true;
return l('Disapproved');
}, commentsService
action: function (data) { .updateApprovalStatus(data.record.id, {IsApproved: newApprovalStatus})
var newApprovalStatus = false; .then(function () {
_dataTable.ajax.reloadEx();
commentsService var message = newApprovalStatus ? l('ApprovedSuccessfully') : l('ApprovalRevokedSuccessfully');
.updateApprovalStatus(data.record.id, { IsApproved: newApprovalStatus }) abp.notify.success(message);
.then(function () { })
_dataTable.ajax.reloadEx(); .catch(function (error) {
var message = newApprovalStatus ? l('ApprovedSuccessfully') : l('ApprovalRevokedSuccessfully'); abp.notify.error(error.message);
abp.notify.success(message); });
}) }
.catch(function (error) { },
abp.notify.error(error.message); {
}); text: function (data) {
} return l('Disapproved');
},
action: function (data) {
var newApprovalStatus = false;
commentsService
.updateApprovalStatus(data.record.id, {IsApproved: newApprovalStatus})
.then(function () {
_dataTable.ajax.reloadEx();
var message = newApprovalStatus ? l('ApprovedSuccessfully') : l('ApprovalRevokedSuccessfully');
abp.notify.success(message);
})
.catch(function (error) {
abp.notify.error(error.message);
});
} }
]
}
},
{
width: "10%",
title: l("Username"),
orderable: false,
data: "author.userName",
render: function (data) {
if (data !== null) {
return GetFilterableDatatableContent('#Author', $.fn.dataTable.render.text().display(data)); //prevent against possible XSS
}
return "";
}
},
{
width: "15%",
title: l("EntityType"),
orderable: false,
data: "entityType",
render: function (data) {
if (data !== null) {
return GetFilterableDatatableContent('#EntityType', $.fn.dataTable.render.text().display(data));
} }
return ""; ]
}
},
{
width: "10%",
title: l("Username"),
orderable: false,
data: "author.userName",
render: function (data) {
if (data !== null) {
return GetFilterableDatatableContent('#Author', $.fn.dataTable.render.text().display(data)); //prevent against possible XSS
} }
}, return "";
{ }
title: l("Text"), },
data: "text", {
orderable: false, width: "15%",
title: l("EntityType"),
orderable: false,
render: function (data) { data: "entityType",
render: function (data) {
//var converter = new showdown.Converter(); if (data !== null) {
//var htmlContent = converter.makeHtml(data); return GetFilterableDatatableContent('#EntityType', $.fn.dataTable.render.text().display(data));
var md = window.markdownit();
var htmlContent = md.render(data);
return (htmlContent);
} }
}, return "";
{
width: "15%",
title: l("CreationTime"),
data: "creationTime",
orderable: true,
dataFormat: "datetime"
} }
] },
})); {
title: l("Text"),
data: "text",
orderable: false,
function GetFilterableDatatableContent(filterSelector, data) {
return '<span class="datatableCell" data-field="' + filterSelector + '" data-val="' + data + '">' + data + '</span>';
}
$(document).on('click', '.datatableCell', function () { render: function (data) {
var inputSelector = $(this).attr('data-field');
var value = $(this).attr('data-val'); //var converter = new showdown.Converter();
//var htmlContent = converter.makeHtml(data);
var md = window.markdownit();
var htmlContent = md.render(data);
return (htmlContent);
}
},
{
width: "15%",
title: l("CreationTime"),
data: "creationTime",
orderable: true,
dataFormat: "datetime"
}
]
}));
function GetFilterableDatatableContent(filterSelector, data) {
return '<span class="datatableCell" data-field="' + filterSelector + '" data-val="' + data + '">' + data + '</span>';
}
$(inputSelector).val(value); $(document).on('click', '.datatableCell', function () {
var inputSelector = $(this).attr('data-field');
var value = $(this).attr('data-val');
_dataTable.ajax.reloadEx(); $(inputSelector).val(value);
});
_dataTable.ajax.reloadEx();
});
filterForm.submit(function (e) { filterForm.submit(function (e) {
e.preventDefault(); e.preventDefault();
_dataTable.ajax.reloadEx(); _dataTable.ajax.reloadEx();
});
}); });
});

10
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml

@ -97,11 +97,11 @@
<abp-column size-lg="_2" size-md="_12"> <abp-column size-lg="_2" size-md="_12">
<div class="mb-3" id="isApprovedColumn"> <div class="mb-3" id="isApprovedColumn">
<label class="mb-1" for="isApprovedSelect">@L["CommentFilter:ApproveState"].Value</label> <label class="mb-1" for="isApprovedSelect">@L["CommentFilter:ApproveState"].Value</label>
<select id="isApprovedSelect" asp-for="@Model.commentApproveStateType" class="form-control"> <select id="isApprovedSelect" asp-for="@Model.CommentApproveState" class="form-control">
<option value="@CommentApproveStateType.All">@L["CommentFilter:All"].Value</option> <option value="@CommentApproveState.All">@L["CommentFilter:All"].Value</option>
<option value="@CommentApproveStateType.Approved">@L["CommentFilter:Approved"].Value</option> <option value="@CommentApproveState.Approved">@L["CommentFilter:Approved"].Value</option>
<option value="@CommentApproveStateType.Disapproved">@L["CommentFilter:Disapproved"].Value</option> <option value="@CommentApproveState.Disapproved">@L["CommentFilter:Disapproved"].Value</option>
<option value="@CommentApproveStateType.Waiting">@L["CommentFilter:Waiting"].Value</option> <option value="@CommentApproveState.Waiting">@L["CommentFilter:Waiting"].Value</option>
</select> </select>
</div> </div>
</abp-column> </abp-column>

2
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml.cs

@ -17,7 +17,7 @@ public class DetailsModel : CmsKitAdminPageModel
public DateTime? CreationEndDate { get; set; } public DateTime? CreationEndDate { get; set; }
public CommentApproveStateType commentApproveStateType { get; set; } public CommentApproveState CommentApproveState { get; set; }
public CommentWithAuthorDto CommentWithAuthorDto { get; protected set; } public CommentWithAuthorDto CommentWithAuthorDto { get; protected set; }

10
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml

@ -62,11 +62,11 @@
<abp-column size-lg="_2" size-md="_6"> <abp-column size-lg="_2" size-md="_6">
<div class="mb-3" id="isApprovedColumn"> <div class="mb-3" id="isApprovedColumn">
<label class="mb-1" for="isApprovedSelect">@L["CommentFilter:ApproveState"].Value</label> <label class="mb-1" for="isApprovedSelect">@L["CommentFilter:ApproveState"].Value</label>
<select id="isApprovedSelect" asp-for="@Model.commentApproveStateType" class="form-control"> <select id="isApprovedSelect" asp-for="@Model.CommentApproveStateType" class="form-control">
<option value="@CommentApproveStateType.All">@L["CommentFilter:All"].Value</option> <option value="@CommentApproveState.All">@L["CommentFilter:All"].Value</option>
<option value="@CommentApproveStateType.Approved">@L["CommentFilter:Approved"].Value</option> <option value="@CommentApproveState.Approved">@L["CommentFilter:Approved"].Value</option>
<option value="@CommentApproveStateType.Disapproved">@L["CommentFilter:Disapproved"].Value</option> <option value="@CommentApproveState.Disapproved">@L["CommentFilter:Disapproved"].Value</option>
<option value="@CommentApproveStateType.Waiting">@L["CommentFilter:Waiting"].Value</option> <option value="@CommentApproveState.Waiting">@L["CommentFilter:Waiting"].Value</option>
</select> </select>
</div> </div>
</abp-column> </abp-column>

4
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml.cs

@ -12,6 +12,6 @@ public class IndexModel : CmsKitAdminPageModel
public DateTime? CreationStartDate { get; set; } = null; public DateTime? CreationStartDate { get; set; } = null;
public DateTime? CreationEndDate { get; set; } public DateTime? CreationEndDate { get; set; }
public CommentApproveStateType? commentApproveStateType { get; set; }
public CommentApproveState CommentApproveStateType { get; set; }
} }

5
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/index.js

@ -234,7 +234,7 @@ $(function (){
_dataTable.ajax.reloadEx(); _dataTable.ajax.reloadEx();
}); });
// Get and display waiting comment count // TODO: Replace these methods because ther are replaced in appservice
commentsService.getWaitingCommentCount().then(function (count) { commentsService.getWaitingCommentCount().then(function (count) {
if (count > 0) { if (count > 0) {
var alertMessage = l("CommentAlertMessage", count); var alertMessage = l("CommentAlertMessage", count);
@ -247,7 +247,6 @@ $(function (){
} }
}); });
//
commentsService.getSettings().then(function (data) { commentsService.getSettings().then(function (data) {
if (data.requireApprovement) { if (data.requireApprovement) {
$('#CommentsTable').DataTable().column(6).visible(true); $('#CommentsTable').DataTable().column(6).visible(true);
@ -256,4 +255,6 @@ $(function (){
$('#isApprovedColumn').hide(); $('#isApprovedColumn').hide();
} }
}) })
// TODO: if I change the state of the comment, you should update the alert message
}); });

12
modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Comments/CommentApproveState.cs

@ -0,0 +1,12 @@
using System;
namespace Volo.CmsKit.Comments;
[Flags]
public enum CommentApproveState
{
All = 0,
Approved = 1,
Disapproved = 2,
Waiting = 4
}

12
modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Comments/CommentApproveStateType.cs

@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Volo.CmsKit.Comments;
public enum CommentApproveStateType
{
All,
Approved,
Disapproved,
Waiting
}

7
modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Settings/AppSettings.cs

@ -1,9 +1,6 @@
using System; namespace Volo.CmsKit.Settings;
using System.Collections.Generic;
using System.Text;
namespace Volo.CmsKit.Settings;
public static class AppSettings public static class AppSettings
{ {
public const string RequireApprovement = "Comments.RequireApprovement"; public const string CommentRequireApprovement = "Comments.RequireApprovement";
} }

8
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/Comment.cs

@ -27,7 +27,7 @@ public class Comment : AggregateRoot<Guid>, IHasCreationTime, IMustHaveCreator,
public virtual string IdempotencyToken { get; set; } public virtual string IdempotencyToken { get; set; }
public virtual bool? IsApproved { get; set; } public virtual bool? IsApproved { get; private set; }
protected Comment() protected Comment()
{ {
@ -64,4 +64,10 @@ public class Comment : AggregateRoot<Guid>, IHasCreationTime, IMustHaveCreator,
{ {
Text = Check.NotNullOrWhiteSpace(text, nameof(text), CommentConsts.MaxTextLength); Text = Check.NotNullOrWhiteSpace(text, nameof(text), CommentConsts.MaxTextLength);
} }
public virtual Comment SetApprovalStatus([NotNull] bool isApproved)
{
IsApproved = isApproved;
return this;
}
} }

6
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/ICommentRepository.cs

@ -21,7 +21,7 @@ public interface ICommentRepository : IBasicRepository<Comment, Guid>
string sorting = null, string sorting = null,
int maxResultCount = int.MaxValue, int maxResultCount = int.MaxValue,
int skipCount = 0, int skipCount = 0,
CommentApproveStateType commentApproveStateType = CommentApproveStateType.All, CommentApproveState commentApproveState = CommentApproveState.All,
CancellationToken cancellationToken = default CancellationToken cancellationToken = default
); );
@ -32,14 +32,14 @@ public interface ICommentRepository : IBasicRepository<Comment, Guid>
string authorUsername = null, string authorUsername = null,
DateTime? creationStartDate = null, DateTime? creationStartDate = null,
DateTime? creationEndDate = null, DateTime? creationEndDate = null,
CommentApproveStateType commentApproveStateType = CommentApproveStateType.All, CommentApproveState commentApproveState = CommentApproveState.All,
CancellationToken cancellationToken = default CancellationToken cancellationToken = default
); );
Task<List<CommentWithAuthorQueryResultItem>> GetListWithAuthorsAsync( Task<List<CommentWithAuthorQueryResultItem>> GetListWithAuthorsAsync(
[NotNull] string entityType, [NotNull] string entityType,
[NotNull] string entityId, [NotNull] string entityId,
CommentApproveStateType commentApproveStateType = CommentApproveStateType.All, CommentApproveState commentApproveState = CommentApproveState.All,
CancellationToken cancellationToken = default CancellationToken cancellationToken = default
); );

2
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Settings/CmsKitSettingDefinitionProvider.cs

@ -10,7 +10,7 @@ public class CmsKitSettingDefinitionProvider : SettingDefinitionProvider
* Use names from CmsKitSettings class. * Use names from CmsKitSettings class.
*/ */
context.Add( context.Add(
new SettingDefinition(AppSettings.RequireApprovement, "true") new SettingDefinition(AppSettings.CommentRequireApprovement, "true")
) ; ) ;
} }
} }

25
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Comments/EfCoreCommentRepository.cs

@ -54,7 +54,7 @@ public class EfCoreCommentRepository : EfCoreRepository<ICmsKitDbContext, Commen
string sorting = null, string sorting = null,
int maxResultCount = int.MaxValue, int maxResultCount = int.MaxValue,
int skipCount = 0, int skipCount = 0,
CommentApproveStateType commentApproveStateType = CommentApproveStateType.All, CommentApproveState commentApproveState = CommentApproveState.All,
CancellationToken cancellationToken = default CancellationToken cancellationToken = default
) )
{ {
@ -66,7 +66,7 @@ public class EfCoreCommentRepository : EfCoreRepository<ICmsKitDbContext, Commen
authorUsername, authorUsername,
creationStartDate, creationStartDate,
creationEndDate, creationEndDate,
commentApproveStateType, commentApproveState,
token); token);
if (!sorting.IsNullOrEmpty()) if (!sorting.IsNullOrEmpty())
@ -87,7 +87,7 @@ public class EfCoreCommentRepository : EfCoreRepository<ICmsKitDbContext, Commen
string authorUsername = null, string authorUsername = null,
DateTime? creationStartDate = null, DateTime? creationStartDate = null,
DateTime? creationEndDate = null, DateTime? creationEndDate = null,
CommentApproveStateType commentApproveStateType = CommentApproveStateType.All, CommentApproveState commentApproveState = CommentApproveState.All,
CancellationToken cancellationToken = default CancellationToken cancellationToken = default
) )
@ -100,7 +100,7 @@ public class EfCoreCommentRepository : EfCoreRepository<ICmsKitDbContext, Commen
authorUsername, authorUsername,
creationStartDate, creationStartDate,
creationEndDate, creationEndDate,
commentApproveStateType, commentApproveState,
token); token);
return await query.LongCountAsync(token); return await query.LongCountAsync(token);
@ -109,7 +109,7 @@ public class EfCoreCommentRepository : EfCoreRepository<ICmsKitDbContext, Commen
public virtual async Task<List<CommentWithAuthorQueryResultItem>> GetListWithAuthorsAsync( public virtual async Task<List<CommentWithAuthorQueryResultItem>> GetListWithAuthorsAsync(
string entityType, string entityType,
string entityId, string entityId,
CommentApproveStateType commentApproveStateType = CommentApproveStateType.All, CommentApproveState commentApproveState = CommentApproveState.All,
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
{ {
Check.NotNullOrWhiteSpace(entityType, nameof(entityType)); Check.NotNullOrWhiteSpace(entityType, nameof(entityType));
@ -125,10 +125,10 @@ public class EfCoreCommentRepository : EfCoreRepository<ICmsKitDbContext, Commen
Author = user Author = user
}; };
query = commentApproveStateType switch query = commentApproveState switch
{ {
CommentApproveStateType.Approved => query.Where(c => c.Comment.IsApproved == true), CommentApproveState.Approved => query.Where(c => c.Comment.IsApproved == true),
CommentApproveStateType.Disapproved => query.Where(c => c.Comment.IsApproved == true || c.Comment.IsApproved == null), CommentApproveState.Approved | CommentApproveState.Waiting => query.Where(c => c.Comment.IsApproved == true || c.Comment.IsApproved == null),
_ => query _ => query
}; };
@ -166,9 +166,8 @@ public class EfCoreCommentRepository : EfCoreRepository<ICmsKitDbContext, Commen
string authorUsername = null, string authorUsername = null,
DateTime? creationStartDate = null, DateTime? creationStartDate = null,
DateTime? creationEndDate = null, DateTime? creationEndDate = null,
CommentApproveStateType commentApproveStateType = CommentApproveStateType.All, CommentApproveState commentApproveState = CommentApproveState.All,
CancellationToken cancellationToken = default CancellationToken cancellationToken = default
) )
{ {
var commentDbSet = await GetDbSetAsync(); var commentDbSet = await GetDbSetAsync();
@ -189,8 +188,8 @@ public class EfCoreCommentRepository : EfCoreRepository<ICmsKitDbContext, Commen
.WhereIf(!authorUsername.IsNullOrWhiteSpace(), c => c.Author.UserName.Contains(authorUsername)) .WhereIf(!authorUsername.IsNullOrWhiteSpace(), c => c.Author.UserName.Contains(authorUsername))
.WhereIf(creationStartDate.HasValue, c => c.Comment.CreationTime >= creationStartDate) .WhereIf(creationStartDate.HasValue, c => c.Comment.CreationTime >= creationStartDate)
.WhereIf(creationEndDate.HasValue, c => c.Comment.CreationTime <= creationEndDate) .WhereIf(creationEndDate.HasValue, c => c.Comment.CreationTime <= creationEndDate)
.WhereIf(CommentApproveStateType.Approved == commentApproveStateType, c => c.Comment.IsApproved == true) .WhereIf(CommentApproveState.Approved == commentApproveState, c => c.Comment.IsApproved == true)
.WhereIf(CommentApproveStateType.Disapproved == commentApproveStateType, c => c.Comment.IsApproved == false) .WhereIf(CommentApproveState.Disapproved == commentApproveState, c => c.Comment.IsApproved == false)
.WhereIf(CommentApproveStateType.Waiting == commentApproveStateType, c => c.Comment.IsApproved == null); .WhereIf(CommentApproveState.Waiting == commentApproveState, c => c.Comment.IsApproved == null);
} }
} }

71
modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Comments/MongoCommentRepository.cs

@ -1,5 +1,4 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Dynamic.Core; using System.Linq.Dynamic.Core;
@ -46,11 +45,10 @@ public class MongoCommentRepository : MongoDbRepository<ICmsKitMongoDbContext, C
string sorting = null, string sorting = null,
int maxResultCount = int.MaxValue, int maxResultCount = int.MaxValue,
int skipCount = 0, int skipCount = 0,
CommentApproveStateType commentApproveStateType = CommentApproveStateType.All, CommentApproveState commentApproveState = CommentApproveState.All,
CancellationToken cancellationToken = default CancellationToken cancellationToken = default
) )
{ {
var token = GetCancellationToken(cancellationToken); var token = GetCancellationToken(cancellationToken);
var query = await GetListQueryAsync( var query = await GetListQueryAsync(
filter, filter,
@ -59,7 +57,7 @@ public class MongoCommentRepository : MongoDbRepository<ICmsKitMongoDbContext, C
authorUsername, authorUsername,
creationStartDate, creationStartDate,
creationEndDate, creationEndDate,
commentApproveStateType, commentApproveState,
token); token);
var comments = await query.OrderBy(sorting.IsNullOrEmpty() ? "creationTime desc" : sorting) var comments = await query.OrderBy(sorting.IsNullOrEmpty() ? "creationTime desc" : sorting)
@ -70,20 +68,18 @@ public class MongoCommentRepository : MongoDbRepository<ICmsKitMongoDbContext, C
var commentIds = comments.Select(x => x.Id).ToList(); var commentIds = comments.Select(x => x.Id).ToList();
var authorsQuery = from comment in (await GetMongoQueryableAsync(token)) var authorsQuery = from comment in (await GetMongoQueryableAsync(token))
join user in (await GetDbContextAsync(token)).CmsUsers on comment.CreatorId equals user.Id join user in (await GetDbContextAsync(token)).CmsUsers on comment.CreatorId equals user.Id
where commentIds.Contains(comment.Id) where commentIds.Contains(comment.Id)
orderby comment.CreationTime orderby comment.CreationTime
select user; select user;
var authors = await ApplyDataFilters<IMongoQueryable<CmsUser>, CmsUser>(authorsQuery).ToListAsync(token); var authors = await ApplyDataFilters<IMongoQueryable<CmsUser>, CmsUser>(authorsQuery).ToListAsync(token);
return comments return comments
.Select( .Select(
comment => comment =>
new CommentWithAuthorQueryResultItem new CommentWithAuthorQueryResultItem {
{ Comment = comment, Author = authors.FirstOrDefault(a => a.Id == comment.CreatorId)
Comment = comment,
Author = authors.FirstOrDefault(a => a.Id == comment.CreatorId)
}).ToList(); }).ToList();
} }
@ -94,7 +90,7 @@ public class MongoCommentRepository : MongoDbRepository<ICmsKitMongoDbContext, C
string authorUsername = null, string authorUsername = null,
DateTime? creationStartDate = null, DateTime? creationStartDate = null,
DateTime? creationEndDate = null, DateTime? creationEndDate = null,
CommentApproveStateType commentApproveStateType = CommentApproveStateType.All, CommentApproveState commentApproveState = CommentApproveState.All,
CancellationToken cancellationToken = default CancellationToken cancellationToken = default
) )
{ {
@ -105,7 +101,7 @@ public class MongoCommentRepository : MongoDbRepository<ICmsKitMongoDbContext, C
authorUsername, authorUsername,
creationStartDate, creationStartDate,
creationEndDate, creationEndDate,
commentApproveStateType, commentApproveState,
cancellationToken); cancellationToken);
return await query.As<IMongoQueryable<Comment>>() return await query.As<IMongoQueryable<Comment>>()
@ -115,7 +111,7 @@ public class MongoCommentRepository : MongoDbRepository<ICmsKitMongoDbContext, C
public virtual async Task<List<CommentWithAuthorQueryResultItem>> GetListWithAuthorsAsync( public virtual async Task<List<CommentWithAuthorQueryResultItem>> GetListWithAuthorsAsync(
string entityType, string entityType,
string entityId, string entityId,
CommentApproveStateType commentApproveStateType = CommentApproveStateType.All, CommentApproveState commentApproveState = CommentApproveState.All,
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
{ {
Check.NotNullOrWhiteSpace(entityType, nameof(entityType)); Check.NotNullOrWhiteSpace(entityType, nameof(entityType));
@ -132,10 +128,9 @@ public class MongoCommentRepository : MongoDbRepository<ICmsKitMongoDbContext, C
var commentsQuery = (await GetMongoQueryableAsync(cancellationToken)) var commentsQuery = (await GetMongoQueryableAsync(cancellationToken))
.Where(c => c.EntityId == entityId && c.EntityType == entityType); .Where(c => c.EntityId == entityId && c.EntityType == entityType);
commentsQuery = commentApproveStateType switch commentsQuery = commentApproveState switch {
{ CommentApproveState.Approved => commentsQuery.Where(c => c.IsApproved == true),
CommentApproveStateType.Approved => commentsQuery.Where(c => c.IsApproved == true), CommentApproveState.Approved | CommentApproveState.Waiting => commentsQuery.Where(c => c.IsApproved == true || c.IsApproved == null),
CommentApproveStateType.Disapproved => commentsQuery.Where(c => c.IsApproved == true || c.IsApproved == null),
_ => commentsQuery _ => commentsQuery
}; };
@ -182,15 +177,15 @@ public class MongoCommentRepository : MongoDbRepository<ICmsKitMongoDbContext, C
} }
protected virtual async Task<IQueryable<Comment>> GetListQueryAsync( protected virtual async Task<IQueryable<Comment>> GetListQueryAsync(
string filter = null, string filter = null,
string entityType = null, string entityType = null,
Guid? repliedCommentId = null, Guid? repliedCommentId = null,
string authorUsername = null, string authorUsername = null,
DateTime? creationStartDate = null, DateTime? creationStartDate = null,
DateTime? creationEndDate = null, DateTime? creationEndDate = null,
CommentApproveStateType commentApproveStateType = CommentApproveStateType.All, CommentApproveState commentApproveState = CommentApproveState.All,
CancellationToken cancellationToken = default CancellationToken cancellationToken = default
) )
{ {
var queryable = await GetMongoQueryableAsync(cancellationToken); var queryable = await GetMongoQueryableAsync(cancellationToken);
@ -208,22 +203,8 @@ public class MongoCommentRepository : MongoDbRepository<ICmsKitMongoDbContext, C
.WhereIf(repliedCommentId.HasValue, c => c.RepliedCommentId == repliedCommentId) .WhereIf(repliedCommentId.HasValue, c => c.RepliedCommentId == repliedCommentId)
.WhereIf(creationStartDate.HasValue, c => c.CreationTime >= creationStartDate) .WhereIf(creationStartDate.HasValue, c => c.CreationTime >= creationStartDate)
.WhereIf(creationEndDate.HasValue, c => c.CreationTime <= creationEndDate) .WhereIf(creationEndDate.HasValue, c => c.CreationTime <= creationEndDate)
.WhereIf(CommentApproveStateType.Approved == commentApproveStateType, c => c.IsApproved == true) .WhereIf(CommentApproveState.Approved == commentApproveState, c => c.IsApproved == true)
.WhereIf(CommentApproveStateType.Disapproved == commentApproveStateType, c => c.IsApproved == false) .WhereIf(CommentApproveState.Disapproved == commentApproveState, c => c.IsApproved == false)
.WhereIf(CommentApproveStateType.Waiting == commentApproveStateType, c => c.IsApproved == null); .WhereIf(CommentApproveState.Waiting == commentApproveState, c => c.IsApproved == null);
} }
//public IQueryable<Comment> FilterCommentsByApprovalState(IQueryable<Comment> commentsQuery, CommentApproveStateType approveState)
//{
// switch (approveState)
// {
// case CommentApproveStateType.Approved:
// commentsQuery = commentsQuery.Where(c => c.IsApproved == true);
// break;
// case CommentApproveStateType.Disapproved:
// commentsQuery = commentsQuery.Where(c => c.IsApproved == true || c.IsApproved == null);
// break;
// }
// return commentsQuery;
//}
} }

9
modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs

@ -57,10 +57,11 @@ public class CommentPublicAppService : CmsKitPublicAppServiceBase, ICommentPubli
public virtual async Task<ListResultDto<CommentWithDetailsDto>> GetListAsync(string entityType, string entityId) public virtual async Task<ListResultDto<CommentWithDetailsDto>> GetListAsync(string entityType, string entityId)
{ {
string state = await SettingManager.GetOrNullGlobalAsync(AppSettings.RequireApprovement); var isRequireApprovementEnabled = bool.Parse(await SettingManager.GetOrNullGlobalAsync(AppSettings.CommentRequireApprovement));
var commentsWithAuthor = bool.Parse(state) ?
await CommentRepository.GetListWithAuthorsAsync(entityType, entityId, CommentApproveStateType.Approved) : var commentsWithAuthor = isRequireApprovementEnabled
await CommentRepository.GetListWithAuthorsAsync(entityType, entityId, CommentApproveStateType.Disapproved); ? await CommentRepository.GetListWithAuthorsAsync(entityType, entityId, CommentApproveState.Approved)
: await CommentRepository.GetListWithAuthorsAsync(entityType, entityId, CommentApproveState.Approved | CommentApproveState.Waiting);
return new ListResultDto<CommentWithDetailsDto>( return new ListResultDto<CommentWithDetailsDto>(

Loading…
Cancel
Save