mirror of https://github.com/abpframework/abp.git
40 changed files with 4765 additions and 4754 deletions
@ -1,411 +1,411 @@ |
|||
var abp = abp || {}; |
|||
(function($) { |
|||
|
|||
if (!$) { |
|||
throw "abp/jquery library requires the jquery library included to the page!"; |
|||
} |
|||
|
|||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
|||
|
|||
abp.message._showMessage = function (message, title) { |
|||
alert((title || '') + ' ' + message); |
|||
|
|||
return $.Deferred(function ($dfd) { |
|||
$dfd.resolve(); |
|||
}); |
|||
}; |
|||
|
|||
abp.message.confirm = function (message, titleOrCallback, callback) { |
|||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
|||
callback = titleOrCallback; |
|||
} |
|||
|
|||
var result = confirm(message); |
|||
callback && callback(result); |
|||
|
|||
return $.Deferred(function ($dfd) { |
|||
$dfd.resolve(result); |
|||
}); |
|||
}; |
|||
|
|||
abp.utils.isFunction = function (obj) { |
|||
return $.isFunction(obj); |
|||
}; |
|||
|
|||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
|||
|
|||
$.fn.findWithSelf = function (selector) { |
|||
return this.filter(selector).add(this.find(selector)); |
|||
}; |
|||
|
|||
// DOM ////////////////////////////////////////////////////////////////////
|
|||
|
|||
abp.dom = abp.dom || {}; |
|||
|
|||
abp.dom.onNodeAdded = function (callback) { |
|||
abp.event.on('abp.dom.nodeAdded', callback); |
|||
}; |
|||
|
|||
abp.dom.onNodeRemoved = function (callback) { |
|||
abp.event.on('abp.dom.nodeRemoved', callback); |
|||
}; |
|||
|
|||
var mutationObserverCallback = function (mutationsList) { |
|||
for (var i = 0; i < mutationsList.length; i++) { |
|||
var mutation = mutationsList[i]; |
|||
if (mutation.type === 'childList') { |
|||
if (mutation.addedNodes && mutation.removedNodes.length) { |
|||
for (var k = 0; k < mutation.removedNodes.length; k++) { |
|||
abp.event.trigger( |
|||
'abp.dom.nodeRemoved', |
|||
{ |
|||
$el: $(mutation.removedNodes[k]) |
|||
} |
|||
); |
|||
} |
|||
} |
|||
|
|||
if (mutation.addedNodes && mutation.addedNodes.length) { |
|||
for (var j = 0; j < mutation.addedNodes.length; j++) { |
|||
abp.event.trigger( |
|||
'abp.dom.nodeAdded', |
|||
{ |
|||
$el: $(mutation.addedNodes[j]) |
|||
} |
|||
); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}; |
|||
|
|||
$(function(){ |
|||
new MutationObserver(mutationObserverCallback).observe( |
|||
$('body')[0], |
|||
{ |
|||
subtree: true, |
|||
childList: true |
|||
} |
|||
); |
|||
}); |
|||
|
|||
// AJAX ///////////////////////////////////////////////////////////////////
|
|||
|
|||
abp.ajax = function (userOptions) { |
|||
userOptions = userOptions || {}; |
|||
|
|||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
|||
|
|||
options.success = undefined; |
|||
options.error = undefined; |
|||
|
|||
var xhr = null; |
|||
var promise = $.Deferred(function ($dfd) { |
|||
xhr = $.ajax(options) |
|||
.done(function (data, textStatus, jqXHR) { |
|||
$dfd.resolve(data); |
|||
userOptions.success && userOptions.success(data); |
|||
}).fail(function (jqXHR) { |
|||
if(jqXHR.statusText === 'abort') { |
|||
//ajax request is abort, ignore error handle.
|
|||
return; |
|||
} |
|||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
|||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
|||
} else { |
|||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
|||
} |
|||
}); |
|||
}).promise(); |
|||
|
|||
promise['jqXHR'] = xhr; |
|||
|
|||
return promise; |
|||
}; |
|||
|
|||
$.extend(abp.ajax, { |
|||
defaultOpts: { |
|||
dataType: 'json', |
|||
type: 'POST', |
|||
contentType: 'application/json', |
|||
headers: { |
|||
'X-Requested-With': 'XMLHttpRequest' |
|||
} |
|||
}, |
|||
|
|||
defaultError: { |
|||
message: 'An error has occurred!', |
|||
details: 'Error detail not sent by server.' |
|||
}, |
|||
|
|||
defaultError401: { |
|||
message: 'You are not authenticated!', |
|||
details: 'You should be authenticated (sign in) in order to perform this operation.' |
|||
}, |
|||
|
|||
defaultError403: { |
|||
message: 'You are not authorized!', |
|||
details: 'You are not allowed to perform this operation.' |
|||
}, |
|||
|
|||
defaultError404: { |
|||
message: 'Resource not found!', |
|||
details: 'The resource requested could not found on the server.' |
|||
}, |
|||
|
|||
logError: function (error) { |
|||
abp.log.error(error); |
|||
}, |
|||
|
|||
showError: function (error) { |
|||
if (error.details) { |
|||
return abp.message.error(error.details, error.message); |
|||
} else { |
|||
return abp.message.error(error.message || abp.ajax.defaultError.message); |
|||
} |
|||
}, |
|||
|
|||
handleTargetUrl: function (targetUrl) { |
|||
if (!targetUrl) { |
|||
location.href = abp.appPath; |
|||
} else { |
|||
location.href = targetUrl; |
|||
} |
|||
}, |
|||
|
|||
handleErrorStatusCode: function (status) { |
|||
switch (status) { |
|||
case 401: |
|||
abp.ajax.handleUnAuthorizedRequest( |
|||
abp.ajax.showError(abp.ajax.defaultError401), |
|||
abp.appPath |
|||
); |
|||
break; |
|||
case 403: |
|||
abp.ajax.showError(abp.ajax.defaultError403); |
|||
break; |
|||
case 404: |
|||
abp.ajax.showError(abp.ajax.defaultError404); |
|||
break; |
|||
default: |
|||
abp.ajax.showError(abp.ajax.defaultError); |
|||
break; |
|||
} |
|||
}, |
|||
|
|||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
|||
if (userOptions.abpHandleError !== false) { |
|||
abp.ajax.handleErrorStatusCode(jqXHR.status); |
|||
} |
|||
|
|||
$dfd.reject.apply(this, arguments); |
|||
userOptions.error && userOptions.error.apply(this, arguments); |
|||
}, |
|||
|
|||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
|||
var messagePromise = null; |
|||
|
|||
var responseJSON = jqXHR.responseJSON ? jqXHR.responseJSON : JSON.parse(jqXHR.responseText); |
|||
|
|||
if (userOptions.abpHandleError !== false) { |
|||
messagePromise = abp.ajax.showError(responseJSON.error); |
|||
} |
|||
|
|||
abp.ajax.logError(responseJSON.error); |
|||
|
|||
$dfd && $dfd.reject(responseJSON.error, jqXHR); |
|||
userOptions.error && userOptions.error(responseJSON.error, jqXHR); |
|||
|
|||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
|||
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
|||
} |
|||
}, |
|||
|
|||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
|||
if (messagePromise) { |
|||
messagePromise.done(function () { |
|||
abp.ajax.handleTargetUrl(targetUrl); |
|||
}); |
|||
} else { |
|||
abp.ajax.handleTargetUrl(targetUrl); |
|||
} |
|||
}, |
|||
|
|||
blockUI: function (options) { |
|||
if (options.blockUI) { |
|||
if (options.blockUI === true) { //block whole page
|
|||
abp.ui.setBusy(); |
|||
} else { //block an element
|
|||
abp.ui.setBusy(options.blockUI); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
unblockUI: function (options) { |
|||
if (options.blockUI) { |
|||
if (options.blockUI === true) { //unblock whole page
|
|||
abp.ui.clearBusy(); |
|||
} else { //unblock an element
|
|||
abp.ui.clearBusy(options.blockUI); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
ajaxSendHandler: function (event, request, settings) { |
|||
var token = abp.security.antiForgery.getToken(); |
|||
if (!token) { |
|||
return; |
|||
} |
|||
|
|||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
|||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
$(document).ajaxSend(function (event, request, settings) { |
|||
return abp.ajax.ajaxSendHandler(event, request, settings); |
|||
}); |
|||
|
|||
abp.event.on('abp.configurationInitialized', function () { |
|||
var l = abp.localization.getResource('AbpUi'); |
|||
|
|||
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
|||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
|||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
|||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
|||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
|||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
|||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
|||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
|||
}); |
|||
|
|||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
|||
|
|||
/* UrlStates enum */ |
|||
var UrlStates = { |
|||
LOADING: 'LOADING', |
|||
LOADED: 'LOADED', |
|||
FAILED: 'FAILED' |
|||
}; |
|||
|
|||
/* UrlInfo class */ |
|||
function UrlInfo(url) { |
|||
this.url = url; |
|||
this.state = UrlStates.LOADING; |
|||
this.loadCallbacks = []; |
|||
this.failCallbacks = []; |
|||
} |
|||
|
|||
UrlInfo.prototype.succeed = function () { |
|||
this.state = UrlStates.LOADED; |
|||
for (var i = 0; i < this.loadCallbacks.length; i++) { |
|||
this.loadCallbacks[i](); |
|||
} |
|||
}; |
|||
|
|||
UrlInfo.prototype.failed = function () { |
|||
this.state = UrlStates.FAILED; |
|||
for (var i = 0; i < this.failCallbacks.length; i++) { |
|||
this.failCallbacks[i](); |
|||
} |
|||
}; |
|||
|
|||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
|||
switch (this.state) { |
|||
case UrlStates.LOADED: |
|||
loadCallback && loadCallback(); |
|||
break; |
|||
case UrlStates.FAILED: |
|||
failCallback && failCallback(); |
|||
break; |
|||
case UrlStates.LOADING: |
|||
this.addCallbacks(loadCallback, failCallback); |
|||
break; |
|||
} |
|||
}; |
|||
|
|||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
|||
loadCallback && this.loadCallbacks.push(loadCallback); |
|||
failCallback && this.failCallbacks.push(failCallback); |
|||
}; |
|||
|
|||
/* ResourceLoader API */ |
|||
|
|||
abp.ResourceLoader = (function () { |
|||
|
|||
var _urlInfos = {}; |
|||
|
|||
function getCacheKey(url) { |
|||
return url; |
|||
} |
|||
|
|||
function appendTimeToUrl(url) { |
|||
|
|||
if (url.indexOf('?') < 0) { |
|||
url += '?'; |
|||
} else { |
|||
url += '&'; |
|||
} |
|||
|
|||
url += '_=' + new Date().getTime(); |
|||
|
|||
return url; |
|||
} |
|||
|
|||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
|||
|
|||
var cacheKey = getCacheKey(url); |
|||
|
|||
var urlInfo = _urlInfos[cacheKey]; |
|||
|
|||
if (urlInfo) { |
|||
urlInfo.handleCallbacks(loadCallback, failCallback); |
|||
return; |
|||
} |
|||
|
|||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
|||
urlInfo.addCallbacks(loadCallback, failCallback); |
|||
|
|||
serverLoader(urlInfo); |
|||
}; |
|||
|
|||
var _loadScript = function (url, loadCallback, failCallback) { |
|||
var nonce = document.body.nonce || document.body.getAttribute('nonce'); |
|||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
|||
$.get({ |
|||
url: url, |
|||
dataType: 'text' |
|||
}) |
|||
.done(function (script) { |
|||
if(nonce){ |
|||
$.globalEval(script, { nonce: nonce}); |
|||
}else{ |
|||
$.globalEval(script); |
|||
} |
|||
urlInfo.succeed(); |
|||
}) |
|||
.fail(function () { |
|||
urlInfo.failed(); |
|||
}); |
|||
}); |
|||
}; |
|||
|
|||
var _loadStyle = function (url) { |
|||
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
|||
|
|||
$('<link/>', { |
|||
rel: 'stylesheet', |
|||
type: 'text/css', |
|||
href: appendTimeToUrl(url) |
|||
}).appendTo('head'); |
|||
}); |
|||
}; |
|||
|
|||
return { |
|||
loadScript: _loadScript, |
|||
loadStyle: _loadStyle |
|||
} |
|||
})(); |
|||
|
|||
var abp = abp || {}; |
|||
(function($) { |
|||
|
|||
if (!$) { |
|||
throw "abp/jquery library requires the jquery library included to the page!"; |
|||
} |
|||
|
|||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
|||
|
|||
abp.message._showMessage = function (message, title) { |
|||
alert((title || '') + ' ' + message); |
|||
|
|||
return $.Deferred(function ($dfd) { |
|||
$dfd.resolve(); |
|||
}); |
|||
}; |
|||
|
|||
abp.message.confirm = function (message, titleOrCallback, callback) { |
|||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
|||
callback = titleOrCallback; |
|||
} |
|||
|
|||
var result = confirm(message); |
|||
callback && callback(result); |
|||
|
|||
return $.Deferred(function ($dfd) { |
|||
$dfd.resolve(result); |
|||
}); |
|||
}; |
|||
|
|||
abp.utils.isFunction = function (obj) { |
|||
return $.isFunction(obj); |
|||
}; |
|||
|
|||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
|||
|
|||
$.fn.findWithSelf = function (selector) { |
|||
return this.filter(selector).add(this.find(selector)); |
|||
}; |
|||
|
|||
// DOM ////////////////////////////////////////////////////////////////////
|
|||
|
|||
abp.dom = abp.dom || {}; |
|||
|
|||
abp.dom.onNodeAdded = function (callback) { |
|||
abp.event.on('abp.dom.nodeAdded', callback); |
|||
}; |
|||
|
|||
abp.dom.onNodeRemoved = function (callback) { |
|||
abp.event.on('abp.dom.nodeRemoved', callback); |
|||
}; |
|||
|
|||
var mutationObserverCallback = function (mutationsList) { |
|||
for (var i = 0; i < mutationsList.length; i++) { |
|||
var mutation = mutationsList[i]; |
|||
if (mutation.type === 'childList') { |
|||
if (mutation.addedNodes && mutation.removedNodes.length) { |
|||
for (var k = 0; k < mutation.removedNodes.length; k++) { |
|||
abp.event.trigger( |
|||
'abp.dom.nodeRemoved', |
|||
{ |
|||
$el: $(mutation.removedNodes[k]) |
|||
} |
|||
); |
|||
} |
|||
} |
|||
|
|||
if (mutation.addedNodes && mutation.addedNodes.length) { |
|||
for (var j = 0; j < mutation.addedNodes.length; j++) { |
|||
abp.event.trigger( |
|||
'abp.dom.nodeAdded', |
|||
{ |
|||
$el: $(mutation.addedNodes[j]) |
|||
} |
|||
); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}; |
|||
|
|||
$(function(){ |
|||
new MutationObserver(mutationObserverCallback).observe( |
|||
$('body')[0], |
|||
{ |
|||
subtree: true, |
|||
childList: true |
|||
} |
|||
); |
|||
}); |
|||
|
|||
// AJAX ///////////////////////////////////////////////////////////////////
|
|||
|
|||
abp.ajax = function (userOptions) { |
|||
userOptions = userOptions || {}; |
|||
|
|||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
|||
|
|||
options.success = undefined; |
|||
options.error = undefined; |
|||
|
|||
var xhr = null; |
|||
var promise = $.Deferred(function ($dfd) { |
|||
xhr = $.ajax(options) |
|||
.done(function (data, textStatus, jqXHR) { |
|||
$dfd.resolve(data); |
|||
userOptions.success && userOptions.success(data); |
|||
}).fail(function (jqXHR) { |
|||
if(jqXHR.statusText === 'abort') { |
|||
//ajax request is abort, ignore error handle.
|
|||
return; |
|||
} |
|||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
|||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
|||
} else { |
|||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
|||
} |
|||
}); |
|||
}).promise(); |
|||
|
|||
promise['jqXHR'] = xhr; |
|||
|
|||
return promise; |
|||
}; |
|||
|
|||
$.extend(abp.ajax, { |
|||
defaultOpts: { |
|||
dataType: 'json', |
|||
type: 'POST', |
|||
contentType: 'application/json', |
|||
headers: { |
|||
'X-Requested-With': 'XMLHttpRequest' |
|||
} |
|||
}, |
|||
|
|||
defaultError: { |
|||
message: 'An error has occurred!', |
|||
details: 'Error detail not sent by server.' |
|||
}, |
|||
|
|||
defaultError401: { |
|||
message: 'You are not authenticated!', |
|||
details: 'You should be authenticated (sign in) in order to perform this operation.' |
|||
}, |
|||
|
|||
defaultError403: { |
|||
message: 'You are not authorized!', |
|||
details: 'You are not allowed to perform this operation.' |
|||
}, |
|||
|
|||
defaultError404: { |
|||
message: 'Resource not found!', |
|||
details: 'The resource requested could not found on the server.' |
|||
}, |
|||
|
|||
logError: function (error) { |
|||
abp.log.error(error); |
|||
}, |
|||
|
|||
showError: function (error) { |
|||
if (error.details) { |
|||
return abp.message.error(error.details, error.message); |
|||
} else { |
|||
return abp.message.error(error.message || abp.ajax.defaultError.message); |
|||
} |
|||
}, |
|||
|
|||
handleTargetUrl: function (targetUrl) { |
|||
if (!targetUrl) { |
|||
location.href = abp.appPath; |
|||
} else { |
|||
location.href = targetUrl; |
|||
} |
|||
}, |
|||
|
|||
handleErrorStatusCode: function (status) { |
|||
switch (status) { |
|||
case 401: |
|||
abp.ajax.handleUnAuthorizedRequest( |
|||
abp.ajax.showError(abp.ajax.defaultError401), |
|||
abp.appPath |
|||
); |
|||
break; |
|||
case 403: |
|||
abp.ajax.showError(abp.ajax.defaultError403); |
|||
break; |
|||
case 404: |
|||
abp.ajax.showError(abp.ajax.defaultError404); |
|||
break; |
|||
default: |
|||
abp.ajax.showError(abp.ajax.defaultError); |
|||
break; |
|||
} |
|||
}, |
|||
|
|||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
|||
if (userOptions.abpHandleError !== false) { |
|||
abp.ajax.handleErrorStatusCode(jqXHR.status); |
|||
} |
|||
|
|||
$dfd.reject.apply(this, arguments); |
|||
userOptions.error && userOptions.error.apply(this, arguments); |
|||
}, |
|||
|
|||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
|||
var messagePromise = null; |
|||
|
|||
var responseJSON = jqXHR.responseJSON ? jqXHR.responseJSON : JSON.parse(jqXHR.responseText); |
|||
|
|||
if (userOptions.abpHandleError !== false) { |
|||
messagePromise = abp.ajax.showError(responseJSON.error); |
|||
} |
|||
|
|||
abp.ajax.logError(responseJSON.error); |
|||
|
|||
$dfd && $dfd.reject(responseJSON.error, jqXHR); |
|||
userOptions.error && userOptions.error(responseJSON.error, jqXHR); |
|||
|
|||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
|||
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
|||
} |
|||
}, |
|||
|
|||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
|||
if (messagePromise) { |
|||
messagePromise.done(function () { |
|||
abp.ajax.handleTargetUrl(targetUrl); |
|||
}); |
|||
} else { |
|||
abp.ajax.handleTargetUrl(targetUrl); |
|||
} |
|||
}, |
|||
|
|||
blockUI: function (options) { |
|||
if (options.blockUI) { |
|||
if (options.blockUI === true) { //block whole page
|
|||
abp.ui.setBusy(); |
|||
} else { //block an element
|
|||
abp.ui.setBusy(options.blockUI); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
unblockUI: function (options) { |
|||
if (options.blockUI) { |
|||
if (options.blockUI === true) { //unblock whole page
|
|||
abp.ui.clearBusy(); |
|||
} else { //unblock an element
|
|||
abp.ui.clearBusy(options.blockUI); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
ajaxSendHandler: function (event, request, settings) { |
|||
var token = abp.security.antiForgery.getToken(); |
|||
if (!token) { |
|||
return; |
|||
} |
|||
|
|||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
|||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
$(document).ajaxSend(function (event, request, settings) { |
|||
return abp.ajax.ajaxSendHandler(event, request, settings); |
|||
}); |
|||
|
|||
abp.event.on('abp.configurationInitialized', function () { |
|||
var l = abp.localization.getResource('AbpUi'); |
|||
|
|||
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
|||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
|||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
|||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
|||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
|||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
|||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
|||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
|||
}); |
|||
|
|||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
|||
|
|||
/* UrlStates enum */ |
|||
var UrlStates = { |
|||
LOADING: 'LOADING', |
|||
LOADED: 'LOADED', |
|||
FAILED: 'FAILED' |
|||
}; |
|||
|
|||
/* UrlInfo class */ |
|||
function UrlInfo(url) { |
|||
this.url = url; |
|||
this.state = UrlStates.LOADING; |
|||
this.loadCallbacks = []; |
|||
this.failCallbacks = []; |
|||
} |
|||
|
|||
UrlInfo.prototype.succeed = function () { |
|||
this.state = UrlStates.LOADED; |
|||
for (var i = 0; i < this.loadCallbacks.length; i++) { |
|||
this.loadCallbacks[i](); |
|||
} |
|||
}; |
|||
|
|||
UrlInfo.prototype.failed = function () { |
|||
this.state = UrlStates.FAILED; |
|||
for (var i = 0; i < this.failCallbacks.length; i++) { |
|||
this.failCallbacks[i](); |
|||
} |
|||
}; |
|||
|
|||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
|||
switch (this.state) { |
|||
case UrlStates.LOADED: |
|||
loadCallback && loadCallback(); |
|||
break; |
|||
case UrlStates.FAILED: |
|||
failCallback && failCallback(); |
|||
break; |
|||
case UrlStates.LOADING: |
|||
this.addCallbacks(loadCallback, failCallback); |
|||
break; |
|||
} |
|||
}; |
|||
|
|||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
|||
loadCallback && this.loadCallbacks.push(loadCallback); |
|||
failCallback && this.failCallbacks.push(failCallback); |
|||
}; |
|||
|
|||
/* ResourceLoader API */ |
|||
|
|||
abp.ResourceLoader = (function () { |
|||
|
|||
var _urlInfos = {}; |
|||
|
|||
function getCacheKey(url) { |
|||
return url; |
|||
} |
|||
|
|||
function appendTimeToUrl(url) { |
|||
|
|||
if (url.indexOf('?') < 0) { |
|||
url += '?'; |
|||
} else { |
|||
url += '&'; |
|||
} |
|||
|
|||
url += '_=' + new Date().getTime(); |
|||
|
|||
return url; |
|||
} |
|||
|
|||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
|||
|
|||
var cacheKey = getCacheKey(url); |
|||
|
|||
var urlInfo = _urlInfos[cacheKey]; |
|||
|
|||
if (urlInfo) { |
|||
urlInfo.handleCallbacks(loadCallback, failCallback); |
|||
return; |
|||
} |
|||
|
|||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
|||
urlInfo.addCallbacks(loadCallback, failCallback); |
|||
|
|||
serverLoader(urlInfo); |
|||
}; |
|||
|
|||
var _loadScript = function (url, loadCallback, failCallback) { |
|||
var nonce = document.body.nonce || document.body.getAttribute('nonce'); |
|||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
|||
$.get({ |
|||
url: url, |
|||
dataType: 'text' |
|||
}) |
|||
.done(function (script) { |
|||
if(nonce){ |
|||
$.globalEval(script, { nonce: nonce}); |
|||
}else{ |
|||
$.globalEval(script); |
|||
} |
|||
urlInfo.succeed(); |
|||
}) |
|||
.fail(function () { |
|||
urlInfo.failed(); |
|||
}); |
|||
}); |
|||
}; |
|||
|
|||
var _loadStyle = function (url) { |
|||
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
|||
|
|||
$('<link/>', { |
|||
rel: 'stylesheet', |
|||
type: 'text/css', |
|||
href: appendTimeToUrl(url) |
|||
}).appendTo('head'); |
|||
}); |
|||
}; |
|||
|
|||
return { |
|||
loadScript: _loadScript, |
|||
loadStyle: _loadStyle |
|||
} |
|||
})(); |
|||
|
|||
})(jQuery); |
|||
File diff suppressed because it is too large
@ -1,410 +1,410 @@ |
|||
.daterangepicker { |
|||
position: absolute; |
|||
color: inherit; |
|||
background-color: #fff; |
|||
border-radius: 4px; |
|||
border: 1px solid #ddd; |
|||
width: 278px; |
|||
max-width: none; |
|||
padding: 0; |
|||
margin-top: 7px; |
|||
top: 100px; |
|||
left: 20px; |
|||
z-index: 3001; |
|||
display: none; |
|||
font-family: arial; |
|||
font-size: 15px; |
|||
line-height: 1em; |
|||
} |
|||
|
|||
.daterangepicker:before, .daterangepicker:after { |
|||
position: absolute; |
|||
display: inline-block; |
|||
border-bottom-color: rgba(0, 0, 0, 0.2); |
|||
content: ''; |
|||
} |
|||
|
|||
.daterangepicker:before { |
|||
top: -7px; |
|||
border-right: 7px solid transparent; |
|||
border-left: 7px solid transparent; |
|||
border-bottom: 7px solid #ccc; |
|||
} |
|||
|
|||
.daterangepicker:after { |
|||
top: -6px; |
|||
border-right: 6px solid transparent; |
|||
border-bottom: 6px solid #fff; |
|||
border-left: 6px solid transparent; |
|||
} |
|||
|
|||
.daterangepicker.opensleft:before { |
|||
right: 9px; |
|||
} |
|||
|
|||
.daterangepicker.opensleft:after { |
|||
right: 10px; |
|||
} |
|||
|
|||
.daterangepicker.openscenter:before { |
|||
left: 0; |
|||
right: 0; |
|||
width: 0; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
.daterangepicker.openscenter:after { |
|||
left: 0; |
|||
right: 0; |
|||
width: 0; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
.daterangepicker.opensright:before { |
|||
left: 9px; |
|||
} |
|||
|
|||
.daterangepicker.opensright:after { |
|||
left: 10px; |
|||
} |
|||
|
|||
.daterangepicker.drop-up { |
|||
margin-top: -7px; |
|||
} |
|||
|
|||
.daterangepicker.drop-up:before { |
|||
top: initial; |
|||
bottom: -7px; |
|||
border-bottom: initial; |
|||
border-top: 7px solid #ccc; |
|||
} |
|||
|
|||
.daterangepicker.drop-up:after { |
|||
top: initial; |
|||
bottom: -6px; |
|||
border-bottom: initial; |
|||
border-top: 6px solid #fff; |
|||
} |
|||
|
|||
.daterangepicker.single .daterangepicker .ranges, .daterangepicker.single .drp-calendar { |
|||
float: none; |
|||
} |
|||
|
|||
.daterangepicker.single .drp-selected { |
|||
display: none; |
|||
} |
|||
|
|||
.daterangepicker.show-calendar .drp-calendar { |
|||
display: block; |
|||
} |
|||
|
|||
.daterangepicker.show-calendar .drp-buttons { |
|||
display: block; |
|||
} |
|||
|
|||
.daterangepicker.auto-apply .drp-buttons { |
|||
display: none; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar { |
|||
display: none; |
|||
max-width: 270px; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left { |
|||
padding: 8px 0 8px 8px; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.right { |
|||
padding: 8px; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.single .calendar-table { |
|||
border: none; |
|||
} |
|||
|
|||
.daterangepicker .calendar-table .next span, .daterangepicker .calendar-table .prev span { |
|||
color: #fff; |
|||
border: solid black; |
|||
border-width: 0 2px 2px 0; |
|||
border-radius: 0; |
|||
display: inline-block; |
|||
padding: 3px; |
|||
} |
|||
|
|||
.daterangepicker .calendar-table .next span { |
|||
transform: rotate(-45deg); |
|||
-webkit-transform: rotate(-45deg); |
|||
} |
|||
|
|||
.daterangepicker .calendar-table .prev span { |
|||
transform: rotate(135deg); |
|||
-webkit-transform: rotate(135deg); |
|||
} |
|||
|
|||
.daterangepicker .calendar-table th, .daterangepicker .calendar-table td { |
|||
white-space: nowrap; |
|||
text-align: center; |
|||
vertical-align: middle; |
|||
min-width: 32px; |
|||
width: 32px; |
|||
height: 24px; |
|||
line-height: 24px; |
|||
font-size: 12px; |
|||
border-radius: 4px; |
|||
border: 1px solid transparent; |
|||
white-space: nowrap; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.daterangepicker .calendar-table { |
|||
border: 1px solid #fff; |
|||
border-radius: 4px; |
|||
background-color: #fff; |
|||
} |
|||
|
|||
.daterangepicker .calendar-table table { |
|||
width: 100%; |
|||
margin: 0; |
|||
border-spacing: 0; |
|||
border-collapse: collapse; |
|||
} |
|||
|
|||
.daterangepicker td.available:hover, .daterangepicker th.available:hover { |
|||
background-color: #eee; |
|||
border-color: transparent; |
|||
color: inherit; |
|||
} |
|||
|
|||
.daterangepicker td.week, .daterangepicker th.week { |
|||
font-size: 80%; |
|||
color: #ccc; |
|||
} |
|||
|
|||
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date { |
|||
background-color: #fff; |
|||
border-color: transparent; |
|||
color: #999; |
|||
} |
|||
|
|||
.daterangepicker td.in-range { |
|||
background-color: #ebf4f8; |
|||
border-color: transparent; |
|||
color: #000; |
|||
border-radius: 0; |
|||
} |
|||
|
|||
.daterangepicker td.start-date { |
|||
border-radius: 4px 0 0 4px; |
|||
} |
|||
|
|||
.daterangepicker td.end-date { |
|||
border-radius: 0 4px 4px 0; |
|||
} |
|||
|
|||
.daterangepicker td.start-date.end-date { |
|||
border-radius: 4px; |
|||
} |
|||
|
|||
.daterangepicker td.active, .daterangepicker td.active:hover { |
|||
background-color: #357ebd; |
|||
border-color: transparent; |
|||
color: #fff; |
|||
} |
|||
|
|||
.daterangepicker th.month { |
|||
width: auto; |
|||
} |
|||
|
|||
.daterangepicker td.disabled, .daterangepicker option.disabled { |
|||
color: #999; |
|||
cursor: not-allowed; |
|||
text-decoration: line-through; |
|||
} |
|||
|
|||
.daterangepicker select.monthselect, .daterangepicker select.yearselect { |
|||
font-size: 12px; |
|||
padding: 1px; |
|||
height: auto; |
|||
margin: 0; |
|||
cursor: default; |
|||
} |
|||
|
|||
.daterangepicker select.monthselect { |
|||
margin-right: 2%; |
|||
width: 56%; |
|||
} |
|||
|
|||
.daterangepicker select.yearselect { |
|||
width: 40%; |
|||
} |
|||
|
|||
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect { |
|||
width: 50px; |
|||
margin: 0 auto; |
|||
background: #eee; |
|||
border: 1px solid #eee; |
|||
padding: 2px; |
|||
outline: 0; |
|||
font-size: 12px; |
|||
} |
|||
|
|||
.daterangepicker .calendar-time { |
|||
text-align: center; |
|||
margin: 4px auto 0 auto; |
|||
line-height: 30px; |
|||
position: relative; |
|||
} |
|||
|
|||
.daterangepicker .calendar-time select.disabled { |
|||
color: #ccc; |
|||
cursor: not-allowed; |
|||
} |
|||
|
|||
.daterangepicker .drp-buttons { |
|||
clear: both; |
|||
text-align: right; |
|||
padding: 8px; |
|||
border-top: 1px solid #ddd; |
|||
display: none; |
|||
line-height: 12px; |
|||
vertical-align: middle; |
|||
} |
|||
|
|||
.daterangepicker .drp-selected { |
|||
display: inline-block; |
|||
font-size: 12px; |
|||
padding-right: 8px; |
|||
} |
|||
|
|||
.daterangepicker .drp-buttons .btn { |
|||
margin-left: 8px; |
|||
font-size: 12px; |
|||
font-weight: bold; |
|||
padding: 4px 8px; |
|||
} |
|||
|
|||
.daterangepicker.show-ranges.single.rtl .drp-calendar.left { |
|||
border-right: 1px solid #ddd; |
|||
} |
|||
|
|||
.daterangepicker.show-ranges.single.ltr .drp-calendar.left { |
|||
border-left: 1px solid #ddd; |
|||
} |
|||
|
|||
.daterangepicker.show-ranges.rtl .drp-calendar.right { |
|||
border-right: 1px solid #ddd; |
|||
} |
|||
|
|||
.daterangepicker.show-ranges.ltr .drp-calendar.left { |
|||
border-left: 1px solid #ddd; |
|||
} |
|||
|
|||
.daterangepicker .ranges { |
|||
float: none; |
|||
text-align: left; |
|||
margin: 0; |
|||
} |
|||
|
|||
.daterangepicker.show-calendar .ranges { |
|||
margin-top: 8px; |
|||
} |
|||
|
|||
.daterangepicker .ranges ul { |
|||
list-style: none; |
|||
margin: 0 auto; |
|||
padding: 0; |
|||
width: 100%; |
|||
} |
|||
|
|||
.daterangepicker .ranges li { |
|||
font-size: 12px; |
|||
padding: 8px 12px; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.daterangepicker .ranges li:hover { |
|||
background-color: #eee; |
|||
} |
|||
|
|||
.daterangepicker .ranges li.active { |
|||
background-color: #08c; |
|||
color: #fff; |
|||
} |
|||
|
|||
/* Larger Screen Styling */ |
|||
@media (min-width: 564px) { |
|||
.daterangepicker { |
|||
width: auto; |
|||
} |
|||
|
|||
.daterangepicker .ranges ul { |
|||
width: 140px; |
|||
} |
|||
|
|||
.daterangepicker.single .ranges ul { |
|||
width: 100%; |
|||
} |
|||
|
|||
.daterangepicker.single .drp-calendar.left { |
|||
clear: none; |
|||
} |
|||
|
|||
.daterangepicker.single .ranges, .daterangepicker.single .drp-calendar { |
|||
float: left; |
|||
} |
|||
|
|||
.daterangepicker { |
|||
direction: ltr; |
|||
text-align: left; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left { |
|||
clear: left; |
|||
margin-right: 0; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left .calendar-table { |
|||
border-right: none; |
|||
border-top-right-radius: 0; |
|||
border-bottom-right-radius: 0; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.right { |
|||
margin-left: 0; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.right .calendar-table { |
|||
border-left: none; |
|||
border-top-left-radius: 0; |
|||
border-bottom-left-radius: 0; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left .calendar-table { |
|||
padding-right: 8px; |
|||
} |
|||
|
|||
.daterangepicker .ranges, .daterangepicker .drp-calendar { |
|||
float: left; |
|||
} |
|||
} |
|||
|
|||
@media (min-width: 730px) { |
|||
.daterangepicker .ranges { |
|||
width: auto; |
|||
} |
|||
|
|||
.daterangepicker .ranges { |
|||
float: left; |
|||
} |
|||
|
|||
.daterangepicker.rtl .ranges { |
|||
float: right; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left { |
|||
clear: none !important; |
|||
} |
|||
} |
|||
.daterangepicker { |
|||
position: absolute; |
|||
color: inherit; |
|||
background-color: #fff; |
|||
border-radius: 4px; |
|||
border: 1px solid #ddd; |
|||
width: 278px; |
|||
max-width: none; |
|||
padding: 0; |
|||
margin-top: 7px; |
|||
top: 100px; |
|||
left: 20px; |
|||
z-index: 3001; |
|||
display: none; |
|||
font-family: arial; |
|||
font-size: 15px; |
|||
line-height: 1em; |
|||
} |
|||
|
|||
.daterangepicker:before, .daterangepicker:after { |
|||
position: absolute; |
|||
display: inline-block; |
|||
border-bottom-color: rgba(0, 0, 0, 0.2); |
|||
content: ''; |
|||
} |
|||
|
|||
.daterangepicker:before { |
|||
top: -7px; |
|||
border-right: 7px solid transparent; |
|||
border-left: 7px solid transparent; |
|||
border-bottom: 7px solid #ccc; |
|||
} |
|||
|
|||
.daterangepicker:after { |
|||
top: -6px; |
|||
border-right: 6px solid transparent; |
|||
border-bottom: 6px solid #fff; |
|||
border-left: 6px solid transparent; |
|||
} |
|||
|
|||
.daterangepicker.opensleft:before { |
|||
right: 9px; |
|||
} |
|||
|
|||
.daterangepicker.opensleft:after { |
|||
right: 10px; |
|||
} |
|||
|
|||
.daterangepicker.openscenter:before { |
|||
left: 0; |
|||
right: 0; |
|||
width: 0; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
.daterangepicker.openscenter:after { |
|||
left: 0; |
|||
right: 0; |
|||
width: 0; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
.daterangepicker.opensright:before { |
|||
left: 9px; |
|||
} |
|||
|
|||
.daterangepicker.opensright:after { |
|||
left: 10px; |
|||
} |
|||
|
|||
.daterangepicker.drop-up { |
|||
margin-top: -7px; |
|||
} |
|||
|
|||
.daterangepicker.drop-up:before { |
|||
top: initial; |
|||
bottom: -7px; |
|||
border-bottom: initial; |
|||
border-top: 7px solid #ccc; |
|||
} |
|||
|
|||
.daterangepicker.drop-up:after { |
|||
top: initial; |
|||
bottom: -6px; |
|||
border-bottom: initial; |
|||
border-top: 6px solid #fff; |
|||
} |
|||
|
|||
.daterangepicker.single .daterangepicker .ranges, .daterangepicker.single .drp-calendar { |
|||
float: none; |
|||
} |
|||
|
|||
.daterangepicker.single .drp-selected { |
|||
display: none; |
|||
} |
|||
|
|||
.daterangepicker.show-calendar .drp-calendar { |
|||
display: block; |
|||
} |
|||
|
|||
.daterangepicker.show-calendar .drp-buttons { |
|||
display: block; |
|||
} |
|||
|
|||
.daterangepicker.auto-apply .drp-buttons { |
|||
display: none; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar { |
|||
display: none; |
|||
max-width: 270px; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left { |
|||
padding: 8px 0 8px 8px; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.right { |
|||
padding: 8px; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.single .calendar-table { |
|||
border: none; |
|||
} |
|||
|
|||
.daterangepicker .calendar-table .next span, .daterangepicker .calendar-table .prev span { |
|||
color: #fff; |
|||
border: solid black; |
|||
border-width: 0 2px 2px 0; |
|||
border-radius: 0; |
|||
display: inline-block; |
|||
padding: 3px; |
|||
} |
|||
|
|||
.daterangepicker .calendar-table .next span { |
|||
transform: rotate(-45deg); |
|||
-webkit-transform: rotate(-45deg); |
|||
} |
|||
|
|||
.daterangepicker .calendar-table .prev span { |
|||
transform: rotate(135deg); |
|||
-webkit-transform: rotate(135deg); |
|||
} |
|||
|
|||
.daterangepicker .calendar-table th, .daterangepicker .calendar-table td { |
|||
white-space: nowrap; |
|||
text-align: center; |
|||
vertical-align: middle; |
|||
min-width: 32px; |
|||
width: 32px; |
|||
height: 24px; |
|||
line-height: 24px; |
|||
font-size: 12px; |
|||
border-radius: 4px; |
|||
border: 1px solid transparent; |
|||
white-space: nowrap; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.daterangepicker .calendar-table { |
|||
border: 1px solid #fff; |
|||
border-radius: 4px; |
|||
background-color: #fff; |
|||
} |
|||
|
|||
.daterangepicker .calendar-table table { |
|||
width: 100%; |
|||
margin: 0; |
|||
border-spacing: 0; |
|||
border-collapse: collapse; |
|||
} |
|||
|
|||
.daterangepicker td.available:hover, .daterangepicker th.available:hover { |
|||
background-color: #eee; |
|||
border-color: transparent; |
|||
color: inherit; |
|||
} |
|||
|
|||
.daterangepicker td.week, .daterangepicker th.week { |
|||
font-size: 80%; |
|||
color: #ccc; |
|||
} |
|||
|
|||
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date { |
|||
background-color: #fff; |
|||
border-color: transparent; |
|||
color: #999; |
|||
} |
|||
|
|||
.daterangepicker td.in-range { |
|||
background-color: #ebf4f8; |
|||
border-color: transparent; |
|||
color: #000; |
|||
border-radius: 0; |
|||
} |
|||
|
|||
.daterangepicker td.start-date { |
|||
border-radius: 4px 0 0 4px; |
|||
} |
|||
|
|||
.daterangepicker td.end-date { |
|||
border-radius: 0 4px 4px 0; |
|||
} |
|||
|
|||
.daterangepicker td.start-date.end-date { |
|||
border-radius: 4px; |
|||
} |
|||
|
|||
.daterangepicker td.active, .daterangepicker td.active:hover { |
|||
background-color: #357ebd; |
|||
border-color: transparent; |
|||
color: #fff; |
|||
} |
|||
|
|||
.daterangepicker th.month { |
|||
width: auto; |
|||
} |
|||
|
|||
.daterangepicker td.disabled, .daterangepicker option.disabled { |
|||
color: #999; |
|||
cursor: not-allowed; |
|||
text-decoration: line-through; |
|||
} |
|||
|
|||
.daterangepicker select.monthselect, .daterangepicker select.yearselect { |
|||
font-size: 12px; |
|||
padding: 1px; |
|||
height: auto; |
|||
margin: 0; |
|||
cursor: default; |
|||
} |
|||
|
|||
.daterangepicker select.monthselect { |
|||
margin-right: 2%; |
|||
width: 56%; |
|||
} |
|||
|
|||
.daterangepicker select.yearselect { |
|||
width: 40%; |
|||
} |
|||
|
|||
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect { |
|||
width: 50px; |
|||
margin: 0 auto; |
|||
background: #eee; |
|||
border: 1px solid #eee; |
|||
padding: 2px; |
|||
outline: 0; |
|||
font-size: 12px; |
|||
} |
|||
|
|||
.daterangepicker .calendar-time { |
|||
text-align: center; |
|||
margin: 4px auto 0 auto; |
|||
line-height: 30px; |
|||
position: relative; |
|||
} |
|||
|
|||
.daterangepicker .calendar-time select.disabled { |
|||
color: #ccc; |
|||
cursor: not-allowed; |
|||
} |
|||
|
|||
.daterangepicker .drp-buttons { |
|||
clear: both; |
|||
text-align: right; |
|||
padding: 8px; |
|||
border-top: 1px solid #ddd; |
|||
display: none; |
|||
line-height: 12px; |
|||
vertical-align: middle; |
|||
} |
|||
|
|||
.daterangepicker .drp-selected { |
|||
display: inline-block; |
|||
font-size: 12px; |
|||
padding-right: 8px; |
|||
} |
|||
|
|||
.daterangepicker .drp-buttons .btn { |
|||
margin-left: 8px; |
|||
font-size: 12px; |
|||
font-weight: bold; |
|||
padding: 4px 8px; |
|||
} |
|||
|
|||
.daterangepicker.show-ranges.single.rtl .drp-calendar.left { |
|||
border-right: 1px solid #ddd; |
|||
} |
|||
|
|||
.daterangepicker.show-ranges.single.ltr .drp-calendar.left { |
|||
border-left: 1px solid #ddd; |
|||
} |
|||
|
|||
.daterangepicker.show-ranges.rtl .drp-calendar.right { |
|||
border-right: 1px solid #ddd; |
|||
} |
|||
|
|||
.daterangepicker.show-ranges.ltr .drp-calendar.left { |
|||
border-left: 1px solid #ddd; |
|||
} |
|||
|
|||
.daterangepicker .ranges { |
|||
float: none; |
|||
text-align: left; |
|||
margin: 0; |
|||
} |
|||
|
|||
.daterangepicker.show-calendar .ranges { |
|||
margin-top: 8px; |
|||
} |
|||
|
|||
.daterangepicker .ranges ul { |
|||
list-style: none; |
|||
margin: 0 auto; |
|||
padding: 0; |
|||
width: 100%; |
|||
} |
|||
|
|||
.daterangepicker .ranges li { |
|||
font-size: 12px; |
|||
padding: 8px 12px; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.daterangepicker .ranges li:hover { |
|||
background-color: #eee; |
|||
} |
|||
|
|||
.daterangepicker .ranges li.active { |
|||
background-color: #08c; |
|||
color: #fff; |
|||
} |
|||
|
|||
/* Larger Screen Styling */ |
|||
@media (min-width: 564px) { |
|||
.daterangepicker { |
|||
width: auto; |
|||
} |
|||
|
|||
.daterangepicker .ranges ul { |
|||
width: 140px; |
|||
} |
|||
|
|||
.daterangepicker.single .ranges ul { |
|||
width: 100%; |
|||
} |
|||
|
|||
.daterangepicker.single .drp-calendar.left { |
|||
clear: none; |
|||
} |
|||
|
|||
.daterangepicker.single .ranges, .daterangepicker.single .drp-calendar { |
|||
float: left; |
|||
} |
|||
|
|||
.daterangepicker { |
|||
direction: ltr; |
|||
text-align: left; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left { |
|||
clear: left; |
|||
margin-right: 0; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left .calendar-table { |
|||
border-right: none; |
|||
border-top-right-radius: 0; |
|||
border-bottom-right-radius: 0; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.right { |
|||
margin-left: 0; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.right .calendar-table { |
|||
border-left: none; |
|||
border-top-left-radius: 0; |
|||
border-bottom-left-radius: 0; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left .calendar-table { |
|||
padding-right: 8px; |
|||
} |
|||
|
|||
.daterangepicker .ranges, .daterangepicker .drp-calendar { |
|||
float: left; |
|||
} |
|||
} |
|||
|
|||
@media (min-width: 730px) { |
|||
.daterangepicker .ranges { |
|||
width: auto; |
|||
} |
|||
|
|||
.daterangepicker .ranges { |
|||
float: left; |
|||
} |
|||
|
|||
.daterangepicker.rtl .ranges { |
|||
float: right; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left { |
|||
clear: none !important; |
|||
} |
|||
} |
|||
|
|||
File diff suppressed because it is too large
@ -1,5 +1,5 @@ |
|||
(function () { |
|||
[].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')).map(function (popoverTriggerEl) { |
|||
return new bootstrap.Popover(popoverTriggerEl) |
|||
}) |
|||
})(); |
|||
(function () { |
|||
[].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')).map(function (popoverTriggerEl) { |
|||
return new bootstrap.Popover(popoverTriggerEl) |
|||
}) |
|||
})(); |
|||
|
|||
@ -1,5 +1,5 @@ |
|||
(function () { |
|||
[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function (tooltipTriggerEl) { |
|||
return new bootstrap.Tooltip(tooltipTriggerEl) |
|||
}); |
|||
})(); |
|||
(function () { |
|||
[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function (tooltipTriggerEl) { |
|||
return new bootstrap.Tooltip(tooltipTriggerEl) |
|||
}); |
|||
})(); |
|||
|
|||
File diff suppressed because one or more lines are too long
@ -1,432 +1,432 @@ |
|||
// Unobtrusive validation support library for jQuery and jQuery Validate
|
|||
// 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.
|
|||
// @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 */ |
|||
/*global document: false, jQuery: false */ |
|||
|
|||
(function (factory) { |
|||
if (typeof define === 'function' && define.amd) { |
|||
// AMD. Register as an anonymous module.
|
|||
define("jquery.validate.unobtrusive", ['jquery-validation'], factory); |
|||
} else if (typeof module === 'object' && module.exports) { |
|||
// CommonJS-like environments that support module.exports
|
|||
module.exports = factory(require('jquery-validation')); |
|||
} else { |
|||
// Browser global
|
|||
jQuery.validator.unobtrusive = factory(jQuery); |
|||
} |
|||
}(function ($) { |
|||
var $jQval = $.validator, |
|||
adapters, |
|||
data_validation = "unobtrusiveValidation"; |
|||
|
|||
function setValidationValues(options, ruleName, value) { |
|||
options.rules[ruleName] = value; |
|||
if (options.message) { |
|||
options.messages[ruleName] = options.message; |
|||
} |
|||
} |
|||
|
|||
function splitAndTrim(value) { |
|||
return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g); |
|||
} |
|||
|
|||
function escapeAttributeValue(value) { |
|||
// As mentioned on http://api.jquery.com/category/selectors/
|
|||
return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1"); |
|||
} |
|||
|
|||
function getModelPrefix(fieldName) { |
|||
return fieldName.substr(0, fieldName.lastIndexOf(".") + 1); |
|||
} |
|||
|
|||
function appendModelPrefix(value, prefix) { |
|||
if (value.indexOf("*.") === 0) { |
|||
value = value.replace("*.", prefix); |
|||
} |
|||
return value; |
|||
} |
|||
|
|||
function onError(error, inputElement) { // 'this' is the form element
|
|||
var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"), |
|||
replaceAttrValue = container.attr("data-valmsg-replace"), |
|||
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null; |
|||
|
|||
container.removeClass("field-validation-valid").addClass("field-validation-error"); |
|||
error.data("unobtrusiveContainer", container); |
|||
|
|||
if (replace) { |
|||
container.empty(); |
|||
error.removeClass("input-validation-error").appendTo(container); |
|||
} |
|||
else { |
|||
error.hide(); |
|||
} |
|||
} |
|||
|
|||
function onErrors(event, validator) { // 'this' is the form element
|
|||
var container = $(this).find("[data-valmsg-summary=true]"), |
|||
list = container.find("ul"); |
|||
|
|||
if (list && list.length && validator.errorList.length) { |
|||
list.empty(); |
|||
container.addClass("validation-summary-errors").removeClass("validation-summary-valid"); |
|||
|
|||
$.each(validator.errorList, function () { |
|||
$("<li />").html(this.message).appendTo(list); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
function onSuccess(error) { // 'this' is the form element
|
|||
var container = error.data("unobtrusiveContainer"); |
|||
|
|||
if (container) { |
|||
var replaceAttrValue = container.attr("data-valmsg-replace"), |
|||
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null; |
|||
|
|||
container.addClass("field-validation-valid").removeClass("field-validation-error"); |
|||
error.removeData("unobtrusiveContainer"); |
|||
|
|||
if (replace) { |
|||
container.empty(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
function onReset(event) { // 'this' is the form element
|
|||
var $form = $(this), |
|||
key = '__jquery_unobtrusive_validation_form_reset'; |
|||
if ($form.data(key)) { |
|||
return; |
|||
} |
|||
// Set a flag that indicates we're currently resetting the form.
|
|||
$form.data(key, true); |
|||
try { |
|||
$form.data("validator").resetForm(); |
|||
} finally { |
|||
$form.removeData(key); |
|||
} |
|||
|
|||
$form.find(".validation-summary-errors") |
|||
.addClass("validation-summary-valid") |
|||
.removeClass("validation-summary-errors"); |
|||
$form.find(".field-validation-error") |
|||
.addClass("field-validation-valid") |
|||
.removeClass("field-validation-error") |
|||
.removeData("unobtrusiveContainer") |
|||
.find(">*") // If we were using valmsg-replace, get the underlying error
|
|||
.removeData("unobtrusiveContainer"); |
|||
} |
|||
|
|||
function validationInfo(form) { |
|||
var $form = $(form), |
|||
result = $form.data(data_validation), |
|||
onResetProxy = $.proxy(onReset, form), |
|||
defaultOptions = $jQval.unobtrusive.options || {}, |
|||
execInContext = function (name, args) { |
|||
var func = defaultOptions[name]; |
|||
func && $.isFunction(func) && func.apply(form, args); |
|||
}; |
|||
|
|||
if (!result) { |
|||
result = { |
|||
options: { // options structure passed to jQuery Validate's validate() method
|
|||
errorClass: defaultOptions.errorClass || "input-validation-error", |
|||
errorElement: defaultOptions.errorElement || "span", |
|||
errorPlacement: function () { |
|||
onError.apply(form, arguments); |
|||
execInContext("errorPlacement", arguments); |
|||
}, |
|||
invalidHandler: function () { |
|||
onErrors.apply(form, arguments); |
|||
execInContext("invalidHandler", arguments); |
|||
}, |
|||
messages: {}, |
|||
rules: {}, |
|||
success: function () { |
|||
onSuccess.apply(form, arguments); |
|||
execInContext("success", arguments); |
|||
} |
|||
}, |
|||
attachValidation: function () { |
|||
$form |
|||
.off("reset." + data_validation, onResetProxy) |
|||
.on("reset." + data_validation, onResetProxy) |
|||
.validate(this.options); |
|||
}, |
|||
validate: function () { // a validation function that is called by unobtrusive Ajax
|
|||
$form.validate(); |
|||
return $form.valid(); |
|||
} |
|||
}; |
|||
$form.data(data_validation, result); |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
|
|||
$jQval.unobtrusive = { |
|||
adapters: [], |
|||
|
|||
parseElement: function (element, skipAttach) { |
|||
/// <summary>
|
|||
/// Parses a single HTML element for unobtrusive validation attributes.
|
|||
/// </summary>
|
|||
/// <param name="element" domElement="true">The HTML element to be parsed.</param>
|
|||
/// <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.
|
|||
/// 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>
|
|||
var $element = $(element), |
|||
form = $element.parents("form")[0], |
|||
valInfo, rules, messages; |
|||
|
|||
if (!form) { // Cannot do client-side validation without a form
|
|||
return; |
|||
} |
|||
|
|||
valInfo = validationInfo(form); |
|||
valInfo.options.rules[element.name] = rules = {}; |
|||
valInfo.options.messages[element.name] = messages = {}; |
|||
|
|||
$.each(this.adapters, function () { |
|||
var prefix = "data-val-" + this.name, |
|||
message = $element.attr(prefix), |
|||
paramValues = {}; |
|||
|
|||
if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy)
|
|||
prefix += "-"; |
|||
|
|||
$.each(this.params, function () { |
|||
paramValues[this] = $element.attr(prefix + this); |
|||
}); |
|||
|
|||
this.adapt({ |
|||
element: element, |
|||
form: form, |
|||
message: message, |
|||
params: paramValues, |
|||
rules: rules, |
|||
messages: messages |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
$.extend(rules, { "__dummy__": true }); |
|||
|
|||
if (!skipAttach) { |
|||
valInfo.attachValidation(); |
|||
} |
|||
}, |
|||
|
|||
parse: function (selector) { |
|||
/// <summary>
|
|||
/// 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-*
|
|||
/// attribute values.
|
|||
/// </summary>
|
|||
/// <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
|
|||
// element with data-val=true
|
|||
var $selector = $(selector), |
|||
$forms = $selector.parents() |
|||
.addBack() |
|||
.filter("form") |
|||
.add($selector.find("form")) |
|||
.has("[data-val=true]"); |
|||
|
|||
$selector.find("[data-val=true]").each(function () { |
|||
$jQval.unobtrusive.parseElement(this, true); |
|||
}); |
|||
|
|||
$forms.each(function () { |
|||
var info = validationInfo(this); |
|||
if (info) { |
|||
info.attachValidation(); |
|||
} |
|||
}); |
|||
} |
|||
}; |
|||
|
|||
adapters = $jQval.unobtrusive.adapters; |
|||
|
|||
adapters.add = function (adapterName, params, fn) { |
|||
/// <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
|
|||
/// 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
|
|||
/// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and
|
|||
/// mmmm is the parameter name).</param>
|
|||
/// <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>
|
|||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
|||
if (!fn) { // Called with no params, just a function
|
|||
fn = params; |
|||
params = []; |
|||
} |
|||
this.push({ name: adapterName, params: params, adapt: fn }); |
|||
return this; |
|||
}; |
|||
|
|||
adapters.addBool = function (adapterName, ruleName) { |
|||
/// <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>
|
|||
/// <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>
|
|||
/// <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>
|
|||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
|||
return this.add(adapterName, function (options) { |
|||
setValidationValues(options, ruleName || adapterName, true); |
|||
}); |
|||
}; |
|||
|
|||
adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) { |
|||
/// <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
|
|||
/// 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
|
|||
/// 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
|
|||
/// have a minimum value.</param>
|
|||
/// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only
|
|||
/// have a maximum value.</param>
|
|||
/// <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>
|
|||
/// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
|||
/// contains the minimum value. The default is "min".</param>
|
|||
/// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
|||
/// contains the maximum value. The default is "max".</param>
|
|||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
|||
return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) { |
|||
var min = options.params.min, |
|||
max = options.params.max; |
|||
|
|||
if (min && max) { |
|||
setValidationValues(options, minMaxRuleName, [min, max]); |
|||
} |
|||
else if (min) { |
|||
setValidationValues(options, minRuleName, min); |
|||
} |
|||
else if (max) { |
|||
setValidationValues(options, maxRuleName, max); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
adapters.addSingleVal = function (adapterName, attribute, ruleName) { |
|||
/// <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>
|
|||
/// <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>
|
|||
/// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value.
|
|||
/// 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
|
|||
/// of adapterName will be used instead.</param>
|
|||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
|||
return this.add(adapterName, [attribute || "val"], function (options) { |
|||
setValidationValues(options, ruleName || adapterName, options.params[attribute]); |
|||
}); |
|||
}; |
|||
|
|||
$jQval.addMethod("__dummy__", function (value, element, params) { |
|||
return true; |
|||
}); |
|||
|
|||
$jQval.addMethod("regex", function (value, element, params) { |
|||
var match; |
|||
if (this.optional(element)) { |
|||
return true; |
|||
} |
|||
|
|||
match = new RegExp(params).exec(value); |
|||
return (match && (match.index === 0) && (match[0].length === value.length)); |
|||
}); |
|||
|
|||
$jQval.addMethod("nonalphamin", function (value, element, nonalphamin) { |
|||
var match; |
|||
if (nonalphamin) { |
|||
match = value.match(/\W/g); |
|||
match = match && match.length >= nonalphamin; |
|||
} |
|||
return match; |
|||
}); |
|||
|
|||
if ($jQval.methods.extension) { |
|||
adapters.addSingleVal("accept", "mimtype"); |
|||
adapters.addSingleVal("extension", "extension"); |
|||
} else { |
|||
// 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
|
|||
// validating the extension, and ignore mime-type validations as they are not supported.
|
|||
adapters.addSingleVal("extension", "extension", "accept"); |
|||
} |
|||
|
|||
adapters.addSingleVal("regex", "pattern"); |
|||
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("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength"); |
|||
adapters.add("equalto", ["other"], function (options) { |
|||
var prefix = getModelPrefix(options.element.name), |
|||
other = options.params.other, |
|||
fullOtherName = appendModelPrefix(other, prefix), |
|||
element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0]; |
|||
|
|||
setValidationValues(options, "equalTo", element); |
|||
}); |
|||
adapters.add("required", function (options) { |
|||
// jQuery Validate equates "required" with "mandatory" for checkbox elements
|
|||
if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") { |
|||
setValidationValues(options, "required", true); |
|||
} |
|||
}); |
|||
adapters.add("remote", ["url", "type", "additionalfields"], function (options) { |
|||
var value = { |
|||
url: options.params.url, |
|||
type: options.params.type || "GET", |
|||
data: {} |
|||
}, |
|||
prefix = getModelPrefix(options.element.name); |
|||
|
|||
$.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) { |
|||
var paramName = appendModelPrefix(fieldName, prefix); |
|||
value.data[paramName] = function () { |
|||
var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']"); |
|||
// For checkboxes and radio buttons, only pick up values from checked fields.
|
|||
if (field.is(":checkbox")) { |
|||
return field.filter(":checked").val() || field.filter(":hidden").val() || ''; |
|||
} |
|||
else if (field.is(":radio")) { |
|||
return field.filter(":checked").val() || ''; |
|||
} |
|||
return field.val(); |
|||
}; |
|||
}); |
|||
|
|||
setValidationValues(options, "remote", value); |
|||
}); |
|||
adapters.add("password", ["min", "nonalphamin", "regex"], function (options) { |
|||
if (options.params.min) { |
|||
setValidationValues(options, "minlength", options.params.min); |
|||
} |
|||
if (options.params.nonalphamin) { |
|||
setValidationValues(options, "nonalphamin", options.params.nonalphamin); |
|||
} |
|||
if (options.params.regex) { |
|||
setValidationValues(options, "regex", options.params.regex); |
|||
} |
|||
}); |
|||
adapters.add("fileextensions", ["extensions"], function (options) { |
|||
setValidationValues(options, "extension", options.params.extensions); |
|||
}); |
|||
|
|||
$(function () { |
|||
$jQval.unobtrusive.parse(document); |
|||
}); |
|||
|
|||
return $jQval.unobtrusive; |
|||
})); |
|||
// Unobtrusive validation support library for jQuery and jQuery Validate
|
|||
// 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.
|
|||
// @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 */ |
|||
/*global document: false, jQuery: false */ |
|||
|
|||
(function (factory) { |
|||
if (typeof define === 'function' && define.amd) { |
|||
// AMD. Register as an anonymous module.
|
|||
define("jquery.validate.unobtrusive", ['jquery-validation'], factory); |
|||
} else if (typeof module === 'object' && module.exports) { |
|||
// CommonJS-like environments that support module.exports
|
|||
module.exports = factory(require('jquery-validation')); |
|||
} else { |
|||
// Browser global
|
|||
jQuery.validator.unobtrusive = factory(jQuery); |
|||
} |
|||
}(function ($) { |
|||
var $jQval = $.validator, |
|||
adapters, |
|||
data_validation = "unobtrusiveValidation"; |
|||
|
|||
function setValidationValues(options, ruleName, value) { |
|||
options.rules[ruleName] = value; |
|||
if (options.message) { |
|||
options.messages[ruleName] = options.message; |
|||
} |
|||
} |
|||
|
|||
function splitAndTrim(value) { |
|||
return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g); |
|||
} |
|||
|
|||
function escapeAttributeValue(value) { |
|||
// As mentioned on http://api.jquery.com/category/selectors/
|
|||
return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1"); |
|||
} |
|||
|
|||
function getModelPrefix(fieldName) { |
|||
return fieldName.substr(0, fieldName.lastIndexOf(".") + 1); |
|||
} |
|||
|
|||
function appendModelPrefix(value, prefix) { |
|||
if (value.indexOf("*.") === 0) { |
|||
value = value.replace("*.", prefix); |
|||
} |
|||
return value; |
|||
} |
|||
|
|||
function onError(error, inputElement) { // 'this' is the form element
|
|||
var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"), |
|||
replaceAttrValue = container.attr("data-valmsg-replace"), |
|||
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null; |
|||
|
|||
container.removeClass("field-validation-valid").addClass("field-validation-error"); |
|||
error.data("unobtrusiveContainer", container); |
|||
|
|||
if (replace) { |
|||
container.empty(); |
|||
error.removeClass("input-validation-error").appendTo(container); |
|||
} |
|||
else { |
|||
error.hide(); |
|||
} |
|||
} |
|||
|
|||
function onErrors(event, validator) { // 'this' is the form element
|
|||
var container = $(this).find("[data-valmsg-summary=true]"), |
|||
list = container.find("ul"); |
|||
|
|||
if (list && list.length && validator.errorList.length) { |
|||
list.empty(); |
|||
container.addClass("validation-summary-errors").removeClass("validation-summary-valid"); |
|||
|
|||
$.each(validator.errorList, function () { |
|||
$("<li />").html(this.message).appendTo(list); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
function onSuccess(error) { // 'this' is the form element
|
|||
var container = error.data("unobtrusiveContainer"); |
|||
|
|||
if (container) { |
|||
var replaceAttrValue = container.attr("data-valmsg-replace"), |
|||
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null; |
|||
|
|||
container.addClass("field-validation-valid").removeClass("field-validation-error"); |
|||
error.removeData("unobtrusiveContainer"); |
|||
|
|||
if (replace) { |
|||
container.empty(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
function onReset(event) { // 'this' is the form element
|
|||
var $form = $(this), |
|||
key = '__jquery_unobtrusive_validation_form_reset'; |
|||
if ($form.data(key)) { |
|||
return; |
|||
} |
|||
// Set a flag that indicates we're currently resetting the form.
|
|||
$form.data(key, true); |
|||
try { |
|||
$form.data("validator").resetForm(); |
|||
} finally { |
|||
$form.removeData(key); |
|||
} |
|||
|
|||
$form.find(".validation-summary-errors") |
|||
.addClass("validation-summary-valid") |
|||
.removeClass("validation-summary-errors"); |
|||
$form.find(".field-validation-error") |
|||
.addClass("field-validation-valid") |
|||
.removeClass("field-validation-error") |
|||
.removeData("unobtrusiveContainer") |
|||
.find(">*") // If we were using valmsg-replace, get the underlying error
|
|||
.removeData("unobtrusiveContainer"); |
|||
} |
|||
|
|||
function validationInfo(form) { |
|||
var $form = $(form), |
|||
result = $form.data(data_validation), |
|||
onResetProxy = $.proxy(onReset, form), |
|||
defaultOptions = $jQval.unobtrusive.options || {}, |
|||
execInContext = function (name, args) { |
|||
var func = defaultOptions[name]; |
|||
func && $.isFunction(func) && func.apply(form, args); |
|||
}; |
|||
|
|||
if (!result) { |
|||
result = { |
|||
options: { // options structure passed to jQuery Validate's validate() method
|
|||
errorClass: defaultOptions.errorClass || "input-validation-error", |
|||
errorElement: defaultOptions.errorElement || "span", |
|||
errorPlacement: function () { |
|||
onError.apply(form, arguments); |
|||
execInContext("errorPlacement", arguments); |
|||
}, |
|||
invalidHandler: function () { |
|||
onErrors.apply(form, arguments); |
|||
execInContext("invalidHandler", arguments); |
|||
}, |
|||
messages: {}, |
|||
rules: {}, |
|||
success: function () { |
|||
onSuccess.apply(form, arguments); |
|||
execInContext("success", arguments); |
|||
} |
|||
}, |
|||
attachValidation: function () { |
|||
$form |
|||
.off("reset." + data_validation, onResetProxy) |
|||
.on("reset." + data_validation, onResetProxy) |
|||
.validate(this.options); |
|||
}, |
|||
validate: function () { // a validation function that is called by unobtrusive Ajax
|
|||
$form.validate(); |
|||
return $form.valid(); |
|||
} |
|||
}; |
|||
$form.data(data_validation, result); |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
|
|||
$jQval.unobtrusive = { |
|||
adapters: [], |
|||
|
|||
parseElement: function (element, skipAttach) { |
|||
/// <summary>
|
|||
/// Parses a single HTML element for unobtrusive validation attributes.
|
|||
/// </summary>
|
|||
/// <param name="element" domElement="true">The HTML element to be parsed.</param>
|
|||
/// <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.
|
|||
/// 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>
|
|||
var $element = $(element), |
|||
form = $element.parents("form")[0], |
|||
valInfo, rules, messages; |
|||
|
|||
if (!form) { // Cannot do client-side validation without a form
|
|||
return; |
|||
} |
|||
|
|||
valInfo = validationInfo(form); |
|||
valInfo.options.rules[element.name] = rules = {}; |
|||
valInfo.options.messages[element.name] = messages = {}; |
|||
|
|||
$.each(this.adapters, function () { |
|||
var prefix = "data-val-" + this.name, |
|||
message = $element.attr(prefix), |
|||
paramValues = {}; |
|||
|
|||
if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy)
|
|||
prefix += "-"; |
|||
|
|||
$.each(this.params, function () { |
|||
paramValues[this] = $element.attr(prefix + this); |
|||
}); |
|||
|
|||
this.adapt({ |
|||
element: element, |
|||
form: form, |
|||
message: message, |
|||
params: paramValues, |
|||
rules: rules, |
|||
messages: messages |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
$.extend(rules, { "__dummy__": true }); |
|||
|
|||
if (!skipAttach) { |
|||
valInfo.attachValidation(); |
|||
} |
|||
}, |
|||
|
|||
parse: function (selector) { |
|||
/// <summary>
|
|||
/// 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-*
|
|||
/// attribute values.
|
|||
/// </summary>
|
|||
/// <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
|
|||
// element with data-val=true
|
|||
var $selector = $(selector), |
|||
$forms = $selector.parents() |
|||
.addBack() |
|||
.filter("form") |
|||
.add($selector.find("form")) |
|||
.has("[data-val=true]"); |
|||
|
|||
$selector.find("[data-val=true]").each(function () { |
|||
$jQval.unobtrusive.parseElement(this, true); |
|||
}); |
|||
|
|||
$forms.each(function () { |
|||
var info = validationInfo(this); |
|||
if (info) { |
|||
info.attachValidation(); |
|||
} |
|||
}); |
|||
} |
|||
}; |
|||
|
|||
adapters = $jQval.unobtrusive.adapters; |
|||
|
|||
adapters.add = function (adapterName, params, fn) { |
|||
/// <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
|
|||
/// 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
|
|||
/// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and
|
|||
/// mmmm is the parameter name).</param>
|
|||
/// <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>
|
|||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
|||
if (!fn) { // Called with no params, just a function
|
|||
fn = params; |
|||
params = []; |
|||
} |
|||
this.push({ name: adapterName, params: params, adapt: fn }); |
|||
return this; |
|||
}; |
|||
|
|||
adapters.addBool = function (adapterName, ruleName) { |
|||
/// <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>
|
|||
/// <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>
|
|||
/// <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>
|
|||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
|||
return this.add(adapterName, function (options) { |
|||
setValidationValues(options, ruleName || adapterName, true); |
|||
}); |
|||
}; |
|||
|
|||
adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) { |
|||
/// <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
|
|||
/// 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
|
|||
/// 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
|
|||
/// have a minimum value.</param>
|
|||
/// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only
|
|||
/// have a maximum value.</param>
|
|||
/// <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>
|
|||
/// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
|||
/// contains the minimum value. The default is "min".</param>
|
|||
/// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
|||
/// contains the maximum value. The default is "max".</param>
|
|||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
|||
return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) { |
|||
var min = options.params.min, |
|||
max = options.params.max; |
|||
|
|||
if (min && max) { |
|||
setValidationValues(options, minMaxRuleName, [min, max]); |
|||
} |
|||
else if (min) { |
|||
setValidationValues(options, minRuleName, min); |
|||
} |
|||
else if (max) { |
|||
setValidationValues(options, maxRuleName, max); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
adapters.addSingleVal = function (adapterName, attribute, ruleName) { |
|||
/// <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>
|
|||
/// <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>
|
|||
/// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value.
|
|||
/// 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
|
|||
/// of adapterName will be used instead.</param>
|
|||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
|||
return this.add(adapterName, [attribute || "val"], function (options) { |
|||
setValidationValues(options, ruleName || adapterName, options.params[attribute]); |
|||
}); |
|||
}; |
|||
|
|||
$jQval.addMethod("__dummy__", function (value, element, params) { |
|||
return true; |
|||
}); |
|||
|
|||
$jQval.addMethod("regex", function (value, element, params) { |
|||
var match; |
|||
if (this.optional(element)) { |
|||
return true; |
|||
} |
|||
|
|||
match = new RegExp(params).exec(value); |
|||
return (match && (match.index === 0) && (match[0].length === value.length)); |
|||
}); |
|||
|
|||
$jQval.addMethod("nonalphamin", function (value, element, nonalphamin) { |
|||
var match; |
|||
if (nonalphamin) { |
|||
match = value.match(/\W/g); |
|||
match = match && match.length >= nonalphamin; |
|||
} |
|||
return match; |
|||
}); |
|||
|
|||
if ($jQval.methods.extension) { |
|||
adapters.addSingleVal("accept", "mimtype"); |
|||
adapters.addSingleVal("extension", "extension"); |
|||
} else { |
|||
// 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
|
|||
// validating the extension, and ignore mime-type validations as they are not supported.
|
|||
adapters.addSingleVal("extension", "extension", "accept"); |
|||
} |
|||
|
|||
adapters.addSingleVal("regex", "pattern"); |
|||
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("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength"); |
|||
adapters.add("equalto", ["other"], function (options) { |
|||
var prefix = getModelPrefix(options.element.name), |
|||
other = options.params.other, |
|||
fullOtherName = appendModelPrefix(other, prefix), |
|||
element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0]; |
|||
|
|||
setValidationValues(options, "equalTo", element); |
|||
}); |
|||
adapters.add("required", function (options) { |
|||
// jQuery Validate equates "required" with "mandatory" for checkbox elements
|
|||
if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") { |
|||
setValidationValues(options, "required", true); |
|||
} |
|||
}); |
|||
adapters.add("remote", ["url", "type", "additionalfields"], function (options) { |
|||
var value = { |
|||
url: options.params.url, |
|||
type: options.params.type || "GET", |
|||
data: {} |
|||
}, |
|||
prefix = getModelPrefix(options.element.name); |
|||
|
|||
$.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) { |
|||
var paramName = appendModelPrefix(fieldName, prefix); |
|||
value.data[paramName] = function () { |
|||
var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']"); |
|||
// For checkboxes and radio buttons, only pick up values from checked fields.
|
|||
if (field.is(":checkbox")) { |
|||
return field.filter(":checked").val() || field.filter(":hidden").val() || ''; |
|||
} |
|||
else if (field.is(":radio")) { |
|||
return field.filter(":checked").val() || ''; |
|||
} |
|||
return field.val(); |
|||
}; |
|||
}); |
|||
|
|||
setValidationValues(options, "remote", value); |
|||
}); |
|||
adapters.add("password", ["min", "nonalphamin", "regex"], function (options) { |
|||
if (options.params.min) { |
|||
setValidationValues(options, "minlength", options.params.min); |
|||
} |
|||
if (options.params.nonalphamin) { |
|||
setValidationValues(options, "nonalphamin", options.params.nonalphamin); |
|||
} |
|||
if (options.params.regex) { |
|||
setValidationValues(options, "regex", options.params.regex); |
|||
} |
|||
}); |
|||
adapters.add("fileextensions", ["extensions"], function (options) { |
|||
setValidationValues(options, "extension", options.params.extensions); |
|||
}); |
|||
|
|||
$(function () { |
|||
$jQval.unobtrusive.parse(document); |
|||
}); |
|||
|
|||
return $jQval.unobtrusive; |
|||
})); |
|||
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,171 +1,171 @@ |
|||
/*! |
|||
* TOAST UI Editor : Code Syntax Highlight Plugin |
|||
* @version 3.0.0 | Thu Jun 17 2021 |
|||
* @author NHN FE Development Lab <dl_javascript@nhn.com> |
|||
* @license MIT |
|||
*/ |
|||
/* prevent to create draggable box in IE with prism */ |
|||
pre[class*="language-"] { |
|||
overflow: visible; |
|||
} |
|||
|
|||
.toastui-editor-ww-code-block-highlighting { |
|||
position: relative; |
|||
} |
|||
|
|||
.toastui-editor-ww-code-block-highlighting:after { |
|||
content: attr(data-language); |
|||
position: absolute; |
|||
display: inline-block; |
|||
top: 10px; |
|||
right: 10px; |
|||
height: 24px; |
|||
padding: 3px 30px 0 10px; |
|||
font-weight: bold; |
|||
font-size: 13px; |
|||
color: #333; |
|||
background-color: #e5e9ea; |
|||
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-position: right; |
|||
background-size: 30px 30px; |
|||
border-radius: 2px; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language { |
|||
position: fixed; |
|||
display: inline-block; |
|||
right: 35px; |
|||
z-index: 100; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-input { |
|||
position: relative; |
|||
display: inline-block; |
|||
padding: 0 22px 0 10px; |
|||
width: 112px; |
|||
height: 26px; |
|||
border: 1px solid #ccc; |
|||
border-radius: 2px; |
|||
background-color: #fff; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-input input { |
|||
margin: 0; |
|||
padding: 0; |
|||
height: 100%; |
|||
width: 100%; |
|||
background-color: #fff; |
|||
color: #222; |
|||
border: none; |
|||
outline: none; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-input input::placeholder { |
|||
color: #ccc; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-input input::-ms-clear { |
|||
display: none; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language .toastui-editor-code-block-language-input::after { |
|||
content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6IzIyMjIyMjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLWQtc2lkZSI+CgkJPHBvbHlnb24gaWQ9IlJlY3RhbmdsZS03IiBjbGFzcz0ic3QwIiBwb2ludHM9IjIsNSAxMCw1IDYsMTAgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K'); |
|||
position: absolute; |
|||
display: inline-block; |
|||
top: 7px; |
|||
right: 5px; |
|||
width: 12px; |
|||
height: 14px; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language.active .toastui-editor-code-block-language-input::after { |
|||
content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6IzIyMjIyMjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLXVwLXNpZGUiPgoJCTxwb2x5Z29uIGlkPSJSZWN0YW5nbGUtNyIgY2xhc3M9InN0MCIgcG9pbnRzPSIyLDkgMTAsOSA2LDQgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K'); |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list { |
|||
position: fixed; |
|||
margin-top: -1px; |
|||
width: 144px; |
|||
border: solid 1px #ccc; |
|||
border-bottom-left-radius: 2px; |
|||
border-bottom-right-radius: 2px; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list .buttons { |
|||
max-height: 169px; |
|||
overflow: auto; |
|||
padding: 0; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list button { |
|||
width: 100%; |
|||
background-color: #fff; |
|||
border: none; |
|||
outline: 0; |
|||
padding: 0 10px; |
|||
font-size: 13px; |
|||
line-height: 24px; |
|||
text-align: left; |
|||
color: #222; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list button.active { |
|||
color: #4b96e6; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list button:hover { |
|||
background-color: #f4f7f8; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-input input::placeholder { |
|||
color: #eee; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-ww-code-block-highlighting:after { |
|||
background-color: #232428; |
|||
border: 1px solid #393b42; |
|||
color: #eee; |
|||
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 { |
|||
border: 1px solid #494c56; |
|||
background-color: #121212; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language input { |
|||
background-color: #121212; |
|||
color: #eee; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-list { |
|||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08); |
|||
border: 1px solid #494c56; |
|||
border-radius: 2px; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-list button { |
|||
color: #eee; |
|||
background-color: #121212; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-list button.active { |
|||
color: #4b96e6; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-list button:hover { |
|||
background-color: #36383f; |
|||
} |
|||
|
|||
.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'); |
|||
} |
|||
|
|||
.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'); |
|||
} |
|||
/*! |
|||
* TOAST UI Editor : Code Syntax Highlight Plugin |
|||
* @version 3.0.0 | Thu Jun 17 2021 |
|||
* @author NHN FE Development Lab <dl_javascript@nhn.com> |
|||
* @license MIT |
|||
*/ |
|||
/* prevent to create draggable box in IE with prism */ |
|||
pre[class*="language-"] { |
|||
overflow: visible; |
|||
} |
|||
|
|||
.toastui-editor-ww-code-block-highlighting { |
|||
position: relative; |
|||
} |
|||
|
|||
.toastui-editor-ww-code-block-highlighting:after { |
|||
content: attr(data-language); |
|||
position: absolute; |
|||
display: inline-block; |
|||
top: 10px; |
|||
right: 10px; |
|||
height: 24px; |
|||
padding: 3px 30px 0 10px; |
|||
font-weight: bold; |
|||
font-size: 13px; |
|||
color: #333; |
|||
background-color: #e5e9ea; |
|||
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-position: right; |
|||
background-size: 30px 30px; |
|||
border-radius: 2px; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language { |
|||
position: fixed; |
|||
display: inline-block; |
|||
right: 35px; |
|||
z-index: 100; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-input { |
|||
position: relative; |
|||
display: inline-block; |
|||
padding: 0 22px 0 10px; |
|||
width: 112px; |
|||
height: 26px; |
|||
border: 1px solid #ccc; |
|||
border-radius: 2px; |
|||
background-color: #fff; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-input input { |
|||
margin: 0; |
|||
padding: 0; |
|||
height: 100%; |
|||
width: 100%; |
|||
background-color: #fff; |
|||
color: #222; |
|||
border: none; |
|||
outline: none; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-input input::placeholder { |
|||
color: #ccc; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-input input::-ms-clear { |
|||
display: none; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language .toastui-editor-code-block-language-input::after { |
|||
content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6IzIyMjIyMjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLWQtc2lkZSI+CgkJPHBvbHlnb24gaWQ9IlJlY3RhbmdsZS03IiBjbGFzcz0ic3QwIiBwb2ludHM9IjIsNSAxMCw1IDYsMTAgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K'); |
|||
position: absolute; |
|||
display: inline-block; |
|||
top: 7px; |
|||
right: 5px; |
|||
width: 12px; |
|||
height: 14px; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language.active .toastui-editor-code-block-language-input::after { |
|||
content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6IzIyMjIyMjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLXVwLXNpZGUiPgoJCTxwb2x5Z29uIGlkPSJSZWN0YW5nbGUtNyIgY2xhc3M9InN0MCIgcG9pbnRzPSIyLDkgMTAsOSA2LDQgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K'); |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list { |
|||
position: fixed; |
|||
margin-top: -1px; |
|||
width: 144px; |
|||
border: solid 1px #ccc; |
|||
border-bottom-left-radius: 2px; |
|||
border-bottom-right-radius: 2px; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list .buttons { |
|||
max-height: 169px; |
|||
overflow: auto; |
|||
padding: 0; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list button { |
|||
width: 100%; |
|||
background-color: #fff; |
|||
border: none; |
|||
outline: 0; |
|||
padding: 0 10px; |
|||
font-size: 13px; |
|||
line-height: 24px; |
|||
text-align: left; |
|||
color: #222; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list button.active { |
|||
color: #4b96e6; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list button:hover { |
|||
background-color: #f4f7f8; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-input input::placeholder { |
|||
color: #eee; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-ww-code-block-highlighting:after { |
|||
background-color: #232428; |
|||
border: 1px solid #393b42; |
|||
color: #eee; |
|||
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 { |
|||
border: 1px solid #494c56; |
|||
background-color: #121212; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language input { |
|||
background-color: #121212; |
|||
color: #eee; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-list { |
|||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08); |
|||
border: 1px solid #494c56; |
|||
border-radius: 2px; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-list button { |
|||
color: #eee; |
|||
background-color: #121212; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-list button.active { |
|||
color: #4b96e6; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-list button:hover { |
|||
background-color: #36383f; |
|||
} |
|||
|
|||
.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'); |
|||
} |
|||
|
|||
.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'); |
|||
} |
|||
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
@ -1,11 +1,9 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Volo.CmsKit.Admin.Comments; |
|||
|
|||
[Serializable] |
|||
public class SettingsDto |
|||
{ |
|||
public bool RequireApprovement { get; set; } |
|||
public bool CommentRequireApprovement { get; set; } |
|||
} |
|||
|
|||
@ -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");
|
|||
//}
|
|||
} |
|||
@ -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) { |
|||
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" |
|||
}); |
|||
|
|||
|
|||
|
|||
$('.singledatepicker').attr('autocomplete', 'off'); |
|||
|
|||
$('.singledatepicker').on('apply.daterangepicker', function (ev, picker) { |
|||
$(this).val(picker.startDate.format('l')); |
|||
}); |
|||
|
|||
|
|||
var filterForm = $('#CmsKitCommentsFilterForm'); |
|||
|
|||
var getFilter = function () { |
|||
var filterObj = filterForm.serializeFormToObject(); |
|||
|
|||
filterObj.creationStartDate = getFormattedDate($('#CreationStartDate')); |
|||
filterObj.creationEndDate = getFormattedDate($('#CreationEndDate')); |
|||
|
|||
return filterObj; |
|||
}; |
|||
|
|||
|
|||
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); |
|||
}); |
|||
} |
|||
$('.singledatepicker').attr('autocomplete', 'off'); |
|||
|
|||
$('.singledatepicker').on('apply.daterangepicker', function (ev, picker) { |
|||
$(this).val(picker.startDate.format('l')); |
|||
}); |
|||
|
|||
|
|||
var filterForm = $('#CmsKitCommentsFilterForm'); |
|||
|
|||
var getFilter = function () { |
|||
var filterObj = filterForm.serializeFormToObject(); |
|||
|
|||
filterObj.creationStartDate = getFormattedDate($('#CreationStartDate')); |
|||
filterObj.creationEndDate = getFormattedDate($('#CreationEndDate')); |
|||
|
|||
return filterObj; |
|||
}; |
|||
|
|||
|
|||
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'); |
|||
}, |
|||
{ |
|||
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); |
|||
}); |
|||
} |
|||
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); |
|||
}); |
|||
} |
|||
}, |
|||
{ |
|||
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
|
|||
} |
|||
}, |
|||
{ |
|||
title: l("Text"), |
|||
data: "text", |
|||
orderable: false, |
|||
|
|||
|
|||
render: function (data) { |
|||
|
|||
//var converter = new showdown.Converter();
|
|||
//var htmlContent = converter.makeHtml(data);
|
|||
var md = window.markdownit(); |
|||
var htmlContent = md.render(data); |
|||
return (htmlContent); |
|||
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)); |
|||
} |
|||
}, |
|||
{ |
|||
width: "15%", |
|||
title: l("CreationTime"), |
|||
data: "creationTime", |
|||
orderable: true, |
|||
dataFormat: "datetime" |
|||
return ""; |
|||
} |
|||
] |
|||
})); |
|||
}, |
|||
{ |
|||
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 () { |
|||
var inputSelector = $(this).attr('data-field'); |
|||
var value = $(this).attr('data-val'); |
|||
render: function (data) { |
|||
|
|||
//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) { |
|||
e.preventDefault(); |
|||
_dataTable.ajax.reloadEx(); |
|||
}); |
|||
filterForm.submit(function (e) { |
|||
e.preventDefault(); |
|||
_dataTable.ajax.reloadEx(); |
|||
}); |
|||
}); |
|||
|
|||
@ -0,0 +1,12 @@ |
|||
using System; |
|||
|
|||
namespace Volo.CmsKit.Comments; |
|||
|
|||
[Flags] |
|||
public enum CommentApproveState |
|||
{ |
|||
All = 0, |
|||
Approved = 1, |
|||
Disapproved = 2, |
|||
Waiting = 4 |
|||
} |
|||
@ -1,12 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Volo.CmsKit.Comments; |
|||
public enum CommentApproveStateType |
|||
{ |
|||
All, |
|||
Approved, |
|||
Disapproved, |
|||
Waiting |
|||
} |
|||
@ -1,9 +1,6 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
namespace Volo.CmsKit.Settings; |
|||
|
|||
namespace Volo.CmsKit.Settings; |
|||
public static class AppSettings |
|||
{ |
|||
public const string RequireApprovement = "Comments.RequireApprovement"; |
|||
public const string CommentRequireApprovement = "Comments.RequireApprovement"; |
|||
} |
|||
|
|||
Loading…
Reference in new issue