mirror of https://github.com/abpframework/abp.git
93 changed files with 34861 additions and 34713 deletions
@ -0,0 +1,34 @@ |
|||||
|
{ |
||||
|
"culture": "es", |
||||
|
"texts": { |
||||
|
"'{0}' and '{1}' do not match.": "'{0} \" y \"{1} \" no coinciden.", |
||||
|
"The {0} field is not a valid credit card number.": "{0} no es un número de tarjeta de crédito.", |
||||
|
"{0} is not valid.": "{0} no es válido.", |
||||
|
"The {0} field is not a valid e-mail address.": "{0} no es una dirección de correo electrónico válida.", |
||||
|
"The {0} field only accepts files with the following extensions: {1}": "{0} campo sólo acepta archivos con las siguientes extensiones: {1}", |
||||
|
"The field {0} must be a string or array type with a maximum length of '{1}'.": "El campo {0} debe ser una cadena o un array con una longitud máxima de '{1}'.", |
||||
|
"The field {0} must be a string or array type with a minimum length of '{1}'.": "El campo {0} debe ser una cadena o un array con una longitud mínima de '{1}'.", |
||||
|
"The {0} field is not a valid phone number.": "{0} no es un número de teléfono válido.", |
||||
|
"The field {0} must be between {1} and {2}.": "El campo {0} debe ser entre {1} y {2}.", |
||||
|
"The field {0} must match the regular expression '{1}'.": "El campo {0} debe coincidir con la expresión regular '{1}'.", |
||||
|
"The {0} field is required.": "La {0} campo es obligatorio.", |
||||
|
"The field {0} must be a string with a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud máxima de {1}.", |
||||
|
"The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud mínima de {2} y una longitud máxima de {1}.", |
||||
|
"The {0} field is not a valid fully-qualified http, https, or ftp URL.": "El campo {0} no es una dirección URL válida http, https o ftp.", |
||||
|
"The field {0} is invalid.": "El campo {0} no es válido.", |
||||
|
"ThisFieldIsNotAValidCreditCardNumber.": "Este campo no es un número de tarjeta de crédito.", |
||||
|
"ThisFieldIsNotValid.": "Este campo no es válido.", |
||||
|
"ThisFieldIsNotAValidEmailAddress.": "Este campo no es una dirección de correo electrónico válida.", |
||||
|
"ThisFieldOnlyAcceptsFilesWithTheFollowingExtensions:{0}": "Este campo sólo acepta archivos con las siguientes extensiones: {0}", |
||||
|
"ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthoOf{0}": "Este campo debe ser una cadena o un array con una longitud máxima de '{0}'.", |
||||
|
"ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}": "Este campo debe ser una cadena o un array con una longitud mínima de '{0}'.", |
||||
|
"ThisFieldIsNotAValidPhoneNumber.": "Este campo no es un número de teléfono válido.", |
||||
|
"ThisFieldMustBeBetween{0}And{1}": "Este campo debe tener un valor entre {0} y {1}.", |
||||
|
"ThisFieldMustMatchTheRegularExpression{0}": "Este campo debe coincidir con la expresión regular '{0}'.", |
||||
|
"ThisFieldIsRequired.": "Este campo es obligatorio.", |
||||
|
"ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "Este campo debe ser una cadena de caracteres con una longitud máxima de {0}.", |
||||
|
"ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "Este campo debe ser una cadena de caracteres con una longitud mínima de {1} y una longitud máxima de {0}.", |
||||
|
"ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "Este campo no es una dirección URL válida http, https o ftp.", |
||||
|
"ThisFieldIsInvalid.": "Este campo no es válido." |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
{ |
||||
|
"culture": "es", |
||||
|
"texts": { |
||||
|
"Menu:Administration": "Administración" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,58 @@ |
|||||
|
{ |
||||
|
"culture": "es", |
||||
|
"texts": { |
||||
|
"InternalServerErrorMessage": "Ocurrió un error interno en su pedido!", |
||||
|
"ValidationErrorMessage": "Su pedido no es válido!", |
||||
|
"ValidationNarrativeErrorMessageTitle": "Los siguientes errores se encontraton durante la validación.", |
||||
|
"DefaultErrorMessage": "Ocurrió un error!", |
||||
|
"DefaultErrorMessageDetail": "El servidor no envió el detalle del error.", |
||||
|
"DefaultErrorMessage401": "Usted no ha iniciado sessión!", |
||||
|
"DefaultErrorMessage401Detail": "Debe iniciar sessión para ejecutar esta operación.", |
||||
|
"DefaultErrorMessage403": "Usted no está autorizado!", |
||||
|
"DefaultErrorMessage403Detail": "Usted no puede hacer esta operación!", |
||||
|
"DefaultErrorMessage404": "No se encontró el recurso!", |
||||
|
"DefaultErrorMessage404Detail": "El recurso solicitado no se encontró en el servidor!", |
||||
|
"EntityNotFoundErrorMessage": "No hay una entidad {0} con el id = {1}!", |
||||
|
"Error": "Error", |
||||
|
"AreYouSure": "¿Está seguro?", |
||||
|
"Cancel": "Cancelar", |
||||
|
"Yes": "Si", |
||||
|
"No": "No", |
||||
|
"Close": "Cerrar", |
||||
|
"Save": "Guardar", |
||||
|
"SavingWithThreeDot": "Guardando...", |
||||
|
"Actions": "Acciones", |
||||
|
"Delete": "Eliminar", |
||||
|
"Edit": "Editar", |
||||
|
"Refresh": "Refrescar", |
||||
|
"ProcessingWithThreeDot": "Procesando...", |
||||
|
"LoadingWithThreeDot": "Cargando...", |
||||
|
"Welcome": "Bienvenido", |
||||
|
"Login": "Iniciar session", |
||||
|
"Register": "Registrarse", |
||||
|
"Logout": "Cerrar sessión", |
||||
|
"Submit": "Enviar", |
||||
|
"Back": "Atrás", |
||||
|
"PagerSearch": "Buscar", |
||||
|
"PagerNext": "Siguiente", |
||||
|
"PagerPrevious": "Anterior", |
||||
|
"PagerFirst": "Primero", |
||||
|
"PagerLast": "Último", |
||||
|
"PagerInfo": "Mostrando desde _START_ hasta _END_ total _TOTAL_", |
||||
|
"PagerInfoEmpty": "Mostrando desde 0 hasta 0 de 0 registros", |
||||
|
"PagerInfoFiltered": "(filtrado de un total de _MAX_ registros)", |
||||
|
"NoDataAvailableInDatatable": "No hay datos", |
||||
|
"PagerShowMenuEntries": "Mostrar _MENU_ registros", |
||||
|
"DatatableActionDropdownDefaultText": "Acciones", |
||||
|
"ChangePassword": "Cambiar contraseña", |
||||
|
"PersonalInfo": "My perfil", |
||||
|
"AreYouSureYouWantToCancelEditingWarningMessage": "Tiene cambios sin guardar.", |
||||
|
"UnhandledException": "Excepción no controlada!", |
||||
|
"401Message": "No autorizado", |
||||
|
"403Message": "Prohibido", |
||||
|
"404Message": "La página no existe", |
||||
|
"500Message": "Error interno del servidor", |
||||
|
"GoHomePage": "Ir a la página principal", |
||||
|
"GoBack": "Atras" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"culture": "es", |
||||
|
"texts": { |
||||
|
"USA": "Estados unidos de América", |
||||
|
"Brazil": "Brasil" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"culture": "es", |
||||
|
"texts": { |
||||
|
"ThisFieldIsRequired": "El campo no puede estar vacío", |
||||
|
"MaxLenghtErrorMessage": "El campo puede tener un máximo de '{0}' caracteres" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
{ |
||||
|
"culture": "es", |
||||
|
"texts": { |
||||
|
"Hello <b>{0}</b>.": "Hola <b>{0}</b>.", |
||||
|
"Car": "Auto", |
||||
|
"CarPlural": "Autos", |
||||
|
"MaxLenghtErrorMessage": "El campo puede tener un máximo de '{0}' caracteres", |
||||
|
"Universe": "Universo", |
||||
|
"FortyTwo": "Curenta y dos" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
{ |
||||
|
"culture": "es", |
||||
|
"texts": { |
||||
|
"SeeYou": "Nos vemos" |
||||
|
} |
||||
|
} |
||||
@ -1,5 +1,5 @@ |
|||||
{ |
{ |
||||
"version": "1.1.0", |
"version": "1.1.1", |
||||
"packages": ["dist/*"], |
"packages": ["dist/*"], |
||||
"npmClient": "yarn" |
"npmClient": "yarn" |
||||
} |
} |
||||
|
|||||
@ -1,5 +1,5 @@ |
|||||
{ |
{ |
||||
"version": "1.1.0", |
"version": "1.1.1", |
||||
"packages": ["packages/*"], |
"packages": ["packages/*"], |
||||
"npmClient": "yarn" |
"npmClient": "yarn" |
||||
} |
} |
||||
|
|||||
@ -1,28 +0,0 @@ |
|||||
"use strict" |
|
||||
|
|
||||
const child_process = require("child_process") |
|
||||
const { env } = process |
|
||||
const { parent } = module |
|
||||
|
|
||||
const REQUIRE_ESM = "--require esm" |
|
||||
const REQUIRE_DOT_YARN = "--require ./.yarn.js" |
|
||||
|
|
||||
let { NODE_OPTIONS } = env |
|
||||
|
|
||||
if (typeof NODE_OPTIONS === "string") { |
|
||||
NODE_OPTIONS += " " |
|
||||
} else { |
|
||||
NODE_OPTIONS = "" |
|
||||
} |
|
||||
|
|
||||
if (parent != null && |
|
||||
parent.id === "internal/preload") { |
|
||||
env.NODE_OPTIONS = NODE_OPTIONS.replace(REQUIRE_DOT_YARN, REQUIRE_ESM) |
|
||||
} else { |
|
||||
child_process.spawn("yarn", process.argv.slice(2), { |
|
||||
env: Object.assign({}, env, { |
|
||||
NODE_OPTIONS: REQUIRE_DOT_YARN + " " + NODE_OPTIONS |
|
||||
}), |
|
||||
stdio: "inherit" |
|
||||
}) |
|
||||
} |
|
||||
@ -1 +0,0 @@ |
|||||
yarn-path "./.yarn.js" |
|
||||
@ -1,10 +1,32 @@ |
|||||
& cd ng-packs\scripts |
param( |
||||
& npm install |
[string]$Version |
||||
& yarn publish-packages patch |
) |
||||
& cd ../../ |
|
||||
& yarn |
if(-Not $Version) { |
||||
& yarn lerna publish patch --no-push --yes --no-git-reset --no-commit-hooks --no-git-tag-version --force-publish |
echo 'Please pass a semantic version like this: ./publish.ps1 -Version patch' |
||||
& yarn update:templates |
exit |
||||
& yarn global add gulp |
} |
||||
& yarn gulp:app |
|
||||
& yarn gulp:module |
$rootFolder = (Get-Item -Path "./" -Verbose).FullName |
||||
|
|
||||
|
$commands = ( |
||||
|
"cd ng-packs\scripts", |
||||
|
"npm install", |
||||
|
"npm run publish-packages -- $Version", |
||||
|
"cd ../../", |
||||
|
"yarn", |
||||
|
"yarn lerna publish $Version --no-push --yes --no-git-reset --no-commit-hooks --no-git-tag-version --force-publish", |
||||
|
"yarn update:templates", |
||||
|
"yarn gulp:app", |
||||
|
"yarn gulp:module" |
||||
|
) |
||||
|
|
||||
|
foreach ($command in $commands) { |
||||
|
Write-Host $command |
||||
|
Invoke-Expression $command |
||||
|
if($LASTEXITCODE -ne '0' -And $command -notlike '*cd *'){ |
||||
|
Write-Host ("Process failed! " + $command) |
||||
|
Set-Location $rootFolder |
||||
|
exit $LASTEXITCODE |
||||
|
} |
||||
|
} |
||||
@ -1,56 +1,56 @@ |
|||||
@keyframes spin { |
@keyframes spin { |
||||
0% { |
0% { |
||||
transform: translateZ(0) rotate(0deg); |
transform: translateZ(0) rotate(0deg); |
||||
} |
} |
||||
|
|
||||
100% { |
100% { |
||||
transform: translateZ(0) rotate(360deg); |
transform: translateZ(0) rotate(360deg); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.abp-block-area { |
.abp-block-area { |
||||
position: fixed; |
position: fixed; |
||||
top: 0; |
top: 0; |
||||
left: 0; |
left: 0; |
||||
width: 100%; |
width: 100%; |
||||
height: 100%; |
height: 100%; |
||||
z-index: 102; |
z-index: 102; |
||||
background-color: #fff; |
background-color: #fff; |
||||
opacity: .8; |
opacity: .8; |
||||
transition: opacity .25s; |
transition: opacity .25s; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-disappearing { |
.abp-block-area.abp-block-area-disappearing { |
||||
opacity: 0; |
opacity: 0; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:after { |
.abp-block-area.abp-block-area-busy:after { |
||||
content: attr(data-text); |
content: attr(data-text); |
||||
display: block; |
display: block; |
||||
max-width: 125px; |
max-width: 125px; |
||||
position: absolute; |
position: absolute; |
||||
top: 50%; |
top: 50%; |
||||
left: 50%; |
left: 50%; |
||||
transform: translate(-50%, -50%); |
transform: translate(-50%, -50%); |
||||
font-size: 20px; |
font-size: 20px; |
||||
font-family: sans-serif; |
font-family: sans-serif; |
||||
color: #343a40; |
color: #343a40; |
||||
text-align: center; |
text-align: center; |
||||
text-transform: uppercase; |
text-transform: uppercase; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:before { |
.abp-block-area.abp-block-area-busy:before { |
||||
content: ""; |
content: ""; |
||||
display: block; |
display: block; |
||||
width: 150px; |
width: 150px; |
||||
height: 150px; |
height: 150px; |
||||
border-radius: 50%; |
border-radius: 50%; |
||||
border-width: 2px; |
border-width: 2px; |
||||
border-style: solid; |
border-style: solid; |
||||
border-color: transparent #228ae6 #228ae6 #228ae6; |
border-color: transparent #228ae6 #228ae6 #228ae6; |
||||
position: absolute; |
position: absolute; |
||||
top: calc(50% - 75px); |
top: calc(50% - 75px); |
||||
left: calc(50% - 75px); |
left: calc(50% - 75px); |
||||
will-change: transform; |
will-change: transform; |
||||
animation: spin .75s infinite ease-in-out; |
animation: spin .75s infinite ease-in-out; |
||||
} |
} |
||||
|
|||||
File diff suppressed because it is too large
@ -1,389 +1,389 @@ |
|||||
var abp = abp || {}; |
var abp = abp || {}; |
||||
(function($) { |
(function($) { |
||||
|
|
||||
if (!$) { |
if (!$) { |
||||
throw "abp/jquery library requires the jquery library included to the page!"; |
throw "abp/jquery library requires the jquery library included to the page!"; |
||||
} |
} |
||||
|
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
|
||||
abp.message._showMessage = function (message, title) { |
abp.message._showMessage = function (message, title) { |
||||
alert((title || '') + ' ' + message); |
alert((title || '') + ' ' + message); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(); |
$dfd.resolve(); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) { |
abp.message.confirm = function (message, titleOrCallback, callback) { |
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
||||
callback = titleOrCallback; |
callback = titleOrCallback; |
||||
} |
} |
||||
|
|
||||
var result = confirm(message); |
var result = confirm(message); |
||||
callback && callback(result); |
callback && callback(result); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(result); |
$dfd.resolve(result); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.utils.isFunction = function (obj) { |
abp.utils.isFunction = function (obj) { |
||||
return $.isFunction(obj); |
return $.isFunction(obj); |
||||
}; |
}; |
||||
|
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
|
||||
$.fn.findWithSelf = function (selector) { |
$.fn.findWithSelf = function (selector) { |
||||
return this.filter(selector).add(this.find(selector)); |
return this.filter(selector).add(this.find(selector)); |
||||
}; |
}; |
||||
|
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.dom = abp.dom || {}; |
abp.dom = abp.dom || {}; |
||||
|
|
||||
abp.dom.onNodeAdded = function (callback) { |
abp.dom.onNodeAdded = function (callback) { |
||||
abp.event.on('abp.dom.nodeAdded', callback); |
abp.event.on('abp.dom.nodeAdded', callback); |
||||
}; |
}; |
||||
|
|
||||
abp.dom.onNodeRemoved = function (callback) { |
abp.dom.onNodeRemoved = function (callback) { |
||||
abp.event.on('abp.dom.nodeRemoved', callback); |
abp.event.on('abp.dom.nodeRemoved', callback); |
||||
}; |
}; |
||||
|
|
||||
var mutationObserverCallback = function (mutationsList) { |
var mutationObserverCallback = function (mutationsList) { |
||||
for (var i = 0; i < mutationsList.length; i++) { |
for (var i = 0; i < mutationsList.length; i++) { |
||||
var mutation = mutationsList[i]; |
var mutation = mutationsList[i]; |
||||
if (mutation.type === 'childList') { |
if (mutation.type === 'childList') { |
||||
if (mutation.addedNodes && mutation.removedNodes.length) { |
if (mutation.addedNodes && mutation.removedNodes.length) { |
||||
for (var k = 0; k < mutation.removedNodes.length; k++) { |
for (var k = 0; k < mutation.removedNodes.length; k++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeRemoved', |
'abp.dom.nodeRemoved', |
||||
{ |
{ |
||||
$el: $(mutation.removedNodes[k]) |
$el: $(mutation.removedNodes[k]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) { |
if (mutation.addedNodes && mutation.addedNodes.length) { |
||||
for (var j = 0; j < mutation.addedNodes.length; j++) { |
for (var j = 0; j < mutation.addedNodes.length; j++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeAdded', |
'abp.dom.nodeAdded', |
||||
{ |
{ |
||||
$el: $(mutation.addedNodes[j]) |
$el: $(mutation.addedNodes[j]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
new MutationObserver(mutationObserverCallback).observe( |
new MutationObserver(mutationObserverCallback).observe( |
||||
$('body')[0], |
$('body')[0], |
||||
{ |
{ |
||||
subtree: true, |
subtree: true, |
||||
childList: true |
childList: true |
||||
} |
} |
||||
); |
); |
||||
|
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.ajax = function (userOptions) { |
abp.ajax = function (userOptions) { |
||||
userOptions = userOptions || {}; |
userOptions = userOptions || {}; |
||||
|
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
||||
|
|
||||
options.success = undefined; |
options.success = undefined; |
||||
options.error = undefined; |
options.error = undefined; |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$.ajax(options) |
$.ajax(options) |
||||
.done(function (data, textStatus, jqXHR) { |
.done(function (data, textStatus, jqXHR) { |
||||
$dfd.resolve(data); |
$dfd.resolve(data); |
||||
userOptions.success && userOptions.success(data); |
userOptions.success && userOptions.success(data); |
||||
}).fail(function (jqXHR) { |
}).fail(function (jqXHR) { |
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} else { |
} else { |
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} |
} |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
$.extend(abp.ajax, { |
$.extend(abp.ajax, { |
||||
defaultOpts: { |
defaultOpts: { |
||||
dataType: 'json', |
dataType: 'json', |
||||
type: 'POST', |
type: 'POST', |
||||
contentType: 'application/json', |
contentType: 'application/json', |
||||
headers: { |
headers: { |
||||
'X-Requested-With': 'XMLHttpRequest' |
'X-Requested-With': 'XMLHttpRequest' |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
defaultError: { |
defaultError: { |
||||
message: 'An error has occurred!', |
message: 'An error has occurred!', |
||||
details: 'Error detail not sent by server.' |
details: 'Error detail not sent by server.' |
||||
}, |
}, |
||||
|
|
||||
defaultError401: { |
defaultError401: { |
||||
message: 'You are not authenticated!', |
message: 'You are not authenticated!', |
||||
details: 'You should be authenticated (sign in) in order to perform this operation.' |
details: 'You should be authenticated (sign in) in order to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError403: { |
defaultError403: { |
||||
message: 'You are not authorized!', |
message: 'You are not authorized!', |
||||
details: 'You are not allowed to perform this operation.' |
details: 'You are not allowed to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError404: { |
defaultError404: { |
||||
message: 'Resource not found!', |
message: 'Resource not found!', |
||||
details: 'The resource requested could not found on the server.' |
details: 'The resource requested could not found on the server.' |
||||
}, |
}, |
||||
|
|
||||
logError: function (error) { |
logError: function (error) { |
||||
abp.log.error(error); |
abp.log.error(error); |
||||
}, |
}, |
||||
|
|
||||
showError: function (error) { |
showError: function (error) { |
||||
if (error.details) { |
if (error.details) { |
||||
return abp.message.error(error.details, error.message); |
return abp.message.error(error.details, error.message); |
||||
} else { |
} else { |
||||
return abp.message.error(error.message || abp.ajax.defaultError.message); |
return abp.message.error(error.message || abp.ajax.defaultError.message); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleTargetUrl: function (targetUrl) { |
handleTargetUrl: function (targetUrl) { |
||||
if (!targetUrl) { |
if (!targetUrl) { |
||||
location.href = abp.appPath; |
location.href = abp.appPath; |
||||
} else { |
} else { |
||||
location.href = targetUrl; |
location.href = targetUrl; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleErrorStatusCode: function (status) { |
handleErrorStatusCode: function (status) { |
||||
switch (status) { |
switch (status) { |
||||
case 401: |
case 401: |
||||
abp.ajax.handleUnAuthorizedRequest( |
abp.ajax.handleUnAuthorizedRequest( |
||||
abp.ajax.showError(abp.ajax.defaultError401), |
abp.ajax.showError(abp.ajax.defaultError401), |
||||
abp.appPath |
abp.appPath |
||||
); |
); |
||||
break; |
break; |
||||
case 403: |
case 403: |
||||
abp.ajax.showError(abp.ajax.defaultError403); |
abp.ajax.showError(abp.ajax.defaultError403); |
||||
break; |
break; |
||||
case 404: |
case 404: |
||||
abp.ajax.showError(abp.ajax.defaultError404); |
abp.ajax.showError(abp.ajax.defaultError404); |
||||
break; |
break; |
||||
default: |
default: |
||||
abp.ajax.showError(abp.ajax.defaultError); |
abp.ajax.showError(abp.ajax.defaultError); |
||||
break; |
break; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleErrorStatusCode(jqXHR.status); |
abp.ajax.handleErrorStatusCode(jqXHR.status); |
||||
} |
} |
||||
|
|
||||
$dfd.reject.apply(this, arguments); |
$dfd.reject.apply(this, arguments); |
||||
userOptions.error && userOptions.error.apply(this, arguments); |
userOptions.error && userOptions.error.apply(this, arguments); |
||||
}, |
}, |
||||
|
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
var messagePromise = null; |
var messagePromise = null; |
||||
|
|
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
||||
} |
} |
||||
|
|
||||
abp.ajax.logError(jqXHR.responseJSON.error); |
abp.ajax.logError(jqXHR.responseJSON.error); |
||||
|
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
||||
|
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
||||
if (messagePromise) { |
if (messagePromise) { |
||||
messagePromise.done(function () { |
messagePromise.done(function () { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
}); |
}); |
||||
} else { |
} else { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
blockUI: function (options) { |
blockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //block whole page
|
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy(); |
abp.ui.setBusy(); |
||||
} else { //block an element
|
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI); |
abp.ui.setBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
unblockUI: function (options) { |
unblockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //unblock whole page
|
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy(); |
abp.ui.clearBusy(); |
||||
} else { //unblock an element
|
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI); |
abp.ui.clearBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
ajaxSendHandler: function (event, request, settings) { |
ajaxSendHandler: function (event, request, settings) { |
||||
var token = abp.security.antiForgery.getToken(); |
var token = abp.security.antiForgery.getToken(); |
||||
if (!token) { |
if (!token) { |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
||||
} |
} |
||||
} |
} |
||||
}); |
}); |
||||
|
|
||||
$(document).ajaxSend(function (event, request, settings) { |
$(document).ajaxSend(function (event, request, settings) { |
||||
return abp.ajax.ajaxSendHandler(event, request, settings); |
return abp.ajax.ajaxSendHandler(event, request, settings); |
||||
}); |
}); |
||||
|
|
||||
abp.event.on('abp.configurationInitialized', function () { |
abp.event.on('abp.configurationInitialized', function () { |
||||
var l = abp.localization.getResource('AbpUi'); |
var l = abp.localization.getResource('AbpUi'); |
||||
|
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
||||
}); |
}); |
||||
|
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
|
||||
/* UrlStates enum */ |
/* UrlStates enum */ |
||||
var UrlStates = { |
var UrlStates = { |
||||
LOADING: 'LOADING', |
LOADING: 'LOADING', |
||||
LOADED: 'LOADED', |
LOADED: 'LOADED', |
||||
FAILED: 'FAILED' |
FAILED: 'FAILED' |
||||
}; |
}; |
||||
|
|
||||
/* UrlInfo class */ |
/* UrlInfo class */ |
||||
function UrlInfo(url) { |
function UrlInfo(url) { |
||||
this.url = url; |
this.url = url; |
||||
this.state = UrlStates.LOADING; |
this.state = UrlStates.LOADING; |
||||
this.loadCallbacks = []; |
this.loadCallbacks = []; |
||||
this.failCallbacks = []; |
this.failCallbacks = []; |
||||
} |
} |
||||
|
|
||||
UrlInfo.prototype.succeed = function () { |
UrlInfo.prototype.succeed = function () { |
||||
this.state = UrlStates.LOADED; |
this.state = UrlStates.LOADED; |
||||
for (var i = 0; i < this.loadCallbacks.length; i++) { |
for (var i = 0; i < this.loadCallbacks.length; i++) { |
||||
this.loadCallbacks[i](); |
this.loadCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.failed = function () { |
UrlInfo.prototype.failed = function () { |
||||
this.state = UrlStates.FAILED; |
this.state = UrlStates.FAILED; |
||||
for (var i = 0; i < this.failCallbacks.length; i++) { |
for (var i = 0; i < this.failCallbacks.length; i++) { |
||||
this.failCallbacks[i](); |
this.failCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
||||
switch (this.state) { |
switch (this.state) { |
||||
case UrlStates.LOADED: |
case UrlStates.LOADED: |
||||
loadCallback && loadCallback(); |
loadCallback && loadCallback(); |
||||
break; |
break; |
||||
case UrlStates.FAILED: |
case UrlStates.FAILED: |
||||
failCallback && failCallback(); |
failCallback && failCallback(); |
||||
break; |
break; |
||||
case UrlStates.LOADING: |
case UrlStates.LOADING: |
||||
this.addCallbacks(loadCallback, failCallback); |
this.addCallbacks(loadCallback, failCallback); |
||||
break; |
break; |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
||||
loadCallback && this.loadCallbacks.push(loadCallback); |
loadCallback && this.loadCallbacks.push(loadCallback); |
||||
failCallback && this.failCallbacks.push(failCallback); |
failCallback && this.failCallbacks.push(failCallback); |
||||
}; |
}; |
||||
|
|
||||
/* ResourceLoader API */ |
/* ResourceLoader API */ |
||||
|
|
||||
abp.ResourceLoader = (function () { |
abp.ResourceLoader = (function () { |
||||
|
|
||||
var _urlInfos = {}; |
var _urlInfos = {}; |
||||
|
|
||||
function getCacheKey(url) { |
function getCacheKey(url) { |
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
function appendTimeToUrl(url) { |
function appendTimeToUrl(url) { |
||||
|
|
||||
if (url.indexOf('?') < 0) { |
if (url.indexOf('?') < 0) { |
||||
url += '?'; |
url += '?'; |
||||
} else { |
} else { |
||||
url += '&'; |
url += '&'; |
||||
} |
} |
||||
|
|
||||
url += '_=' + new Date().getTime(); |
url += '_=' + new Date().getTime(); |
||||
|
|
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
||||
|
|
||||
var cacheKey = getCacheKey(url); |
var cacheKey = getCacheKey(url); |
||||
|
|
||||
var urlInfo = _urlInfos[cacheKey]; |
var urlInfo = _urlInfos[cacheKey]; |
||||
|
|
||||
if (urlInfo) { |
if (urlInfo) { |
||||
urlInfo.handleCallbacks(loadCallback, failCallback); |
urlInfo.handleCallbacks(loadCallback, failCallback); |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
||||
urlInfo.addCallbacks(loadCallback, failCallback); |
urlInfo.addCallbacks(loadCallback, failCallback); |
||||
|
|
||||
serverLoader(urlInfo); |
serverLoader(urlInfo); |
||||
}; |
}; |
||||
|
|
||||
var _loadScript = function (url, loadCallback, failCallback) { |
var _loadScript = function (url, loadCallback, failCallback) { |
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
||||
$.getScript(url) |
$.getScript(url) |
||||
.done(function () { |
.done(function () { |
||||
urlInfo.succeed(); |
urlInfo.succeed(); |
||||
}) |
}) |
||||
.fail(function () { |
.fail(function () { |
||||
urlInfo.failed(); |
urlInfo.failed(); |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
var _loadStyle = function (url) { |
var _loadStyle = function (url) { |
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
||||
|
|
||||
$('<link/>', { |
$('<link/>', { |
||||
rel: 'stylesheet', |
rel: 'stylesheet', |
||||
type: 'text/css', |
type: 'text/css', |
||||
href: appendTimeToUrl(url) |
href: appendTimeToUrl(url) |
||||
}).appendTo('head'); |
}).appendTo('head'); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
return { |
return { |
||||
loadScript: _loadScript, |
loadScript: _loadScript, |
||||
loadStyle: _loadStyle |
loadStyle: _loadStyle |
||||
} |
} |
||||
})(); |
})(); |
||||
|
|
||||
})(jQuery); |
})(jQuery); |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,37 +1,37 @@ |
|||||
{ |
{ |
||||
"name": "malihu-custom-scrollbar-plugin", |
"name": "malihu-custom-scrollbar-plugin", |
||||
"version": "3.1.5", |
"version": "3.1.5", |
||||
"author": "malihu (http://manos.malihu.gr)", |
"author": "malihu (http://manos.malihu.gr)", |
||||
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
||||
"license": "MIT", |
"license": "MIT", |
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
||||
"main": "./jquery.mCustomScrollbar.js", |
"main": "./jquery.mCustomScrollbar.js", |
||||
"repository": { |
"repository": { |
||||
"type": "git", |
"type": "git", |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
||||
}, |
}, |
||||
"bugs": { |
"bugs": { |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
||||
}, |
}, |
||||
"keywords": [ |
"keywords": [ |
||||
"jquery-plugin", |
"jquery-plugin", |
||||
"custom-scrollbar", |
"custom-scrollbar", |
||||
"scrollbar" |
"scrollbar" |
||||
], |
], |
||||
"files": [ |
"files": [ |
||||
"jquery.mCustomScrollbar.js", |
"jquery.mCustomScrollbar.js", |
||||
"jquery.mCustomScrollbar.concat.min.js", |
"jquery.mCustomScrollbar.concat.min.js", |
||||
"jquery.mCustomScrollbar.css", |
"jquery.mCustomScrollbar.css", |
||||
"mCSB_buttons.png", |
"mCSB_buttons.png", |
||||
"readme.md" |
"readme.md" |
||||
], |
], |
||||
"jam": { |
"jam": { |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery": ">=1.6", |
"jquery": ">=1.6", |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
}, |
}, |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
} |
} |
||||
@ -1,82 +1,82 @@ |
|||||
malihu custom scrollbar plugin |
malihu custom scrollbar plugin |
||||
================================ |
================================ |
||||
|
|
||||
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
||||
|
|
||||
* Vertical and/or horizontal scrollbar(s) |
* Vertical and/or horizontal scrollbar(s) |
||||
* Adjustable scrolling momentum |
* Adjustable scrolling momentum |
||||
* Mouse-wheel, keyboard and touch support |
* Mouse-wheel, keyboard and touch support |
||||
* Ready-to-use themes and customization via CSS |
* Ready-to-use themes and customization via CSS |
||||
* RTL direction support |
* RTL direction support |
||||
* Option parameters for full control of scrollbar functionality |
* Option parameters for full control of scrollbar functionality |
||||
* Methods for triggering actions like scroll-to, update, destroy etc. |
* Methods for triggering actions like scroll-to, update, destroy etc. |
||||
* User-defined callbacks |
* User-defined callbacks |
||||
* Selectable/searchable content |
* Selectable/searchable content |
||||
|
|
||||
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
||||
|
|
||||
#### Installation |
#### Installation |
||||
|
|
||||
npm: `npm install malihu-custom-scrollbar-plugin` |
npm: `npm install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin` |
Bower: `bower install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
||||
|
|
||||
#### Usage |
#### Usage |
||||
|
|
||||
Manual: `$(selector).mCustomScrollbar();` |
Manual: `$(selector).mCustomScrollbar();` |
||||
|
|
||||
[Browserify](http://browserify.org/): |
[Browserify](http://browserify.org/): |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
[webpack](https://webpack.github.io/): |
[webpack](https://webpack.github.io/): |
||||
|
|
||||
npm install imports-loader |
npm install imports-loader |
||||
npm install jquery-mousewheel |
npm install jquery-mousewheel |
||||
npm install malihu-custom-scrollbar-plugin |
npm install malihu-custom-scrollbar-plugin |
||||
|
|
||||
module.exports = { |
module.exports = { |
||||
module: { |
module: { |
||||
loaders: [ |
loaders: [ |
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
||||
] |
] |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require("jquery-mousewheel")($); |
require("jquery-mousewheel")($); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
|
|
||||
Requirements |
Requirements |
||||
------------------------- |
------------------------- |
||||
|
|
||||
jQuery version **1.6.0** or higher |
jQuery version **1.6.0** or higher |
||||
|
|
||||
Browser compatibility |
Browser compatibility |
||||
------------------------- |
------------------------- |
||||
|
|
||||
* Internet Explorer 8+ |
* Internet Explorer 8+ |
||||
* Firefox |
* Firefox |
||||
* Chrome |
* Chrome |
||||
* Opera |
* Opera |
||||
* Safari |
* Safari |
||||
* iOS |
* iOS |
||||
* Android |
* Android |
||||
* Windows Phone |
* Windows Phone |
||||
|
|
||||
License |
License |
||||
------------------------- |
------------------------- |
||||
|
|
||||
MIT License (MIT) |
MIT License (MIT) |
||||
|
|
||||
http://opensource.org/licenses/MIT |
http://opensource.org/licenses/MIT |
||||
|
|
||||
Donate |
Donate |
||||
------------------------- |
------------------------- |
||||
|
|
||||
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
||||
@ -1,8 +0,0 @@ |
|||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
|
||||
# yarn lockfile v1 |
|
||||
|
|
||||
|
|
||||
jquery-mousewheel@>=3.0.6: |
|
||||
version "3.1.13" |
|
||||
resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.1.13.tgz#06f0335f16e353a695e7206bf50503cb523a6ee5" |
|
||||
integrity sha1-BvAzXxbjU6aV5yBr9QUDy1I6buU= |
|
||||
@ -1,56 +1,56 @@ |
|||||
@keyframes spin { |
@keyframes spin { |
||||
0% { |
0% { |
||||
transform: translateZ(0) rotate(0deg); |
transform: translateZ(0) rotate(0deg); |
||||
} |
} |
||||
|
|
||||
100% { |
100% { |
||||
transform: translateZ(0) rotate(360deg); |
transform: translateZ(0) rotate(360deg); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.abp-block-area { |
.abp-block-area { |
||||
position: fixed; |
position: fixed; |
||||
top: 0; |
top: 0; |
||||
left: 0; |
left: 0; |
||||
width: 100%; |
width: 100%; |
||||
height: 100%; |
height: 100%; |
||||
z-index: 102; |
z-index: 102; |
||||
background-color: #fff; |
background-color: #fff; |
||||
opacity: .8; |
opacity: .8; |
||||
transition: opacity .25s; |
transition: opacity .25s; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-disappearing { |
.abp-block-area.abp-block-area-disappearing { |
||||
opacity: 0; |
opacity: 0; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:after { |
.abp-block-area.abp-block-area-busy:after { |
||||
content: attr(data-text); |
content: attr(data-text); |
||||
display: block; |
display: block; |
||||
max-width: 125px; |
max-width: 125px; |
||||
position: absolute; |
position: absolute; |
||||
top: 50%; |
top: 50%; |
||||
left: 50%; |
left: 50%; |
||||
transform: translate(-50%, -50%); |
transform: translate(-50%, -50%); |
||||
font-size: 20px; |
font-size: 20px; |
||||
font-family: sans-serif; |
font-family: sans-serif; |
||||
color: #343a40; |
color: #343a40; |
||||
text-align: center; |
text-align: center; |
||||
text-transform: uppercase; |
text-transform: uppercase; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:before { |
.abp-block-area.abp-block-area-busy:before { |
||||
content: ""; |
content: ""; |
||||
display: block; |
display: block; |
||||
width: 150px; |
width: 150px; |
||||
height: 150px; |
height: 150px; |
||||
border-radius: 50%; |
border-radius: 50%; |
||||
border-width: 2px; |
border-width: 2px; |
||||
border-style: solid; |
border-style: solid; |
||||
border-color: transparent #228ae6 #228ae6 #228ae6; |
border-color: transparent #228ae6 #228ae6 #228ae6; |
||||
position: absolute; |
position: absolute; |
||||
top: calc(50% - 75px); |
top: calc(50% - 75px); |
||||
left: calc(50% - 75px); |
left: calc(50% - 75px); |
||||
will-change: transform; |
will-change: transform; |
||||
animation: spin .75s infinite ease-in-out; |
animation: spin .75s infinite ease-in-out; |
||||
} |
} |
||||
|
|||||
File diff suppressed because it is too large
@ -1,389 +1,389 @@ |
|||||
var abp = abp || {}; |
var abp = abp || {}; |
||||
(function($) { |
(function($) { |
||||
|
|
||||
if (!$) { |
if (!$) { |
||||
throw "abp/jquery library requires the jquery library included to the page!"; |
throw "abp/jquery library requires the jquery library included to the page!"; |
||||
} |
} |
||||
|
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
|
||||
abp.message._showMessage = function (message, title) { |
abp.message._showMessage = function (message, title) { |
||||
alert((title || '') + ' ' + message); |
alert((title || '') + ' ' + message); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(); |
$dfd.resolve(); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) { |
abp.message.confirm = function (message, titleOrCallback, callback) { |
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
||||
callback = titleOrCallback; |
callback = titleOrCallback; |
||||
} |
} |
||||
|
|
||||
var result = confirm(message); |
var result = confirm(message); |
||||
callback && callback(result); |
callback && callback(result); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(result); |
$dfd.resolve(result); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.utils.isFunction = function (obj) { |
abp.utils.isFunction = function (obj) { |
||||
return $.isFunction(obj); |
return $.isFunction(obj); |
||||
}; |
}; |
||||
|
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
|
||||
$.fn.findWithSelf = function (selector) { |
$.fn.findWithSelf = function (selector) { |
||||
return this.filter(selector).add(this.find(selector)); |
return this.filter(selector).add(this.find(selector)); |
||||
}; |
}; |
||||
|
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.dom = abp.dom || {}; |
abp.dom = abp.dom || {}; |
||||
|
|
||||
abp.dom.onNodeAdded = function (callback) { |
abp.dom.onNodeAdded = function (callback) { |
||||
abp.event.on('abp.dom.nodeAdded', callback); |
abp.event.on('abp.dom.nodeAdded', callback); |
||||
}; |
}; |
||||
|
|
||||
abp.dom.onNodeRemoved = function (callback) { |
abp.dom.onNodeRemoved = function (callback) { |
||||
abp.event.on('abp.dom.nodeRemoved', callback); |
abp.event.on('abp.dom.nodeRemoved', callback); |
||||
}; |
}; |
||||
|
|
||||
var mutationObserverCallback = function (mutationsList) { |
var mutationObserverCallback = function (mutationsList) { |
||||
for (var i = 0; i < mutationsList.length; i++) { |
for (var i = 0; i < mutationsList.length; i++) { |
||||
var mutation = mutationsList[i]; |
var mutation = mutationsList[i]; |
||||
if (mutation.type === 'childList') { |
if (mutation.type === 'childList') { |
||||
if (mutation.addedNodes && mutation.removedNodes.length) { |
if (mutation.addedNodes && mutation.removedNodes.length) { |
||||
for (var k = 0; k < mutation.removedNodes.length; k++) { |
for (var k = 0; k < mutation.removedNodes.length; k++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeRemoved', |
'abp.dom.nodeRemoved', |
||||
{ |
{ |
||||
$el: $(mutation.removedNodes[k]) |
$el: $(mutation.removedNodes[k]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) { |
if (mutation.addedNodes && mutation.addedNodes.length) { |
||||
for (var j = 0; j < mutation.addedNodes.length; j++) { |
for (var j = 0; j < mutation.addedNodes.length; j++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeAdded', |
'abp.dom.nodeAdded', |
||||
{ |
{ |
||||
$el: $(mutation.addedNodes[j]) |
$el: $(mutation.addedNodes[j]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
new MutationObserver(mutationObserverCallback).observe( |
new MutationObserver(mutationObserverCallback).observe( |
||||
$('body')[0], |
$('body')[0], |
||||
{ |
{ |
||||
subtree: true, |
subtree: true, |
||||
childList: true |
childList: true |
||||
} |
} |
||||
); |
); |
||||
|
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.ajax = function (userOptions) { |
abp.ajax = function (userOptions) { |
||||
userOptions = userOptions || {}; |
userOptions = userOptions || {}; |
||||
|
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
||||
|
|
||||
options.success = undefined; |
options.success = undefined; |
||||
options.error = undefined; |
options.error = undefined; |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$.ajax(options) |
$.ajax(options) |
||||
.done(function (data, textStatus, jqXHR) { |
.done(function (data, textStatus, jqXHR) { |
||||
$dfd.resolve(data); |
$dfd.resolve(data); |
||||
userOptions.success && userOptions.success(data); |
userOptions.success && userOptions.success(data); |
||||
}).fail(function (jqXHR) { |
}).fail(function (jqXHR) { |
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} else { |
} else { |
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} |
} |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
$.extend(abp.ajax, { |
$.extend(abp.ajax, { |
||||
defaultOpts: { |
defaultOpts: { |
||||
dataType: 'json', |
dataType: 'json', |
||||
type: 'POST', |
type: 'POST', |
||||
contentType: 'application/json', |
contentType: 'application/json', |
||||
headers: { |
headers: { |
||||
'X-Requested-With': 'XMLHttpRequest' |
'X-Requested-With': 'XMLHttpRequest' |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
defaultError: { |
defaultError: { |
||||
message: 'An error has occurred!', |
message: 'An error has occurred!', |
||||
details: 'Error detail not sent by server.' |
details: 'Error detail not sent by server.' |
||||
}, |
}, |
||||
|
|
||||
defaultError401: { |
defaultError401: { |
||||
message: 'You are not authenticated!', |
message: 'You are not authenticated!', |
||||
details: 'You should be authenticated (sign in) in order to perform this operation.' |
details: 'You should be authenticated (sign in) in order to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError403: { |
defaultError403: { |
||||
message: 'You are not authorized!', |
message: 'You are not authorized!', |
||||
details: 'You are not allowed to perform this operation.' |
details: 'You are not allowed to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError404: { |
defaultError404: { |
||||
message: 'Resource not found!', |
message: 'Resource not found!', |
||||
details: 'The resource requested could not found on the server.' |
details: 'The resource requested could not found on the server.' |
||||
}, |
}, |
||||
|
|
||||
logError: function (error) { |
logError: function (error) { |
||||
abp.log.error(error); |
abp.log.error(error); |
||||
}, |
}, |
||||
|
|
||||
showError: function (error) { |
showError: function (error) { |
||||
if (error.details) { |
if (error.details) { |
||||
return abp.message.error(error.details, error.message); |
return abp.message.error(error.details, error.message); |
||||
} else { |
} else { |
||||
return abp.message.error(error.message || abp.ajax.defaultError.message); |
return abp.message.error(error.message || abp.ajax.defaultError.message); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleTargetUrl: function (targetUrl) { |
handleTargetUrl: function (targetUrl) { |
||||
if (!targetUrl) { |
if (!targetUrl) { |
||||
location.href = abp.appPath; |
location.href = abp.appPath; |
||||
} else { |
} else { |
||||
location.href = targetUrl; |
location.href = targetUrl; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleErrorStatusCode: function (status) { |
handleErrorStatusCode: function (status) { |
||||
switch (status) { |
switch (status) { |
||||
case 401: |
case 401: |
||||
abp.ajax.handleUnAuthorizedRequest( |
abp.ajax.handleUnAuthorizedRequest( |
||||
abp.ajax.showError(abp.ajax.defaultError401), |
abp.ajax.showError(abp.ajax.defaultError401), |
||||
abp.appPath |
abp.appPath |
||||
); |
); |
||||
break; |
break; |
||||
case 403: |
case 403: |
||||
abp.ajax.showError(abp.ajax.defaultError403); |
abp.ajax.showError(abp.ajax.defaultError403); |
||||
break; |
break; |
||||
case 404: |
case 404: |
||||
abp.ajax.showError(abp.ajax.defaultError404); |
abp.ajax.showError(abp.ajax.defaultError404); |
||||
break; |
break; |
||||
default: |
default: |
||||
abp.ajax.showError(abp.ajax.defaultError); |
abp.ajax.showError(abp.ajax.defaultError); |
||||
break; |
break; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleErrorStatusCode(jqXHR.status); |
abp.ajax.handleErrorStatusCode(jqXHR.status); |
||||
} |
} |
||||
|
|
||||
$dfd.reject.apply(this, arguments); |
$dfd.reject.apply(this, arguments); |
||||
userOptions.error && userOptions.error.apply(this, arguments); |
userOptions.error && userOptions.error.apply(this, arguments); |
||||
}, |
}, |
||||
|
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
var messagePromise = null; |
var messagePromise = null; |
||||
|
|
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
||||
} |
} |
||||
|
|
||||
abp.ajax.logError(jqXHR.responseJSON.error); |
abp.ajax.logError(jqXHR.responseJSON.error); |
||||
|
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
||||
|
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
||||
if (messagePromise) { |
if (messagePromise) { |
||||
messagePromise.done(function () { |
messagePromise.done(function () { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
}); |
}); |
||||
} else { |
} else { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
blockUI: function (options) { |
blockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //block whole page
|
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy(); |
abp.ui.setBusy(); |
||||
} else { //block an element
|
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI); |
abp.ui.setBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
unblockUI: function (options) { |
unblockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //unblock whole page
|
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy(); |
abp.ui.clearBusy(); |
||||
} else { //unblock an element
|
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI); |
abp.ui.clearBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
ajaxSendHandler: function (event, request, settings) { |
ajaxSendHandler: function (event, request, settings) { |
||||
var token = abp.security.antiForgery.getToken(); |
var token = abp.security.antiForgery.getToken(); |
||||
if (!token) { |
if (!token) { |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
||||
} |
} |
||||
} |
} |
||||
}); |
}); |
||||
|
|
||||
$(document).ajaxSend(function (event, request, settings) { |
$(document).ajaxSend(function (event, request, settings) { |
||||
return abp.ajax.ajaxSendHandler(event, request, settings); |
return abp.ajax.ajaxSendHandler(event, request, settings); |
||||
}); |
}); |
||||
|
|
||||
abp.event.on('abp.configurationInitialized', function () { |
abp.event.on('abp.configurationInitialized', function () { |
||||
var l = abp.localization.getResource('AbpUi'); |
var l = abp.localization.getResource('AbpUi'); |
||||
|
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
||||
}); |
}); |
||||
|
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
|
||||
/* UrlStates enum */ |
/* UrlStates enum */ |
||||
var UrlStates = { |
var UrlStates = { |
||||
LOADING: 'LOADING', |
LOADING: 'LOADING', |
||||
LOADED: 'LOADED', |
LOADED: 'LOADED', |
||||
FAILED: 'FAILED' |
FAILED: 'FAILED' |
||||
}; |
}; |
||||
|
|
||||
/* UrlInfo class */ |
/* UrlInfo class */ |
||||
function UrlInfo(url) { |
function UrlInfo(url) { |
||||
this.url = url; |
this.url = url; |
||||
this.state = UrlStates.LOADING; |
this.state = UrlStates.LOADING; |
||||
this.loadCallbacks = []; |
this.loadCallbacks = []; |
||||
this.failCallbacks = []; |
this.failCallbacks = []; |
||||
} |
} |
||||
|
|
||||
UrlInfo.prototype.succeed = function () { |
UrlInfo.prototype.succeed = function () { |
||||
this.state = UrlStates.LOADED; |
this.state = UrlStates.LOADED; |
||||
for (var i = 0; i < this.loadCallbacks.length; i++) { |
for (var i = 0; i < this.loadCallbacks.length; i++) { |
||||
this.loadCallbacks[i](); |
this.loadCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.failed = function () { |
UrlInfo.prototype.failed = function () { |
||||
this.state = UrlStates.FAILED; |
this.state = UrlStates.FAILED; |
||||
for (var i = 0; i < this.failCallbacks.length; i++) { |
for (var i = 0; i < this.failCallbacks.length; i++) { |
||||
this.failCallbacks[i](); |
this.failCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
||||
switch (this.state) { |
switch (this.state) { |
||||
case UrlStates.LOADED: |
case UrlStates.LOADED: |
||||
loadCallback && loadCallback(); |
loadCallback && loadCallback(); |
||||
break; |
break; |
||||
case UrlStates.FAILED: |
case UrlStates.FAILED: |
||||
failCallback && failCallback(); |
failCallback && failCallback(); |
||||
break; |
break; |
||||
case UrlStates.LOADING: |
case UrlStates.LOADING: |
||||
this.addCallbacks(loadCallback, failCallback); |
this.addCallbacks(loadCallback, failCallback); |
||||
break; |
break; |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
||||
loadCallback && this.loadCallbacks.push(loadCallback); |
loadCallback && this.loadCallbacks.push(loadCallback); |
||||
failCallback && this.failCallbacks.push(failCallback); |
failCallback && this.failCallbacks.push(failCallback); |
||||
}; |
}; |
||||
|
|
||||
/* ResourceLoader API */ |
/* ResourceLoader API */ |
||||
|
|
||||
abp.ResourceLoader = (function () { |
abp.ResourceLoader = (function () { |
||||
|
|
||||
var _urlInfos = {}; |
var _urlInfos = {}; |
||||
|
|
||||
function getCacheKey(url) { |
function getCacheKey(url) { |
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
function appendTimeToUrl(url) { |
function appendTimeToUrl(url) { |
||||
|
|
||||
if (url.indexOf('?') < 0) { |
if (url.indexOf('?') < 0) { |
||||
url += '?'; |
url += '?'; |
||||
} else { |
} else { |
||||
url += '&'; |
url += '&'; |
||||
} |
} |
||||
|
|
||||
url += '_=' + new Date().getTime(); |
url += '_=' + new Date().getTime(); |
||||
|
|
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
||||
|
|
||||
var cacheKey = getCacheKey(url); |
var cacheKey = getCacheKey(url); |
||||
|
|
||||
var urlInfo = _urlInfos[cacheKey]; |
var urlInfo = _urlInfos[cacheKey]; |
||||
|
|
||||
if (urlInfo) { |
if (urlInfo) { |
||||
urlInfo.handleCallbacks(loadCallback, failCallback); |
urlInfo.handleCallbacks(loadCallback, failCallback); |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
||||
urlInfo.addCallbacks(loadCallback, failCallback); |
urlInfo.addCallbacks(loadCallback, failCallback); |
||||
|
|
||||
serverLoader(urlInfo); |
serverLoader(urlInfo); |
||||
}; |
}; |
||||
|
|
||||
var _loadScript = function (url, loadCallback, failCallback) { |
var _loadScript = function (url, loadCallback, failCallback) { |
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
||||
$.getScript(url) |
$.getScript(url) |
||||
.done(function () { |
.done(function () { |
||||
urlInfo.succeed(); |
urlInfo.succeed(); |
||||
}) |
}) |
||||
.fail(function () { |
.fail(function () { |
||||
urlInfo.failed(); |
urlInfo.failed(); |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
var _loadStyle = function (url) { |
var _loadStyle = function (url) { |
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
||||
|
|
||||
$('<link/>', { |
$('<link/>', { |
||||
rel: 'stylesheet', |
rel: 'stylesheet', |
||||
type: 'text/css', |
type: 'text/css', |
||||
href: appendTimeToUrl(url) |
href: appendTimeToUrl(url) |
||||
}).appendTo('head'); |
}).appendTo('head'); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
return { |
return { |
||||
loadScript: _loadScript, |
loadScript: _loadScript, |
||||
loadStyle: _loadStyle |
loadStyle: _loadStyle |
||||
} |
} |
||||
})(); |
})(); |
||||
|
|
||||
})(jQuery); |
})(jQuery); |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,37 +1,37 @@ |
|||||
{ |
{ |
||||
"name": "malihu-custom-scrollbar-plugin", |
"name": "malihu-custom-scrollbar-plugin", |
||||
"version": "3.1.5", |
"version": "3.1.5", |
||||
"author": "malihu (http://manos.malihu.gr)", |
"author": "malihu (http://manos.malihu.gr)", |
||||
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
||||
"license": "MIT", |
"license": "MIT", |
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
||||
"main": "./jquery.mCustomScrollbar.js", |
"main": "./jquery.mCustomScrollbar.js", |
||||
"repository": { |
"repository": { |
||||
"type": "git", |
"type": "git", |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
||||
}, |
}, |
||||
"bugs": { |
"bugs": { |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
||||
}, |
}, |
||||
"keywords": [ |
"keywords": [ |
||||
"jquery-plugin", |
"jquery-plugin", |
||||
"custom-scrollbar", |
"custom-scrollbar", |
||||
"scrollbar" |
"scrollbar" |
||||
], |
], |
||||
"files": [ |
"files": [ |
||||
"jquery.mCustomScrollbar.js", |
"jquery.mCustomScrollbar.js", |
||||
"jquery.mCustomScrollbar.concat.min.js", |
"jquery.mCustomScrollbar.concat.min.js", |
||||
"jquery.mCustomScrollbar.css", |
"jquery.mCustomScrollbar.css", |
||||
"mCSB_buttons.png", |
"mCSB_buttons.png", |
||||
"readme.md" |
"readme.md" |
||||
], |
], |
||||
"jam": { |
"jam": { |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery": ">=1.6", |
"jquery": ">=1.6", |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
}, |
}, |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
} |
} |
||||
@ -1,82 +1,82 @@ |
|||||
malihu custom scrollbar plugin |
malihu custom scrollbar plugin |
||||
================================ |
================================ |
||||
|
|
||||
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
||||
|
|
||||
* Vertical and/or horizontal scrollbar(s) |
* Vertical and/or horizontal scrollbar(s) |
||||
* Adjustable scrolling momentum |
* Adjustable scrolling momentum |
||||
* Mouse-wheel, keyboard and touch support |
* Mouse-wheel, keyboard and touch support |
||||
* Ready-to-use themes and customization via CSS |
* Ready-to-use themes and customization via CSS |
||||
* RTL direction support |
* RTL direction support |
||||
* Option parameters for full control of scrollbar functionality |
* Option parameters for full control of scrollbar functionality |
||||
* Methods for triggering actions like scroll-to, update, destroy etc. |
* Methods for triggering actions like scroll-to, update, destroy etc. |
||||
* User-defined callbacks |
* User-defined callbacks |
||||
* Selectable/searchable content |
* Selectable/searchable content |
||||
|
|
||||
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
||||
|
|
||||
#### Installation |
#### Installation |
||||
|
|
||||
npm: `npm install malihu-custom-scrollbar-plugin` |
npm: `npm install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin` |
Bower: `bower install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
||||
|
|
||||
#### Usage |
#### Usage |
||||
|
|
||||
Manual: `$(selector).mCustomScrollbar();` |
Manual: `$(selector).mCustomScrollbar();` |
||||
|
|
||||
[Browserify](http://browserify.org/): |
[Browserify](http://browserify.org/): |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
[webpack](https://webpack.github.io/): |
[webpack](https://webpack.github.io/): |
||||
|
|
||||
npm install imports-loader |
npm install imports-loader |
||||
npm install jquery-mousewheel |
npm install jquery-mousewheel |
||||
npm install malihu-custom-scrollbar-plugin |
npm install malihu-custom-scrollbar-plugin |
||||
|
|
||||
module.exports = { |
module.exports = { |
||||
module: { |
module: { |
||||
loaders: [ |
loaders: [ |
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
||||
] |
] |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require("jquery-mousewheel")($); |
require("jquery-mousewheel")($); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
|
|
||||
Requirements |
Requirements |
||||
------------------------- |
------------------------- |
||||
|
|
||||
jQuery version **1.6.0** or higher |
jQuery version **1.6.0** or higher |
||||
|
|
||||
Browser compatibility |
Browser compatibility |
||||
------------------------- |
------------------------- |
||||
|
|
||||
* Internet Explorer 8+ |
* Internet Explorer 8+ |
||||
* Firefox |
* Firefox |
||||
* Chrome |
* Chrome |
||||
* Opera |
* Opera |
||||
* Safari |
* Safari |
||||
* iOS |
* iOS |
||||
* Android |
* Android |
||||
* Windows Phone |
* Windows Phone |
||||
|
|
||||
License |
License |
||||
------------------------- |
------------------------- |
||||
|
|
||||
MIT License (MIT) |
MIT License (MIT) |
||||
|
|
||||
http://opensource.org/licenses/MIT |
http://opensource.org/licenses/MIT |
||||
|
|
||||
Donate |
Donate |
||||
------------------------- |
------------------------- |
||||
|
|
||||
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
||||
@ -1,8 +0,0 @@ |
|||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
|
||||
# yarn lockfile v1 |
|
||||
|
|
||||
|
|
||||
jquery-mousewheel@>=3.0.6: |
|
||||
version "3.1.13" |
|
||||
resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.1.13.tgz#06f0335f16e353a695e7206bf50503cb523a6ee5" |
|
||||
integrity sha1-BvAzXxbjU6aV5yBr9QUDy1I6buU= |
|
||||
@ -1,56 +1,56 @@ |
|||||
@keyframes spin { |
@keyframes spin { |
||||
0% { |
0% { |
||||
transform: translateZ(0) rotate(0deg); |
transform: translateZ(0) rotate(0deg); |
||||
} |
} |
||||
|
|
||||
100% { |
100% { |
||||
transform: translateZ(0) rotate(360deg); |
transform: translateZ(0) rotate(360deg); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.abp-block-area { |
.abp-block-area { |
||||
position: fixed; |
position: fixed; |
||||
top: 0; |
top: 0; |
||||
left: 0; |
left: 0; |
||||
width: 100%; |
width: 100%; |
||||
height: 100%; |
height: 100%; |
||||
z-index: 102; |
z-index: 102; |
||||
background-color: #fff; |
background-color: #fff; |
||||
opacity: .8; |
opacity: .8; |
||||
transition: opacity .25s; |
transition: opacity .25s; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-disappearing { |
.abp-block-area.abp-block-area-disappearing { |
||||
opacity: 0; |
opacity: 0; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:after { |
.abp-block-area.abp-block-area-busy:after { |
||||
content: attr(data-text); |
content: attr(data-text); |
||||
display: block; |
display: block; |
||||
max-width: 125px; |
max-width: 125px; |
||||
position: absolute; |
position: absolute; |
||||
top: 50%; |
top: 50%; |
||||
left: 50%; |
left: 50%; |
||||
transform: translate(-50%, -50%); |
transform: translate(-50%, -50%); |
||||
font-size: 20px; |
font-size: 20px; |
||||
font-family: sans-serif; |
font-family: sans-serif; |
||||
color: #343a40; |
color: #343a40; |
||||
text-align: center; |
text-align: center; |
||||
text-transform: uppercase; |
text-transform: uppercase; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:before { |
.abp-block-area.abp-block-area-busy:before { |
||||
content: ""; |
content: ""; |
||||
display: block; |
display: block; |
||||
width: 150px; |
width: 150px; |
||||
height: 150px; |
height: 150px; |
||||
border-radius: 50%; |
border-radius: 50%; |
||||
border-width: 2px; |
border-width: 2px; |
||||
border-style: solid; |
border-style: solid; |
||||
border-color: transparent #228ae6 #228ae6 #228ae6; |
border-color: transparent #228ae6 #228ae6 #228ae6; |
||||
position: absolute; |
position: absolute; |
||||
top: calc(50% - 75px); |
top: calc(50% - 75px); |
||||
left: calc(50% - 75px); |
left: calc(50% - 75px); |
||||
will-change: transform; |
will-change: transform; |
||||
animation: spin .75s infinite ease-in-out; |
animation: spin .75s infinite ease-in-out; |
||||
} |
} |
||||
|
|||||
File diff suppressed because it is too large
@ -1,389 +1,389 @@ |
|||||
var abp = abp || {}; |
var abp = abp || {}; |
||||
(function($) { |
(function($) { |
||||
|
|
||||
if (!$) { |
if (!$) { |
||||
throw "abp/jquery library requires the jquery library included to the page!"; |
throw "abp/jquery library requires the jquery library included to the page!"; |
||||
} |
} |
||||
|
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
|
||||
abp.message._showMessage = function (message, title) { |
abp.message._showMessage = function (message, title) { |
||||
alert((title || '') + ' ' + message); |
alert((title || '') + ' ' + message); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(); |
$dfd.resolve(); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) { |
abp.message.confirm = function (message, titleOrCallback, callback) { |
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
||||
callback = titleOrCallback; |
callback = titleOrCallback; |
||||
} |
} |
||||
|
|
||||
var result = confirm(message); |
var result = confirm(message); |
||||
callback && callback(result); |
callback && callback(result); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(result); |
$dfd.resolve(result); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.utils.isFunction = function (obj) { |
abp.utils.isFunction = function (obj) { |
||||
return $.isFunction(obj); |
return $.isFunction(obj); |
||||
}; |
}; |
||||
|
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
|
||||
$.fn.findWithSelf = function (selector) { |
$.fn.findWithSelf = function (selector) { |
||||
return this.filter(selector).add(this.find(selector)); |
return this.filter(selector).add(this.find(selector)); |
||||
}; |
}; |
||||
|
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.dom = abp.dom || {}; |
abp.dom = abp.dom || {}; |
||||
|
|
||||
abp.dom.onNodeAdded = function (callback) { |
abp.dom.onNodeAdded = function (callback) { |
||||
abp.event.on('abp.dom.nodeAdded', callback); |
abp.event.on('abp.dom.nodeAdded', callback); |
||||
}; |
}; |
||||
|
|
||||
abp.dom.onNodeRemoved = function (callback) { |
abp.dom.onNodeRemoved = function (callback) { |
||||
abp.event.on('abp.dom.nodeRemoved', callback); |
abp.event.on('abp.dom.nodeRemoved', callback); |
||||
}; |
}; |
||||
|
|
||||
var mutationObserverCallback = function (mutationsList) { |
var mutationObserverCallback = function (mutationsList) { |
||||
for (var i = 0; i < mutationsList.length; i++) { |
for (var i = 0; i < mutationsList.length; i++) { |
||||
var mutation = mutationsList[i]; |
var mutation = mutationsList[i]; |
||||
if (mutation.type === 'childList') { |
if (mutation.type === 'childList') { |
||||
if (mutation.addedNodes && mutation.removedNodes.length) { |
if (mutation.addedNodes && mutation.removedNodes.length) { |
||||
for (var k = 0; k < mutation.removedNodes.length; k++) { |
for (var k = 0; k < mutation.removedNodes.length; k++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeRemoved', |
'abp.dom.nodeRemoved', |
||||
{ |
{ |
||||
$el: $(mutation.removedNodes[k]) |
$el: $(mutation.removedNodes[k]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) { |
if (mutation.addedNodes && mutation.addedNodes.length) { |
||||
for (var j = 0; j < mutation.addedNodes.length; j++) { |
for (var j = 0; j < mutation.addedNodes.length; j++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeAdded', |
'abp.dom.nodeAdded', |
||||
{ |
{ |
||||
$el: $(mutation.addedNodes[j]) |
$el: $(mutation.addedNodes[j]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
new MutationObserver(mutationObserverCallback).observe( |
new MutationObserver(mutationObserverCallback).observe( |
||||
$('body')[0], |
$('body')[0], |
||||
{ |
{ |
||||
subtree: true, |
subtree: true, |
||||
childList: true |
childList: true |
||||
} |
} |
||||
); |
); |
||||
|
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.ajax = function (userOptions) { |
abp.ajax = function (userOptions) { |
||||
userOptions = userOptions || {}; |
userOptions = userOptions || {}; |
||||
|
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
||||
|
|
||||
options.success = undefined; |
options.success = undefined; |
||||
options.error = undefined; |
options.error = undefined; |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$.ajax(options) |
$.ajax(options) |
||||
.done(function (data, textStatus, jqXHR) { |
.done(function (data, textStatus, jqXHR) { |
||||
$dfd.resolve(data); |
$dfd.resolve(data); |
||||
userOptions.success && userOptions.success(data); |
userOptions.success && userOptions.success(data); |
||||
}).fail(function (jqXHR) { |
}).fail(function (jqXHR) { |
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} else { |
} else { |
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} |
} |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
$.extend(abp.ajax, { |
$.extend(abp.ajax, { |
||||
defaultOpts: { |
defaultOpts: { |
||||
dataType: 'json', |
dataType: 'json', |
||||
type: 'POST', |
type: 'POST', |
||||
contentType: 'application/json', |
contentType: 'application/json', |
||||
headers: { |
headers: { |
||||
'X-Requested-With': 'XMLHttpRequest' |
'X-Requested-With': 'XMLHttpRequest' |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
defaultError: { |
defaultError: { |
||||
message: 'An error has occurred!', |
message: 'An error has occurred!', |
||||
details: 'Error detail not sent by server.' |
details: 'Error detail not sent by server.' |
||||
}, |
}, |
||||
|
|
||||
defaultError401: { |
defaultError401: { |
||||
message: 'You are not authenticated!', |
message: 'You are not authenticated!', |
||||
details: 'You should be authenticated (sign in) in order to perform this operation.' |
details: 'You should be authenticated (sign in) in order to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError403: { |
defaultError403: { |
||||
message: 'You are not authorized!', |
message: 'You are not authorized!', |
||||
details: 'You are not allowed to perform this operation.' |
details: 'You are not allowed to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError404: { |
defaultError404: { |
||||
message: 'Resource not found!', |
message: 'Resource not found!', |
||||
details: 'The resource requested could not found on the server.' |
details: 'The resource requested could not found on the server.' |
||||
}, |
}, |
||||
|
|
||||
logError: function (error) { |
logError: function (error) { |
||||
abp.log.error(error); |
abp.log.error(error); |
||||
}, |
}, |
||||
|
|
||||
showError: function (error) { |
showError: function (error) { |
||||
if (error.details) { |
if (error.details) { |
||||
return abp.message.error(error.details, error.message); |
return abp.message.error(error.details, error.message); |
||||
} else { |
} else { |
||||
return abp.message.error(error.message || abp.ajax.defaultError.message); |
return abp.message.error(error.message || abp.ajax.defaultError.message); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleTargetUrl: function (targetUrl) { |
handleTargetUrl: function (targetUrl) { |
||||
if (!targetUrl) { |
if (!targetUrl) { |
||||
location.href = abp.appPath; |
location.href = abp.appPath; |
||||
} else { |
} else { |
||||
location.href = targetUrl; |
location.href = targetUrl; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleErrorStatusCode: function (status) { |
handleErrorStatusCode: function (status) { |
||||
switch (status) { |
switch (status) { |
||||
case 401: |
case 401: |
||||
abp.ajax.handleUnAuthorizedRequest( |
abp.ajax.handleUnAuthorizedRequest( |
||||
abp.ajax.showError(abp.ajax.defaultError401), |
abp.ajax.showError(abp.ajax.defaultError401), |
||||
abp.appPath |
abp.appPath |
||||
); |
); |
||||
break; |
break; |
||||
case 403: |
case 403: |
||||
abp.ajax.showError(abp.ajax.defaultError403); |
abp.ajax.showError(abp.ajax.defaultError403); |
||||
break; |
break; |
||||
case 404: |
case 404: |
||||
abp.ajax.showError(abp.ajax.defaultError404); |
abp.ajax.showError(abp.ajax.defaultError404); |
||||
break; |
break; |
||||
default: |
default: |
||||
abp.ajax.showError(abp.ajax.defaultError); |
abp.ajax.showError(abp.ajax.defaultError); |
||||
break; |
break; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleErrorStatusCode(jqXHR.status); |
abp.ajax.handleErrorStatusCode(jqXHR.status); |
||||
} |
} |
||||
|
|
||||
$dfd.reject.apply(this, arguments); |
$dfd.reject.apply(this, arguments); |
||||
userOptions.error && userOptions.error.apply(this, arguments); |
userOptions.error && userOptions.error.apply(this, arguments); |
||||
}, |
}, |
||||
|
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
var messagePromise = null; |
var messagePromise = null; |
||||
|
|
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
||||
} |
} |
||||
|
|
||||
abp.ajax.logError(jqXHR.responseJSON.error); |
abp.ajax.logError(jqXHR.responseJSON.error); |
||||
|
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
||||
|
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
||||
if (messagePromise) { |
if (messagePromise) { |
||||
messagePromise.done(function () { |
messagePromise.done(function () { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
}); |
}); |
||||
} else { |
} else { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
blockUI: function (options) { |
blockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //block whole page
|
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy(); |
abp.ui.setBusy(); |
||||
} else { //block an element
|
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI); |
abp.ui.setBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
unblockUI: function (options) { |
unblockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //unblock whole page
|
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy(); |
abp.ui.clearBusy(); |
||||
} else { //unblock an element
|
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI); |
abp.ui.clearBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
ajaxSendHandler: function (event, request, settings) { |
ajaxSendHandler: function (event, request, settings) { |
||||
var token = abp.security.antiForgery.getToken(); |
var token = abp.security.antiForgery.getToken(); |
||||
if (!token) { |
if (!token) { |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
||||
} |
} |
||||
} |
} |
||||
}); |
}); |
||||
|
|
||||
$(document).ajaxSend(function (event, request, settings) { |
$(document).ajaxSend(function (event, request, settings) { |
||||
return abp.ajax.ajaxSendHandler(event, request, settings); |
return abp.ajax.ajaxSendHandler(event, request, settings); |
||||
}); |
}); |
||||
|
|
||||
abp.event.on('abp.configurationInitialized', function () { |
abp.event.on('abp.configurationInitialized', function () { |
||||
var l = abp.localization.getResource('AbpUi'); |
var l = abp.localization.getResource('AbpUi'); |
||||
|
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
||||
}); |
}); |
||||
|
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
|
||||
/* UrlStates enum */ |
/* UrlStates enum */ |
||||
var UrlStates = { |
var UrlStates = { |
||||
LOADING: 'LOADING', |
LOADING: 'LOADING', |
||||
LOADED: 'LOADED', |
LOADED: 'LOADED', |
||||
FAILED: 'FAILED' |
FAILED: 'FAILED' |
||||
}; |
}; |
||||
|
|
||||
/* UrlInfo class */ |
/* UrlInfo class */ |
||||
function UrlInfo(url) { |
function UrlInfo(url) { |
||||
this.url = url; |
this.url = url; |
||||
this.state = UrlStates.LOADING; |
this.state = UrlStates.LOADING; |
||||
this.loadCallbacks = []; |
this.loadCallbacks = []; |
||||
this.failCallbacks = []; |
this.failCallbacks = []; |
||||
} |
} |
||||
|
|
||||
UrlInfo.prototype.succeed = function () { |
UrlInfo.prototype.succeed = function () { |
||||
this.state = UrlStates.LOADED; |
this.state = UrlStates.LOADED; |
||||
for (var i = 0; i < this.loadCallbacks.length; i++) { |
for (var i = 0; i < this.loadCallbacks.length; i++) { |
||||
this.loadCallbacks[i](); |
this.loadCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.failed = function () { |
UrlInfo.prototype.failed = function () { |
||||
this.state = UrlStates.FAILED; |
this.state = UrlStates.FAILED; |
||||
for (var i = 0; i < this.failCallbacks.length; i++) { |
for (var i = 0; i < this.failCallbacks.length; i++) { |
||||
this.failCallbacks[i](); |
this.failCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
||||
switch (this.state) { |
switch (this.state) { |
||||
case UrlStates.LOADED: |
case UrlStates.LOADED: |
||||
loadCallback && loadCallback(); |
loadCallback && loadCallback(); |
||||
break; |
break; |
||||
case UrlStates.FAILED: |
case UrlStates.FAILED: |
||||
failCallback && failCallback(); |
failCallback && failCallback(); |
||||
break; |
break; |
||||
case UrlStates.LOADING: |
case UrlStates.LOADING: |
||||
this.addCallbacks(loadCallback, failCallback); |
this.addCallbacks(loadCallback, failCallback); |
||||
break; |
break; |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
||||
loadCallback && this.loadCallbacks.push(loadCallback); |
loadCallback && this.loadCallbacks.push(loadCallback); |
||||
failCallback && this.failCallbacks.push(failCallback); |
failCallback && this.failCallbacks.push(failCallback); |
||||
}; |
}; |
||||
|
|
||||
/* ResourceLoader API */ |
/* ResourceLoader API */ |
||||
|
|
||||
abp.ResourceLoader = (function () { |
abp.ResourceLoader = (function () { |
||||
|
|
||||
var _urlInfos = {}; |
var _urlInfos = {}; |
||||
|
|
||||
function getCacheKey(url) { |
function getCacheKey(url) { |
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
function appendTimeToUrl(url) { |
function appendTimeToUrl(url) { |
||||
|
|
||||
if (url.indexOf('?') < 0) { |
if (url.indexOf('?') < 0) { |
||||
url += '?'; |
url += '?'; |
||||
} else { |
} else { |
||||
url += '&'; |
url += '&'; |
||||
} |
} |
||||
|
|
||||
url += '_=' + new Date().getTime(); |
url += '_=' + new Date().getTime(); |
||||
|
|
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
||||
|
|
||||
var cacheKey = getCacheKey(url); |
var cacheKey = getCacheKey(url); |
||||
|
|
||||
var urlInfo = _urlInfos[cacheKey]; |
var urlInfo = _urlInfos[cacheKey]; |
||||
|
|
||||
if (urlInfo) { |
if (urlInfo) { |
||||
urlInfo.handleCallbacks(loadCallback, failCallback); |
urlInfo.handleCallbacks(loadCallback, failCallback); |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
||||
urlInfo.addCallbacks(loadCallback, failCallback); |
urlInfo.addCallbacks(loadCallback, failCallback); |
||||
|
|
||||
serverLoader(urlInfo); |
serverLoader(urlInfo); |
||||
}; |
}; |
||||
|
|
||||
var _loadScript = function (url, loadCallback, failCallback) { |
var _loadScript = function (url, loadCallback, failCallback) { |
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
||||
$.getScript(url) |
$.getScript(url) |
||||
.done(function () { |
.done(function () { |
||||
urlInfo.succeed(); |
urlInfo.succeed(); |
||||
}) |
}) |
||||
.fail(function () { |
.fail(function () { |
||||
urlInfo.failed(); |
urlInfo.failed(); |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
var _loadStyle = function (url) { |
var _loadStyle = function (url) { |
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
||||
|
|
||||
$('<link/>', { |
$('<link/>', { |
||||
rel: 'stylesheet', |
rel: 'stylesheet', |
||||
type: 'text/css', |
type: 'text/css', |
||||
href: appendTimeToUrl(url) |
href: appendTimeToUrl(url) |
||||
}).appendTo('head'); |
}).appendTo('head'); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
return { |
return { |
||||
loadScript: _loadScript, |
loadScript: _loadScript, |
||||
loadStyle: _loadStyle |
loadStyle: _loadStyle |
||||
} |
} |
||||
})(); |
})(); |
||||
|
|
||||
})(jQuery); |
})(jQuery); |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,37 +1,37 @@ |
|||||
{ |
{ |
||||
"name": "malihu-custom-scrollbar-plugin", |
"name": "malihu-custom-scrollbar-plugin", |
||||
"version": "3.1.5", |
"version": "3.1.5", |
||||
"author": "malihu (http://manos.malihu.gr)", |
"author": "malihu (http://manos.malihu.gr)", |
||||
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
||||
"license": "MIT", |
"license": "MIT", |
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
||||
"main": "./jquery.mCustomScrollbar.js", |
"main": "./jquery.mCustomScrollbar.js", |
||||
"repository": { |
"repository": { |
||||
"type": "git", |
"type": "git", |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
||||
}, |
}, |
||||
"bugs": { |
"bugs": { |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
||||
}, |
}, |
||||
"keywords": [ |
"keywords": [ |
||||
"jquery-plugin", |
"jquery-plugin", |
||||
"custom-scrollbar", |
"custom-scrollbar", |
||||
"scrollbar" |
"scrollbar" |
||||
], |
], |
||||
"files": [ |
"files": [ |
||||
"jquery.mCustomScrollbar.js", |
"jquery.mCustomScrollbar.js", |
||||
"jquery.mCustomScrollbar.concat.min.js", |
"jquery.mCustomScrollbar.concat.min.js", |
||||
"jquery.mCustomScrollbar.css", |
"jquery.mCustomScrollbar.css", |
||||
"mCSB_buttons.png", |
"mCSB_buttons.png", |
||||
"readme.md" |
"readme.md" |
||||
], |
], |
||||
"jam": { |
"jam": { |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery": ">=1.6", |
"jquery": ">=1.6", |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
}, |
}, |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
} |
} |
||||
@ -1,82 +1,82 @@ |
|||||
malihu custom scrollbar plugin |
malihu custom scrollbar plugin |
||||
================================ |
================================ |
||||
|
|
||||
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
||||
|
|
||||
* Vertical and/or horizontal scrollbar(s) |
* Vertical and/or horizontal scrollbar(s) |
||||
* Adjustable scrolling momentum |
* Adjustable scrolling momentum |
||||
* Mouse-wheel, keyboard and touch support |
* Mouse-wheel, keyboard and touch support |
||||
* Ready-to-use themes and customization via CSS |
* Ready-to-use themes and customization via CSS |
||||
* RTL direction support |
* RTL direction support |
||||
* Option parameters for full control of scrollbar functionality |
* Option parameters for full control of scrollbar functionality |
||||
* Methods for triggering actions like scroll-to, update, destroy etc. |
* Methods for triggering actions like scroll-to, update, destroy etc. |
||||
* User-defined callbacks |
* User-defined callbacks |
||||
* Selectable/searchable content |
* Selectable/searchable content |
||||
|
|
||||
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
||||
|
|
||||
#### Installation |
#### Installation |
||||
|
|
||||
npm: `npm install malihu-custom-scrollbar-plugin` |
npm: `npm install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin` |
Bower: `bower install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
||||
|
|
||||
#### Usage |
#### Usage |
||||
|
|
||||
Manual: `$(selector).mCustomScrollbar();` |
Manual: `$(selector).mCustomScrollbar();` |
||||
|
|
||||
[Browserify](http://browserify.org/): |
[Browserify](http://browserify.org/): |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
[webpack](https://webpack.github.io/): |
[webpack](https://webpack.github.io/): |
||||
|
|
||||
npm install imports-loader |
npm install imports-loader |
||||
npm install jquery-mousewheel |
npm install jquery-mousewheel |
||||
npm install malihu-custom-scrollbar-plugin |
npm install malihu-custom-scrollbar-plugin |
||||
|
|
||||
module.exports = { |
module.exports = { |
||||
module: { |
module: { |
||||
loaders: [ |
loaders: [ |
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
||||
] |
] |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require("jquery-mousewheel")($); |
require("jquery-mousewheel")($); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
|
|
||||
Requirements |
Requirements |
||||
------------------------- |
------------------------- |
||||
|
|
||||
jQuery version **1.6.0** or higher |
jQuery version **1.6.0** or higher |
||||
|
|
||||
Browser compatibility |
Browser compatibility |
||||
------------------------- |
------------------------- |
||||
|
|
||||
* Internet Explorer 8+ |
* Internet Explorer 8+ |
||||
* Firefox |
* Firefox |
||||
* Chrome |
* Chrome |
||||
* Opera |
* Opera |
||||
* Safari |
* Safari |
||||
* iOS |
* iOS |
||||
* Android |
* Android |
||||
* Windows Phone |
* Windows Phone |
||||
|
|
||||
License |
License |
||||
------------------------- |
------------------------- |
||||
|
|
||||
MIT License (MIT) |
MIT License (MIT) |
||||
|
|
||||
http://opensource.org/licenses/MIT |
http://opensource.org/licenses/MIT |
||||
|
|
||||
Donate |
Donate |
||||
------------------------- |
------------------------- |
||||
|
|
||||
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
||||
@ -1,8 +0,0 @@ |
|||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
|
||||
# yarn lockfile v1 |
|
||||
|
|
||||
|
|
||||
jquery-mousewheel@>=3.0.6: |
|
||||
version "3.1.13" |
|
||||
resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.1.13.tgz#06f0335f16e353a695e7206bf50503cb523a6ee5" |
|
||||
integrity sha1-BvAzXxbjU6aV5yBr9QUDy1I6buU= |
|
||||
@ -1,56 +1,56 @@ |
|||||
@keyframes spin { |
@keyframes spin { |
||||
0% { |
0% { |
||||
transform: translateZ(0) rotate(0deg); |
transform: translateZ(0) rotate(0deg); |
||||
} |
} |
||||
|
|
||||
100% { |
100% { |
||||
transform: translateZ(0) rotate(360deg); |
transform: translateZ(0) rotate(360deg); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.abp-block-area { |
.abp-block-area { |
||||
position: fixed; |
position: fixed; |
||||
top: 0; |
top: 0; |
||||
left: 0; |
left: 0; |
||||
width: 100%; |
width: 100%; |
||||
height: 100%; |
height: 100%; |
||||
z-index: 102; |
z-index: 102; |
||||
background-color: #fff; |
background-color: #fff; |
||||
opacity: .8; |
opacity: .8; |
||||
transition: opacity .25s; |
transition: opacity .25s; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-disappearing { |
.abp-block-area.abp-block-area-disappearing { |
||||
opacity: 0; |
opacity: 0; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:after { |
.abp-block-area.abp-block-area-busy:after { |
||||
content: attr(data-text); |
content: attr(data-text); |
||||
display: block; |
display: block; |
||||
max-width: 125px; |
max-width: 125px; |
||||
position: absolute; |
position: absolute; |
||||
top: 50%; |
top: 50%; |
||||
left: 50%; |
left: 50%; |
||||
transform: translate(-50%, -50%); |
transform: translate(-50%, -50%); |
||||
font-size: 20px; |
font-size: 20px; |
||||
font-family: sans-serif; |
font-family: sans-serif; |
||||
color: #343a40; |
color: #343a40; |
||||
text-align: center; |
text-align: center; |
||||
text-transform: uppercase; |
text-transform: uppercase; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:before { |
.abp-block-area.abp-block-area-busy:before { |
||||
content: ""; |
content: ""; |
||||
display: block; |
display: block; |
||||
width: 150px; |
width: 150px; |
||||
height: 150px; |
height: 150px; |
||||
border-radius: 50%; |
border-radius: 50%; |
||||
border-width: 2px; |
border-width: 2px; |
||||
border-style: solid; |
border-style: solid; |
||||
border-color: transparent #228ae6 #228ae6 #228ae6; |
border-color: transparent #228ae6 #228ae6 #228ae6; |
||||
position: absolute; |
position: absolute; |
||||
top: calc(50% - 75px); |
top: calc(50% - 75px); |
||||
left: calc(50% - 75px); |
left: calc(50% - 75px); |
||||
will-change: transform; |
will-change: transform; |
||||
animation: spin .75s infinite ease-in-out; |
animation: spin .75s infinite ease-in-out; |
||||
} |
} |
||||
|
|||||
File diff suppressed because it is too large
@ -1,389 +1,389 @@ |
|||||
var abp = abp || {}; |
var abp = abp || {}; |
||||
(function($) { |
(function($) { |
||||
|
|
||||
if (!$) { |
if (!$) { |
||||
throw "abp/jquery library requires the jquery library included to the page!"; |
throw "abp/jquery library requires the jquery library included to the page!"; |
||||
} |
} |
||||
|
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
|
||||
abp.message._showMessage = function (message, title) { |
abp.message._showMessage = function (message, title) { |
||||
alert((title || '') + ' ' + message); |
alert((title || '') + ' ' + message); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(); |
$dfd.resolve(); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) { |
abp.message.confirm = function (message, titleOrCallback, callback) { |
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
||||
callback = titleOrCallback; |
callback = titleOrCallback; |
||||
} |
} |
||||
|
|
||||
var result = confirm(message); |
var result = confirm(message); |
||||
callback && callback(result); |
callback && callback(result); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(result); |
$dfd.resolve(result); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.utils.isFunction = function (obj) { |
abp.utils.isFunction = function (obj) { |
||||
return $.isFunction(obj); |
return $.isFunction(obj); |
||||
}; |
}; |
||||
|
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
|
||||
$.fn.findWithSelf = function (selector) { |
$.fn.findWithSelf = function (selector) { |
||||
return this.filter(selector).add(this.find(selector)); |
return this.filter(selector).add(this.find(selector)); |
||||
}; |
}; |
||||
|
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.dom = abp.dom || {}; |
abp.dom = abp.dom || {}; |
||||
|
|
||||
abp.dom.onNodeAdded = function (callback) { |
abp.dom.onNodeAdded = function (callback) { |
||||
abp.event.on('abp.dom.nodeAdded', callback); |
abp.event.on('abp.dom.nodeAdded', callback); |
||||
}; |
}; |
||||
|
|
||||
abp.dom.onNodeRemoved = function (callback) { |
abp.dom.onNodeRemoved = function (callback) { |
||||
abp.event.on('abp.dom.nodeRemoved', callback); |
abp.event.on('abp.dom.nodeRemoved', callback); |
||||
}; |
}; |
||||
|
|
||||
var mutationObserverCallback = function (mutationsList) { |
var mutationObserverCallback = function (mutationsList) { |
||||
for (var i = 0; i < mutationsList.length; i++) { |
for (var i = 0; i < mutationsList.length; i++) { |
||||
var mutation = mutationsList[i]; |
var mutation = mutationsList[i]; |
||||
if (mutation.type === 'childList') { |
if (mutation.type === 'childList') { |
||||
if (mutation.addedNodes && mutation.removedNodes.length) { |
if (mutation.addedNodes && mutation.removedNodes.length) { |
||||
for (var k = 0; k < mutation.removedNodes.length; k++) { |
for (var k = 0; k < mutation.removedNodes.length; k++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeRemoved', |
'abp.dom.nodeRemoved', |
||||
{ |
{ |
||||
$el: $(mutation.removedNodes[k]) |
$el: $(mutation.removedNodes[k]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) { |
if (mutation.addedNodes && mutation.addedNodes.length) { |
||||
for (var j = 0; j < mutation.addedNodes.length; j++) { |
for (var j = 0; j < mutation.addedNodes.length; j++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeAdded', |
'abp.dom.nodeAdded', |
||||
{ |
{ |
||||
$el: $(mutation.addedNodes[j]) |
$el: $(mutation.addedNodes[j]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
new MutationObserver(mutationObserverCallback).observe( |
new MutationObserver(mutationObserverCallback).observe( |
||||
$('body')[0], |
$('body')[0], |
||||
{ |
{ |
||||
subtree: true, |
subtree: true, |
||||
childList: true |
childList: true |
||||
} |
} |
||||
); |
); |
||||
|
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.ajax = function (userOptions) { |
abp.ajax = function (userOptions) { |
||||
userOptions = userOptions || {}; |
userOptions = userOptions || {}; |
||||
|
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
||||
|
|
||||
options.success = undefined; |
options.success = undefined; |
||||
options.error = undefined; |
options.error = undefined; |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$.ajax(options) |
$.ajax(options) |
||||
.done(function (data, textStatus, jqXHR) { |
.done(function (data, textStatus, jqXHR) { |
||||
$dfd.resolve(data); |
$dfd.resolve(data); |
||||
userOptions.success && userOptions.success(data); |
userOptions.success && userOptions.success(data); |
||||
}).fail(function (jqXHR) { |
}).fail(function (jqXHR) { |
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} else { |
} else { |
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} |
} |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
$.extend(abp.ajax, { |
$.extend(abp.ajax, { |
||||
defaultOpts: { |
defaultOpts: { |
||||
dataType: 'json', |
dataType: 'json', |
||||
type: 'POST', |
type: 'POST', |
||||
contentType: 'application/json', |
contentType: 'application/json', |
||||
headers: { |
headers: { |
||||
'X-Requested-With': 'XMLHttpRequest' |
'X-Requested-With': 'XMLHttpRequest' |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
defaultError: { |
defaultError: { |
||||
message: 'An error has occurred!', |
message: 'An error has occurred!', |
||||
details: 'Error detail not sent by server.' |
details: 'Error detail not sent by server.' |
||||
}, |
}, |
||||
|
|
||||
defaultError401: { |
defaultError401: { |
||||
message: 'You are not authenticated!', |
message: 'You are not authenticated!', |
||||
details: 'You should be authenticated (sign in) in order to perform this operation.' |
details: 'You should be authenticated (sign in) in order to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError403: { |
defaultError403: { |
||||
message: 'You are not authorized!', |
message: 'You are not authorized!', |
||||
details: 'You are not allowed to perform this operation.' |
details: 'You are not allowed to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError404: { |
defaultError404: { |
||||
message: 'Resource not found!', |
message: 'Resource not found!', |
||||
details: 'The resource requested could not found on the server.' |
details: 'The resource requested could not found on the server.' |
||||
}, |
}, |
||||
|
|
||||
logError: function (error) { |
logError: function (error) { |
||||
abp.log.error(error); |
abp.log.error(error); |
||||
}, |
}, |
||||
|
|
||||
showError: function (error) { |
showError: function (error) { |
||||
if (error.details) { |
if (error.details) { |
||||
return abp.message.error(error.details, error.message); |
return abp.message.error(error.details, error.message); |
||||
} else { |
} else { |
||||
return abp.message.error(error.message || abp.ajax.defaultError.message); |
return abp.message.error(error.message || abp.ajax.defaultError.message); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleTargetUrl: function (targetUrl) { |
handleTargetUrl: function (targetUrl) { |
||||
if (!targetUrl) { |
if (!targetUrl) { |
||||
location.href = abp.appPath; |
location.href = abp.appPath; |
||||
} else { |
} else { |
||||
location.href = targetUrl; |
location.href = targetUrl; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleErrorStatusCode: function (status) { |
handleErrorStatusCode: function (status) { |
||||
switch (status) { |
switch (status) { |
||||
case 401: |
case 401: |
||||
abp.ajax.handleUnAuthorizedRequest( |
abp.ajax.handleUnAuthorizedRequest( |
||||
abp.ajax.showError(abp.ajax.defaultError401), |
abp.ajax.showError(abp.ajax.defaultError401), |
||||
abp.appPath |
abp.appPath |
||||
); |
); |
||||
break; |
break; |
||||
case 403: |
case 403: |
||||
abp.ajax.showError(abp.ajax.defaultError403); |
abp.ajax.showError(abp.ajax.defaultError403); |
||||
break; |
break; |
||||
case 404: |
case 404: |
||||
abp.ajax.showError(abp.ajax.defaultError404); |
abp.ajax.showError(abp.ajax.defaultError404); |
||||
break; |
break; |
||||
default: |
default: |
||||
abp.ajax.showError(abp.ajax.defaultError); |
abp.ajax.showError(abp.ajax.defaultError); |
||||
break; |
break; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleErrorStatusCode(jqXHR.status); |
abp.ajax.handleErrorStatusCode(jqXHR.status); |
||||
} |
} |
||||
|
|
||||
$dfd.reject.apply(this, arguments); |
$dfd.reject.apply(this, arguments); |
||||
userOptions.error && userOptions.error.apply(this, arguments); |
userOptions.error && userOptions.error.apply(this, arguments); |
||||
}, |
}, |
||||
|
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
var messagePromise = null; |
var messagePromise = null; |
||||
|
|
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
||||
} |
} |
||||
|
|
||||
abp.ajax.logError(jqXHR.responseJSON.error); |
abp.ajax.logError(jqXHR.responseJSON.error); |
||||
|
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
||||
|
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
||||
if (messagePromise) { |
if (messagePromise) { |
||||
messagePromise.done(function () { |
messagePromise.done(function () { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
}); |
}); |
||||
} else { |
} else { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
blockUI: function (options) { |
blockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //block whole page
|
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy(); |
abp.ui.setBusy(); |
||||
} else { //block an element
|
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI); |
abp.ui.setBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
unblockUI: function (options) { |
unblockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //unblock whole page
|
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy(); |
abp.ui.clearBusy(); |
||||
} else { //unblock an element
|
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI); |
abp.ui.clearBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
ajaxSendHandler: function (event, request, settings) { |
ajaxSendHandler: function (event, request, settings) { |
||||
var token = abp.security.antiForgery.getToken(); |
var token = abp.security.antiForgery.getToken(); |
||||
if (!token) { |
if (!token) { |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
||||
} |
} |
||||
} |
} |
||||
}); |
}); |
||||
|
|
||||
$(document).ajaxSend(function (event, request, settings) { |
$(document).ajaxSend(function (event, request, settings) { |
||||
return abp.ajax.ajaxSendHandler(event, request, settings); |
return abp.ajax.ajaxSendHandler(event, request, settings); |
||||
}); |
}); |
||||
|
|
||||
abp.event.on('abp.configurationInitialized', function () { |
abp.event.on('abp.configurationInitialized', function () { |
||||
var l = abp.localization.getResource('AbpUi'); |
var l = abp.localization.getResource('AbpUi'); |
||||
|
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
||||
}); |
}); |
||||
|
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
|
||||
/* UrlStates enum */ |
/* UrlStates enum */ |
||||
var UrlStates = { |
var UrlStates = { |
||||
LOADING: 'LOADING', |
LOADING: 'LOADING', |
||||
LOADED: 'LOADED', |
LOADED: 'LOADED', |
||||
FAILED: 'FAILED' |
FAILED: 'FAILED' |
||||
}; |
}; |
||||
|
|
||||
/* UrlInfo class */ |
/* UrlInfo class */ |
||||
function UrlInfo(url) { |
function UrlInfo(url) { |
||||
this.url = url; |
this.url = url; |
||||
this.state = UrlStates.LOADING; |
this.state = UrlStates.LOADING; |
||||
this.loadCallbacks = []; |
this.loadCallbacks = []; |
||||
this.failCallbacks = []; |
this.failCallbacks = []; |
||||
} |
} |
||||
|
|
||||
UrlInfo.prototype.succeed = function () { |
UrlInfo.prototype.succeed = function () { |
||||
this.state = UrlStates.LOADED; |
this.state = UrlStates.LOADED; |
||||
for (var i = 0; i < this.loadCallbacks.length; i++) { |
for (var i = 0; i < this.loadCallbacks.length; i++) { |
||||
this.loadCallbacks[i](); |
this.loadCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.failed = function () { |
UrlInfo.prototype.failed = function () { |
||||
this.state = UrlStates.FAILED; |
this.state = UrlStates.FAILED; |
||||
for (var i = 0; i < this.failCallbacks.length; i++) { |
for (var i = 0; i < this.failCallbacks.length; i++) { |
||||
this.failCallbacks[i](); |
this.failCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
||||
switch (this.state) { |
switch (this.state) { |
||||
case UrlStates.LOADED: |
case UrlStates.LOADED: |
||||
loadCallback && loadCallback(); |
loadCallback && loadCallback(); |
||||
break; |
break; |
||||
case UrlStates.FAILED: |
case UrlStates.FAILED: |
||||
failCallback && failCallback(); |
failCallback && failCallback(); |
||||
break; |
break; |
||||
case UrlStates.LOADING: |
case UrlStates.LOADING: |
||||
this.addCallbacks(loadCallback, failCallback); |
this.addCallbacks(loadCallback, failCallback); |
||||
break; |
break; |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
||||
loadCallback && this.loadCallbacks.push(loadCallback); |
loadCallback && this.loadCallbacks.push(loadCallback); |
||||
failCallback && this.failCallbacks.push(failCallback); |
failCallback && this.failCallbacks.push(failCallback); |
||||
}; |
}; |
||||
|
|
||||
/* ResourceLoader API */ |
/* ResourceLoader API */ |
||||
|
|
||||
abp.ResourceLoader = (function () { |
abp.ResourceLoader = (function () { |
||||
|
|
||||
var _urlInfos = {}; |
var _urlInfos = {}; |
||||
|
|
||||
function getCacheKey(url) { |
function getCacheKey(url) { |
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
function appendTimeToUrl(url) { |
function appendTimeToUrl(url) { |
||||
|
|
||||
if (url.indexOf('?') < 0) { |
if (url.indexOf('?') < 0) { |
||||
url += '?'; |
url += '?'; |
||||
} else { |
} else { |
||||
url += '&'; |
url += '&'; |
||||
} |
} |
||||
|
|
||||
url += '_=' + new Date().getTime(); |
url += '_=' + new Date().getTime(); |
||||
|
|
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
||||
|
|
||||
var cacheKey = getCacheKey(url); |
var cacheKey = getCacheKey(url); |
||||
|
|
||||
var urlInfo = _urlInfos[cacheKey]; |
var urlInfo = _urlInfos[cacheKey]; |
||||
|
|
||||
if (urlInfo) { |
if (urlInfo) { |
||||
urlInfo.handleCallbacks(loadCallback, failCallback); |
urlInfo.handleCallbacks(loadCallback, failCallback); |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
||||
urlInfo.addCallbacks(loadCallback, failCallback); |
urlInfo.addCallbacks(loadCallback, failCallback); |
||||
|
|
||||
serverLoader(urlInfo); |
serverLoader(urlInfo); |
||||
}; |
}; |
||||
|
|
||||
var _loadScript = function (url, loadCallback, failCallback) { |
var _loadScript = function (url, loadCallback, failCallback) { |
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
||||
$.getScript(url) |
$.getScript(url) |
||||
.done(function () { |
.done(function () { |
||||
urlInfo.succeed(); |
urlInfo.succeed(); |
||||
}) |
}) |
||||
.fail(function () { |
.fail(function () { |
||||
urlInfo.failed(); |
urlInfo.failed(); |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
var _loadStyle = function (url) { |
var _loadStyle = function (url) { |
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
||||
|
|
||||
$('<link/>', { |
$('<link/>', { |
||||
rel: 'stylesheet', |
rel: 'stylesheet', |
||||
type: 'text/css', |
type: 'text/css', |
||||
href: appendTimeToUrl(url) |
href: appendTimeToUrl(url) |
||||
}).appendTo('head'); |
}).appendTo('head'); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
return { |
return { |
||||
loadScript: _loadScript, |
loadScript: _loadScript, |
||||
loadStyle: _loadStyle |
loadStyle: _loadStyle |
||||
} |
} |
||||
})(); |
})(); |
||||
|
|
||||
})(jQuery); |
})(jQuery); |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,37 +1,37 @@ |
|||||
{ |
{ |
||||
"name": "malihu-custom-scrollbar-plugin", |
"name": "malihu-custom-scrollbar-plugin", |
||||
"version": "3.1.5", |
"version": "3.1.5", |
||||
"author": "malihu (http://manos.malihu.gr)", |
"author": "malihu (http://manos.malihu.gr)", |
||||
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
||||
"license": "MIT", |
"license": "MIT", |
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
||||
"main": "./jquery.mCustomScrollbar.js", |
"main": "./jquery.mCustomScrollbar.js", |
||||
"repository": { |
"repository": { |
||||
"type": "git", |
"type": "git", |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
||||
}, |
}, |
||||
"bugs": { |
"bugs": { |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
||||
}, |
}, |
||||
"keywords": [ |
"keywords": [ |
||||
"jquery-plugin", |
"jquery-plugin", |
||||
"custom-scrollbar", |
"custom-scrollbar", |
||||
"scrollbar" |
"scrollbar" |
||||
], |
], |
||||
"files": [ |
"files": [ |
||||
"jquery.mCustomScrollbar.js", |
"jquery.mCustomScrollbar.js", |
||||
"jquery.mCustomScrollbar.concat.min.js", |
"jquery.mCustomScrollbar.concat.min.js", |
||||
"jquery.mCustomScrollbar.css", |
"jquery.mCustomScrollbar.css", |
||||
"mCSB_buttons.png", |
"mCSB_buttons.png", |
||||
"readme.md" |
"readme.md" |
||||
], |
], |
||||
"jam": { |
"jam": { |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery": ">=1.6", |
"jquery": ">=1.6", |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
}, |
}, |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
} |
} |
||||
@ -1,82 +1,82 @@ |
|||||
malihu custom scrollbar plugin |
malihu custom scrollbar plugin |
||||
================================ |
================================ |
||||
|
|
||||
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
||||
|
|
||||
* Vertical and/or horizontal scrollbar(s) |
* Vertical and/or horizontal scrollbar(s) |
||||
* Adjustable scrolling momentum |
* Adjustable scrolling momentum |
||||
* Mouse-wheel, keyboard and touch support |
* Mouse-wheel, keyboard and touch support |
||||
* Ready-to-use themes and customization via CSS |
* Ready-to-use themes and customization via CSS |
||||
* RTL direction support |
* RTL direction support |
||||
* Option parameters for full control of scrollbar functionality |
* Option parameters for full control of scrollbar functionality |
||||
* Methods for triggering actions like scroll-to, update, destroy etc. |
* Methods for triggering actions like scroll-to, update, destroy etc. |
||||
* User-defined callbacks |
* User-defined callbacks |
||||
* Selectable/searchable content |
* Selectable/searchable content |
||||
|
|
||||
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
||||
|
|
||||
#### Installation |
#### Installation |
||||
|
|
||||
npm: `npm install malihu-custom-scrollbar-plugin` |
npm: `npm install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin` |
Bower: `bower install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
||||
|
|
||||
#### Usage |
#### Usage |
||||
|
|
||||
Manual: `$(selector).mCustomScrollbar();` |
Manual: `$(selector).mCustomScrollbar();` |
||||
|
|
||||
[Browserify](http://browserify.org/): |
[Browserify](http://browserify.org/): |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
[webpack](https://webpack.github.io/): |
[webpack](https://webpack.github.io/): |
||||
|
|
||||
npm install imports-loader |
npm install imports-loader |
||||
npm install jquery-mousewheel |
npm install jquery-mousewheel |
||||
npm install malihu-custom-scrollbar-plugin |
npm install malihu-custom-scrollbar-plugin |
||||
|
|
||||
module.exports = { |
module.exports = { |
||||
module: { |
module: { |
||||
loaders: [ |
loaders: [ |
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
||||
] |
] |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require("jquery-mousewheel")($); |
require("jquery-mousewheel")($); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
|
|
||||
Requirements |
Requirements |
||||
------------------------- |
------------------------- |
||||
|
|
||||
jQuery version **1.6.0** or higher |
jQuery version **1.6.0** or higher |
||||
|
|
||||
Browser compatibility |
Browser compatibility |
||||
------------------------- |
------------------------- |
||||
|
|
||||
* Internet Explorer 8+ |
* Internet Explorer 8+ |
||||
* Firefox |
* Firefox |
||||
* Chrome |
* Chrome |
||||
* Opera |
* Opera |
||||
* Safari |
* Safari |
||||
* iOS |
* iOS |
||||
* Android |
* Android |
||||
* Windows Phone |
* Windows Phone |
||||
|
|
||||
License |
License |
||||
------------------------- |
------------------------- |
||||
|
|
||||
MIT License (MIT) |
MIT License (MIT) |
||||
|
|
||||
http://opensource.org/licenses/MIT |
http://opensource.org/licenses/MIT |
||||
|
|
||||
Donate |
Donate |
||||
------------------------- |
------------------------- |
||||
|
|
||||
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
||||
@ -1,8 +0,0 @@ |
|||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
|
||||
# yarn lockfile v1 |
|
||||
|
|
||||
|
|
||||
jquery-mousewheel@>=3.0.6: |
|
||||
version "3.1.13" |
|
||||
resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.1.13.tgz#06f0335f16e353a695e7206bf50503cb523a6ee5" |
|
||||
integrity sha1-BvAzXxbjU6aV5yBr9QUDy1I6buU= |
|
||||
@ -1,56 +1,56 @@ |
|||||
@keyframes spin { |
@keyframes spin { |
||||
0% { |
0% { |
||||
transform: translateZ(0) rotate(0deg); |
transform: translateZ(0) rotate(0deg); |
||||
} |
} |
||||
|
|
||||
100% { |
100% { |
||||
transform: translateZ(0) rotate(360deg); |
transform: translateZ(0) rotate(360deg); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.abp-block-area { |
.abp-block-area { |
||||
position: fixed; |
position: fixed; |
||||
top: 0; |
top: 0; |
||||
left: 0; |
left: 0; |
||||
width: 100%; |
width: 100%; |
||||
height: 100%; |
height: 100%; |
||||
z-index: 102; |
z-index: 102; |
||||
background-color: #fff; |
background-color: #fff; |
||||
opacity: .8; |
opacity: .8; |
||||
transition: opacity .25s; |
transition: opacity .25s; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-disappearing { |
.abp-block-area.abp-block-area-disappearing { |
||||
opacity: 0; |
opacity: 0; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:after { |
.abp-block-area.abp-block-area-busy:after { |
||||
content: attr(data-text); |
content: attr(data-text); |
||||
display: block; |
display: block; |
||||
max-width: 125px; |
max-width: 125px; |
||||
position: absolute; |
position: absolute; |
||||
top: 50%; |
top: 50%; |
||||
left: 50%; |
left: 50%; |
||||
transform: translate(-50%, -50%); |
transform: translate(-50%, -50%); |
||||
font-size: 20px; |
font-size: 20px; |
||||
font-family: sans-serif; |
font-family: sans-serif; |
||||
color: #343a40; |
color: #343a40; |
||||
text-align: center; |
text-align: center; |
||||
text-transform: uppercase; |
text-transform: uppercase; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:before { |
.abp-block-area.abp-block-area-busy:before { |
||||
content: ""; |
content: ""; |
||||
display: block; |
display: block; |
||||
width: 150px; |
width: 150px; |
||||
height: 150px; |
height: 150px; |
||||
border-radius: 50%; |
border-radius: 50%; |
||||
border-width: 2px; |
border-width: 2px; |
||||
border-style: solid; |
border-style: solid; |
||||
border-color: transparent #228ae6 #228ae6 #228ae6; |
border-color: transparent #228ae6 #228ae6 #228ae6; |
||||
position: absolute; |
position: absolute; |
||||
top: calc(50% - 75px); |
top: calc(50% - 75px); |
||||
left: calc(50% - 75px); |
left: calc(50% - 75px); |
||||
will-change: transform; |
will-change: transform; |
||||
animation: spin .75s infinite ease-in-out; |
animation: spin .75s infinite ease-in-out; |
||||
} |
} |
||||
|
|||||
File diff suppressed because it is too large
@ -1,389 +1,389 @@ |
|||||
var abp = abp || {}; |
var abp = abp || {}; |
||||
(function($) { |
(function($) { |
||||
|
|
||||
if (!$) { |
if (!$) { |
||||
throw "abp/jquery library requires the jquery library included to the page!"; |
throw "abp/jquery library requires the jquery library included to the page!"; |
||||
} |
} |
||||
|
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
|
||||
abp.message._showMessage = function (message, title) { |
abp.message._showMessage = function (message, title) { |
||||
alert((title || '') + ' ' + message); |
alert((title || '') + ' ' + message); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(); |
$dfd.resolve(); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) { |
abp.message.confirm = function (message, titleOrCallback, callback) { |
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
||||
callback = titleOrCallback; |
callback = titleOrCallback; |
||||
} |
} |
||||
|
|
||||
var result = confirm(message); |
var result = confirm(message); |
||||
callback && callback(result); |
callback && callback(result); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(result); |
$dfd.resolve(result); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.utils.isFunction = function (obj) { |
abp.utils.isFunction = function (obj) { |
||||
return $.isFunction(obj); |
return $.isFunction(obj); |
||||
}; |
}; |
||||
|
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
|
||||
$.fn.findWithSelf = function (selector) { |
$.fn.findWithSelf = function (selector) { |
||||
return this.filter(selector).add(this.find(selector)); |
return this.filter(selector).add(this.find(selector)); |
||||
}; |
}; |
||||
|
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.dom = abp.dom || {}; |
abp.dom = abp.dom || {}; |
||||
|
|
||||
abp.dom.onNodeAdded = function (callback) { |
abp.dom.onNodeAdded = function (callback) { |
||||
abp.event.on('abp.dom.nodeAdded', callback); |
abp.event.on('abp.dom.nodeAdded', callback); |
||||
}; |
}; |
||||
|
|
||||
abp.dom.onNodeRemoved = function (callback) { |
abp.dom.onNodeRemoved = function (callback) { |
||||
abp.event.on('abp.dom.nodeRemoved', callback); |
abp.event.on('abp.dom.nodeRemoved', callback); |
||||
}; |
}; |
||||
|
|
||||
var mutationObserverCallback = function (mutationsList) { |
var mutationObserverCallback = function (mutationsList) { |
||||
for (var i = 0; i < mutationsList.length; i++) { |
for (var i = 0; i < mutationsList.length; i++) { |
||||
var mutation = mutationsList[i]; |
var mutation = mutationsList[i]; |
||||
if (mutation.type === 'childList') { |
if (mutation.type === 'childList') { |
||||
if (mutation.addedNodes && mutation.removedNodes.length) { |
if (mutation.addedNodes && mutation.removedNodes.length) { |
||||
for (var k = 0; k < mutation.removedNodes.length; k++) { |
for (var k = 0; k < mutation.removedNodes.length; k++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeRemoved', |
'abp.dom.nodeRemoved', |
||||
{ |
{ |
||||
$el: $(mutation.removedNodes[k]) |
$el: $(mutation.removedNodes[k]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) { |
if (mutation.addedNodes && mutation.addedNodes.length) { |
||||
for (var j = 0; j < mutation.addedNodes.length; j++) { |
for (var j = 0; j < mutation.addedNodes.length; j++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeAdded', |
'abp.dom.nodeAdded', |
||||
{ |
{ |
||||
$el: $(mutation.addedNodes[j]) |
$el: $(mutation.addedNodes[j]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
new MutationObserver(mutationObserverCallback).observe( |
new MutationObserver(mutationObserverCallback).observe( |
||||
$('body')[0], |
$('body')[0], |
||||
{ |
{ |
||||
subtree: true, |
subtree: true, |
||||
childList: true |
childList: true |
||||
} |
} |
||||
); |
); |
||||
|
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.ajax = function (userOptions) { |
abp.ajax = function (userOptions) { |
||||
userOptions = userOptions || {}; |
userOptions = userOptions || {}; |
||||
|
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
||||
|
|
||||
options.success = undefined; |
options.success = undefined; |
||||
options.error = undefined; |
options.error = undefined; |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$.ajax(options) |
$.ajax(options) |
||||
.done(function (data, textStatus, jqXHR) { |
.done(function (data, textStatus, jqXHR) { |
||||
$dfd.resolve(data); |
$dfd.resolve(data); |
||||
userOptions.success && userOptions.success(data); |
userOptions.success && userOptions.success(data); |
||||
}).fail(function (jqXHR) { |
}).fail(function (jqXHR) { |
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} else { |
} else { |
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} |
} |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
$.extend(abp.ajax, { |
$.extend(abp.ajax, { |
||||
defaultOpts: { |
defaultOpts: { |
||||
dataType: 'json', |
dataType: 'json', |
||||
type: 'POST', |
type: 'POST', |
||||
contentType: 'application/json', |
contentType: 'application/json', |
||||
headers: { |
headers: { |
||||
'X-Requested-With': 'XMLHttpRequest' |
'X-Requested-With': 'XMLHttpRequest' |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
defaultError: { |
defaultError: { |
||||
message: 'An error has occurred!', |
message: 'An error has occurred!', |
||||
details: 'Error detail not sent by server.' |
details: 'Error detail not sent by server.' |
||||
}, |
}, |
||||
|
|
||||
defaultError401: { |
defaultError401: { |
||||
message: 'You are not authenticated!', |
message: 'You are not authenticated!', |
||||
details: 'You should be authenticated (sign in) in order to perform this operation.' |
details: 'You should be authenticated (sign in) in order to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError403: { |
defaultError403: { |
||||
message: 'You are not authorized!', |
message: 'You are not authorized!', |
||||
details: 'You are not allowed to perform this operation.' |
details: 'You are not allowed to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError404: { |
defaultError404: { |
||||
message: 'Resource not found!', |
message: 'Resource not found!', |
||||
details: 'The resource requested could not found on the server.' |
details: 'The resource requested could not found on the server.' |
||||
}, |
}, |
||||
|
|
||||
logError: function (error) { |
logError: function (error) { |
||||
abp.log.error(error); |
abp.log.error(error); |
||||
}, |
}, |
||||
|
|
||||
showError: function (error) { |
showError: function (error) { |
||||
if (error.details) { |
if (error.details) { |
||||
return abp.message.error(error.details, error.message); |
return abp.message.error(error.details, error.message); |
||||
} else { |
} else { |
||||
return abp.message.error(error.message || abp.ajax.defaultError.message); |
return abp.message.error(error.message || abp.ajax.defaultError.message); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleTargetUrl: function (targetUrl) { |
handleTargetUrl: function (targetUrl) { |
||||
if (!targetUrl) { |
if (!targetUrl) { |
||||
location.href = abp.appPath; |
location.href = abp.appPath; |
||||
} else { |
} else { |
||||
location.href = targetUrl; |
location.href = targetUrl; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleErrorStatusCode: function (status) { |
handleErrorStatusCode: function (status) { |
||||
switch (status) { |
switch (status) { |
||||
case 401: |
case 401: |
||||
abp.ajax.handleUnAuthorizedRequest( |
abp.ajax.handleUnAuthorizedRequest( |
||||
abp.ajax.showError(abp.ajax.defaultError401), |
abp.ajax.showError(abp.ajax.defaultError401), |
||||
abp.appPath |
abp.appPath |
||||
); |
); |
||||
break; |
break; |
||||
case 403: |
case 403: |
||||
abp.ajax.showError(abp.ajax.defaultError403); |
abp.ajax.showError(abp.ajax.defaultError403); |
||||
break; |
break; |
||||
case 404: |
case 404: |
||||
abp.ajax.showError(abp.ajax.defaultError404); |
abp.ajax.showError(abp.ajax.defaultError404); |
||||
break; |
break; |
||||
default: |
default: |
||||
abp.ajax.showError(abp.ajax.defaultError); |
abp.ajax.showError(abp.ajax.defaultError); |
||||
break; |
break; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleErrorStatusCode(jqXHR.status); |
abp.ajax.handleErrorStatusCode(jqXHR.status); |
||||
} |
} |
||||
|
|
||||
$dfd.reject.apply(this, arguments); |
$dfd.reject.apply(this, arguments); |
||||
userOptions.error && userOptions.error.apply(this, arguments); |
userOptions.error && userOptions.error.apply(this, arguments); |
||||
}, |
}, |
||||
|
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
var messagePromise = null; |
var messagePromise = null; |
||||
|
|
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
||||
} |
} |
||||
|
|
||||
abp.ajax.logError(jqXHR.responseJSON.error); |
abp.ajax.logError(jqXHR.responseJSON.error); |
||||
|
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
||||
|
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
||||
if (messagePromise) { |
if (messagePromise) { |
||||
messagePromise.done(function () { |
messagePromise.done(function () { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
}); |
}); |
||||
} else { |
} else { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
blockUI: function (options) { |
blockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //block whole page
|
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy(); |
abp.ui.setBusy(); |
||||
} else { //block an element
|
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI); |
abp.ui.setBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
unblockUI: function (options) { |
unblockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //unblock whole page
|
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy(); |
abp.ui.clearBusy(); |
||||
} else { //unblock an element
|
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI); |
abp.ui.clearBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
ajaxSendHandler: function (event, request, settings) { |
ajaxSendHandler: function (event, request, settings) { |
||||
var token = abp.security.antiForgery.getToken(); |
var token = abp.security.antiForgery.getToken(); |
||||
if (!token) { |
if (!token) { |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
||||
} |
} |
||||
} |
} |
||||
}); |
}); |
||||
|
|
||||
$(document).ajaxSend(function (event, request, settings) { |
$(document).ajaxSend(function (event, request, settings) { |
||||
return abp.ajax.ajaxSendHandler(event, request, settings); |
return abp.ajax.ajaxSendHandler(event, request, settings); |
||||
}); |
}); |
||||
|
|
||||
abp.event.on('abp.configurationInitialized', function () { |
abp.event.on('abp.configurationInitialized', function () { |
||||
var l = abp.localization.getResource('AbpUi'); |
var l = abp.localization.getResource('AbpUi'); |
||||
|
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
||||
}); |
}); |
||||
|
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
|
||||
/* UrlStates enum */ |
/* UrlStates enum */ |
||||
var UrlStates = { |
var UrlStates = { |
||||
LOADING: 'LOADING', |
LOADING: 'LOADING', |
||||
LOADED: 'LOADED', |
LOADED: 'LOADED', |
||||
FAILED: 'FAILED' |
FAILED: 'FAILED' |
||||
}; |
}; |
||||
|
|
||||
/* UrlInfo class */ |
/* UrlInfo class */ |
||||
function UrlInfo(url) { |
function UrlInfo(url) { |
||||
this.url = url; |
this.url = url; |
||||
this.state = UrlStates.LOADING; |
this.state = UrlStates.LOADING; |
||||
this.loadCallbacks = []; |
this.loadCallbacks = []; |
||||
this.failCallbacks = []; |
this.failCallbacks = []; |
||||
} |
} |
||||
|
|
||||
UrlInfo.prototype.succeed = function () { |
UrlInfo.prototype.succeed = function () { |
||||
this.state = UrlStates.LOADED; |
this.state = UrlStates.LOADED; |
||||
for (var i = 0; i < this.loadCallbacks.length; i++) { |
for (var i = 0; i < this.loadCallbacks.length; i++) { |
||||
this.loadCallbacks[i](); |
this.loadCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.failed = function () { |
UrlInfo.prototype.failed = function () { |
||||
this.state = UrlStates.FAILED; |
this.state = UrlStates.FAILED; |
||||
for (var i = 0; i < this.failCallbacks.length; i++) { |
for (var i = 0; i < this.failCallbacks.length; i++) { |
||||
this.failCallbacks[i](); |
this.failCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
||||
switch (this.state) { |
switch (this.state) { |
||||
case UrlStates.LOADED: |
case UrlStates.LOADED: |
||||
loadCallback && loadCallback(); |
loadCallback && loadCallback(); |
||||
break; |
break; |
||||
case UrlStates.FAILED: |
case UrlStates.FAILED: |
||||
failCallback && failCallback(); |
failCallback && failCallback(); |
||||
break; |
break; |
||||
case UrlStates.LOADING: |
case UrlStates.LOADING: |
||||
this.addCallbacks(loadCallback, failCallback); |
this.addCallbacks(loadCallback, failCallback); |
||||
break; |
break; |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
||||
loadCallback && this.loadCallbacks.push(loadCallback); |
loadCallback && this.loadCallbacks.push(loadCallback); |
||||
failCallback && this.failCallbacks.push(failCallback); |
failCallback && this.failCallbacks.push(failCallback); |
||||
}; |
}; |
||||
|
|
||||
/* ResourceLoader API */ |
/* ResourceLoader API */ |
||||
|
|
||||
abp.ResourceLoader = (function () { |
abp.ResourceLoader = (function () { |
||||
|
|
||||
var _urlInfos = {}; |
var _urlInfos = {}; |
||||
|
|
||||
function getCacheKey(url) { |
function getCacheKey(url) { |
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
function appendTimeToUrl(url) { |
function appendTimeToUrl(url) { |
||||
|
|
||||
if (url.indexOf('?') < 0) { |
if (url.indexOf('?') < 0) { |
||||
url += '?'; |
url += '?'; |
||||
} else { |
} else { |
||||
url += '&'; |
url += '&'; |
||||
} |
} |
||||
|
|
||||
url += '_=' + new Date().getTime(); |
url += '_=' + new Date().getTime(); |
||||
|
|
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
||||
|
|
||||
var cacheKey = getCacheKey(url); |
var cacheKey = getCacheKey(url); |
||||
|
|
||||
var urlInfo = _urlInfos[cacheKey]; |
var urlInfo = _urlInfos[cacheKey]; |
||||
|
|
||||
if (urlInfo) { |
if (urlInfo) { |
||||
urlInfo.handleCallbacks(loadCallback, failCallback); |
urlInfo.handleCallbacks(loadCallback, failCallback); |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
||||
urlInfo.addCallbacks(loadCallback, failCallback); |
urlInfo.addCallbacks(loadCallback, failCallback); |
||||
|
|
||||
serverLoader(urlInfo); |
serverLoader(urlInfo); |
||||
}; |
}; |
||||
|
|
||||
var _loadScript = function (url, loadCallback, failCallback) { |
var _loadScript = function (url, loadCallback, failCallback) { |
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
||||
$.getScript(url) |
$.getScript(url) |
||||
.done(function () { |
.done(function () { |
||||
urlInfo.succeed(); |
urlInfo.succeed(); |
||||
}) |
}) |
||||
.fail(function () { |
.fail(function () { |
||||
urlInfo.failed(); |
urlInfo.failed(); |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
var _loadStyle = function (url) { |
var _loadStyle = function (url) { |
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
||||
|
|
||||
$('<link/>', { |
$('<link/>', { |
||||
rel: 'stylesheet', |
rel: 'stylesheet', |
||||
type: 'text/css', |
type: 'text/css', |
||||
href: appendTimeToUrl(url) |
href: appendTimeToUrl(url) |
||||
}).appendTo('head'); |
}).appendTo('head'); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
return { |
return { |
||||
loadScript: _loadScript, |
loadScript: _loadScript, |
||||
loadStyle: _loadStyle |
loadStyle: _loadStyle |
||||
} |
} |
||||
})(); |
})(); |
||||
|
|
||||
})(jQuery); |
})(jQuery); |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,37 +1,37 @@ |
|||||
{ |
{ |
||||
"name": "malihu-custom-scrollbar-plugin", |
"name": "malihu-custom-scrollbar-plugin", |
||||
"version": "3.1.5", |
"version": "3.1.5", |
||||
"author": "malihu (http://manos.malihu.gr)", |
"author": "malihu (http://manos.malihu.gr)", |
||||
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
||||
"license": "MIT", |
"license": "MIT", |
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
||||
"main": "./jquery.mCustomScrollbar.js", |
"main": "./jquery.mCustomScrollbar.js", |
||||
"repository": { |
"repository": { |
||||
"type": "git", |
"type": "git", |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
||||
}, |
}, |
||||
"bugs": { |
"bugs": { |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
||||
}, |
}, |
||||
"keywords": [ |
"keywords": [ |
||||
"jquery-plugin", |
"jquery-plugin", |
||||
"custom-scrollbar", |
"custom-scrollbar", |
||||
"scrollbar" |
"scrollbar" |
||||
], |
], |
||||
"files": [ |
"files": [ |
||||
"jquery.mCustomScrollbar.js", |
"jquery.mCustomScrollbar.js", |
||||
"jquery.mCustomScrollbar.concat.min.js", |
"jquery.mCustomScrollbar.concat.min.js", |
||||
"jquery.mCustomScrollbar.css", |
"jquery.mCustomScrollbar.css", |
||||
"mCSB_buttons.png", |
"mCSB_buttons.png", |
||||
"readme.md" |
"readme.md" |
||||
], |
], |
||||
"jam": { |
"jam": { |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery": ">=1.6", |
"jquery": ">=1.6", |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
}, |
}, |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
} |
} |
||||
@ -1,82 +1,82 @@ |
|||||
malihu custom scrollbar plugin |
malihu custom scrollbar plugin |
||||
================================ |
================================ |
||||
|
|
||||
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
||||
|
|
||||
* Vertical and/or horizontal scrollbar(s) |
* Vertical and/or horizontal scrollbar(s) |
||||
* Adjustable scrolling momentum |
* Adjustable scrolling momentum |
||||
* Mouse-wheel, keyboard and touch support |
* Mouse-wheel, keyboard and touch support |
||||
* Ready-to-use themes and customization via CSS |
* Ready-to-use themes and customization via CSS |
||||
* RTL direction support |
* RTL direction support |
||||
* Option parameters for full control of scrollbar functionality |
* Option parameters for full control of scrollbar functionality |
||||
* Methods for triggering actions like scroll-to, update, destroy etc. |
* Methods for triggering actions like scroll-to, update, destroy etc. |
||||
* User-defined callbacks |
* User-defined callbacks |
||||
* Selectable/searchable content |
* Selectable/searchable content |
||||
|
|
||||
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
||||
|
|
||||
#### Installation |
#### Installation |
||||
|
|
||||
npm: `npm install malihu-custom-scrollbar-plugin` |
npm: `npm install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin` |
Bower: `bower install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
||||
|
|
||||
#### Usage |
#### Usage |
||||
|
|
||||
Manual: `$(selector).mCustomScrollbar();` |
Manual: `$(selector).mCustomScrollbar();` |
||||
|
|
||||
[Browserify](http://browserify.org/): |
[Browserify](http://browserify.org/): |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
[webpack](https://webpack.github.io/): |
[webpack](https://webpack.github.io/): |
||||
|
|
||||
npm install imports-loader |
npm install imports-loader |
||||
npm install jquery-mousewheel |
npm install jquery-mousewheel |
||||
npm install malihu-custom-scrollbar-plugin |
npm install malihu-custom-scrollbar-plugin |
||||
|
|
||||
module.exports = { |
module.exports = { |
||||
module: { |
module: { |
||||
loaders: [ |
loaders: [ |
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
||||
] |
] |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require("jquery-mousewheel")($); |
require("jquery-mousewheel")($); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
|
|
||||
Requirements |
Requirements |
||||
------------------------- |
------------------------- |
||||
|
|
||||
jQuery version **1.6.0** or higher |
jQuery version **1.6.0** or higher |
||||
|
|
||||
Browser compatibility |
Browser compatibility |
||||
------------------------- |
------------------------- |
||||
|
|
||||
* Internet Explorer 8+ |
* Internet Explorer 8+ |
||||
* Firefox |
* Firefox |
||||
* Chrome |
* Chrome |
||||
* Opera |
* Opera |
||||
* Safari |
* Safari |
||||
* iOS |
* iOS |
||||
* Android |
* Android |
||||
* Windows Phone |
* Windows Phone |
||||
|
|
||||
License |
License |
||||
------------------------- |
------------------------- |
||||
|
|
||||
MIT License (MIT) |
MIT License (MIT) |
||||
|
|
||||
http://opensource.org/licenses/MIT |
http://opensource.org/licenses/MIT |
||||
|
|
||||
Donate |
Donate |
||||
------------------------- |
------------------------- |
||||
|
|
||||
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
||||
@ -1,8 +0,0 @@ |
|||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
|
||||
# yarn lockfile v1 |
|
||||
|
|
||||
|
|
||||
jquery-mousewheel@>=3.0.6: |
|
||||
version "3.1.13" |
|
||||
resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.1.13.tgz#06f0335f16e353a695e7206bf50503cb523a6ee5" |
|
||||
integrity sha1-BvAzXxbjU6aV5yBr9QUDy1I6buU= |
|
||||
@ -1,56 +1,56 @@ |
|||||
@keyframes spin { |
@keyframes spin { |
||||
0% { |
0% { |
||||
transform: translateZ(0) rotate(0deg); |
transform: translateZ(0) rotate(0deg); |
||||
} |
} |
||||
|
|
||||
100% { |
100% { |
||||
transform: translateZ(0) rotate(360deg); |
transform: translateZ(0) rotate(360deg); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.abp-block-area { |
.abp-block-area { |
||||
position: fixed; |
position: fixed; |
||||
top: 0; |
top: 0; |
||||
left: 0; |
left: 0; |
||||
width: 100%; |
width: 100%; |
||||
height: 100%; |
height: 100%; |
||||
z-index: 102; |
z-index: 102; |
||||
background-color: #fff; |
background-color: #fff; |
||||
opacity: .8; |
opacity: .8; |
||||
transition: opacity .25s; |
transition: opacity .25s; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-disappearing { |
.abp-block-area.abp-block-area-disappearing { |
||||
opacity: 0; |
opacity: 0; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:after { |
.abp-block-area.abp-block-area-busy:after { |
||||
content: attr(data-text); |
content: attr(data-text); |
||||
display: block; |
display: block; |
||||
max-width: 125px; |
max-width: 125px; |
||||
position: absolute; |
position: absolute; |
||||
top: 50%; |
top: 50%; |
||||
left: 50%; |
left: 50%; |
||||
transform: translate(-50%, -50%); |
transform: translate(-50%, -50%); |
||||
font-size: 20px; |
font-size: 20px; |
||||
font-family: sans-serif; |
font-family: sans-serif; |
||||
color: #343a40; |
color: #343a40; |
||||
text-align: center; |
text-align: center; |
||||
text-transform: uppercase; |
text-transform: uppercase; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:before { |
.abp-block-area.abp-block-area-busy:before { |
||||
content: ""; |
content: ""; |
||||
display: block; |
display: block; |
||||
width: 150px; |
width: 150px; |
||||
height: 150px; |
height: 150px; |
||||
border-radius: 50%; |
border-radius: 50%; |
||||
border-width: 2px; |
border-width: 2px; |
||||
border-style: solid; |
border-style: solid; |
||||
border-color: transparent #228ae6 #228ae6 #228ae6; |
border-color: transparent #228ae6 #228ae6 #228ae6; |
||||
position: absolute; |
position: absolute; |
||||
top: calc(50% - 75px); |
top: calc(50% - 75px); |
||||
left: calc(50% - 75px); |
left: calc(50% - 75px); |
||||
will-change: transform; |
will-change: transform; |
||||
animation: spin .75s infinite ease-in-out; |
animation: spin .75s infinite ease-in-out; |
||||
} |
} |
||||
|
|||||
File diff suppressed because it is too large
@ -1,389 +1,389 @@ |
|||||
var abp = abp || {}; |
var abp = abp || {}; |
||||
(function($) { |
(function($) { |
||||
|
|
||||
if (!$) { |
if (!$) { |
||||
throw "abp/jquery library requires the jquery library included to the page!"; |
throw "abp/jquery library requires the jquery library included to the page!"; |
||||
} |
} |
||||
|
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
|
||||
abp.message._showMessage = function (message, title) { |
abp.message._showMessage = function (message, title) { |
||||
alert((title || '') + ' ' + message); |
alert((title || '') + ' ' + message); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(); |
$dfd.resolve(); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) { |
abp.message.confirm = function (message, titleOrCallback, callback) { |
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
||||
callback = titleOrCallback; |
callback = titleOrCallback; |
||||
} |
} |
||||
|
|
||||
var result = confirm(message); |
var result = confirm(message); |
||||
callback && callback(result); |
callback && callback(result); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(result); |
$dfd.resolve(result); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.utils.isFunction = function (obj) { |
abp.utils.isFunction = function (obj) { |
||||
return $.isFunction(obj); |
return $.isFunction(obj); |
||||
}; |
}; |
||||
|
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
|
||||
$.fn.findWithSelf = function (selector) { |
$.fn.findWithSelf = function (selector) { |
||||
return this.filter(selector).add(this.find(selector)); |
return this.filter(selector).add(this.find(selector)); |
||||
}; |
}; |
||||
|
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.dom = abp.dom || {}; |
abp.dom = abp.dom || {}; |
||||
|
|
||||
abp.dom.onNodeAdded = function (callback) { |
abp.dom.onNodeAdded = function (callback) { |
||||
abp.event.on('abp.dom.nodeAdded', callback); |
abp.event.on('abp.dom.nodeAdded', callback); |
||||
}; |
}; |
||||
|
|
||||
abp.dom.onNodeRemoved = function (callback) { |
abp.dom.onNodeRemoved = function (callback) { |
||||
abp.event.on('abp.dom.nodeRemoved', callback); |
abp.event.on('abp.dom.nodeRemoved', callback); |
||||
}; |
}; |
||||
|
|
||||
var mutationObserverCallback = function (mutationsList) { |
var mutationObserverCallback = function (mutationsList) { |
||||
for (var i = 0; i < mutationsList.length; i++) { |
for (var i = 0; i < mutationsList.length; i++) { |
||||
var mutation = mutationsList[i]; |
var mutation = mutationsList[i]; |
||||
if (mutation.type === 'childList') { |
if (mutation.type === 'childList') { |
||||
if (mutation.addedNodes && mutation.removedNodes.length) { |
if (mutation.addedNodes && mutation.removedNodes.length) { |
||||
for (var k = 0; k < mutation.removedNodes.length; k++) { |
for (var k = 0; k < mutation.removedNodes.length; k++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeRemoved', |
'abp.dom.nodeRemoved', |
||||
{ |
{ |
||||
$el: $(mutation.removedNodes[k]) |
$el: $(mutation.removedNodes[k]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) { |
if (mutation.addedNodes && mutation.addedNodes.length) { |
||||
for (var j = 0; j < mutation.addedNodes.length; j++) { |
for (var j = 0; j < mutation.addedNodes.length; j++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeAdded', |
'abp.dom.nodeAdded', |
||||
{ |
{ |
||||
$el: $(mutation.addedNodes[j]) |
$el: $(mutation.addedNodes[j]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
new MutationObserver(mutationObserverCallback).observe( |
new MutationObserver(mutationObserverCallback).observe( |
||||
$('body')[0], |
$('body')[0], |
||||
{ |
{ |
||||
subtree: true, |
subtree: true, |
||||
childList: true |
childList: true |
||||
} |
} |
||||
); |
); |
||||
|
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.ajax = function (userOptions) { |
abp.ajax = function (userOptions) { |
||||
userOptions = userOptions || {}; |
userOptions = userOptions || {}; |
||||
|
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
||||
|
|
||||
options.success = undefined; |
options.success = undefined; |
||||
options.error = undefined; |
options.error = undefined; |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$.ajax(options) |
$.ajax(options) |
||||
.done(function (data, textStatus, jqXHR) { |
.done(function (data, textStatus, jqXHR) { |
||||
$dfd.resolve(data); |
$dfd.resolve(data); |
||||
userOptions.success && userOptions.success(data); |
userOptions.success && userOptions.success(data); |
||||
}).fail(function (jqXHR) { |
}).fail(function (jqXHR) { |
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} else { |
} else { |
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} |
} |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
$.extend(abp.ajax, { |
$.extend(abp.ajax, { |
||||
defaultOpts: { |
defaultOpts: { |
||||
dataType: 'json', |
dataType: 'json', |
||||
type: 'POST', |
type: 'POST', |
||||
contentType: 'application/json', |
contentType: 'application/json', |
||||
headers: { |
headers: { |
||||
'X-Requested-With': 'XMLHttpRequest' |
'X-Requested-With': 'XMLHttpRequest' |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
defaultError: { |
defaultError: { |
||||
message: 'An error has occurred!', |
message: 'An error has occurred!', |
||||
details: 'Error detail not sent by server.' |
details: 'Error detail not sent by server.' |
||||
}, |
}, |
||||
|
|
||||
defaultError401: { |
defaultError401: { |
||||
message: 'You are not authenticated!', |
message: 'You are not authenticated!', |
||||
details: 'You should be authenticated (sign in) in order to perform this operation.' |
details: 'You should be authenticated (sign in) in order to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError403: { |
defaultError403: { |
||||
message: 'You are not authorized!', |
message: 'You are not authorized!', |
||||
details: 'You are not allowed to perform this operation.' |
details: 'You are not allowed to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError404: { |
defaultError404: { |
||||
message: 'Resource not found!', |
message: 'Resource not found!', |
||||
details: 'The resource requested could not found on the server.' |
details: 'The resource requested could not found on the server.' |
||||
}, |
}, |
||||
|
|
||||
logError: function (error) { |
logError: function (error) { |
||||
abp.log.error(error); |
abp.log.error(error); |
||||
}, |
}, |
||||
|
|
||||
showError: function (error) { |
showError: function (error) { |
||||
if (error.details) { |
if (error.details) { |
||||
return abp.message.error(error.details, error.message); |
return abp.message.error(error.details, error.message); |
||||
} else { |
} else { |
||||
return abp.message.error(error.message || abp.ajax.defaultError.message); |
return abp.message.error(error.message || abp.ajax.defaultError.message); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleTargetUrl: function (targetUrl) { |
handleTargetUrl: function (targetUrl) { |
||||
if (!targetUrl) { |
if (!targetUrl) { |
||||
location.href = abp.appPath; |
location.href = abp.appPath; |
||||
} else { |
} else { |
||||
location.href = targetUrl; |
location.href = targetUrl; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleErrorStatusCode: function (status) { |
handleErrorStatusCode: function (status) { |
||||
switch (status) { |
switch (status) { |
||||
case 401: |
case 401: |
||||
abp.ajax.handleUnAuthorizedRequest( |
abp.ajax.handleUnAuthorizedRequest( |
||||
abp.ajax.showError(abp.ajax.defaultError401), |
abp.ajax.showError(abp.ajax.defaultError401), |
||||
abp.appPath |
abp.appPath |
||||
); |
); |
||||
break; |
break; |
||||
case 403: |
case 403: |
||||
abp.ajax.showError(abp.ajax.defaultError403); |
abp.ajax.showError(abp.ajax.defaultError403); |
||||
break; |
break; |
||||
case 404: |
case 404: |
||||
abp.ajax.showError(abp.ajax.defaultError404); |
abp.ajax.showError(abp.ajax.defaultError404); |
||||
break; |
break; |
||||
default: |
default: |
||||
abp.ajax.showError(abp.ajax.defaultError); |
abp.ajax.showError(abp.ajax.defaultError); |
||||
break; |
break; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleErrorStatusCode(jqXHR.status); |
abp.ajax.handleErrorStatusCode(jqXHR.status); |
||||
} |
} |
||||
|
|
||||
$dfd.reject.apply(this, arguments); |
$dfd.reject.apply(this, arguments); |
||||
userOptions.error && userOptions.error.apply(this, arguments); |
userOptions.error && userOptions.error.apply(this, arguments); |
||||
}, |
}, |
||||
|
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
var messagePromise = null; |
var messagePromise = null; |
||||
|
|
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
||||
} |
} |
||||
|
|
||||
abp.ajax.logError(jqXHR.responseJSON.error); |
abp.ajax.logError(jqXHR.responseJSON.error); |
||||
|
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
||||
|
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
||||
if (messagePromise) { |
if (messagePromise) { |
||||
messagePromise.done(function () { |
messagePromise.done(function () { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
}); |
}); |
||||
} else { |
} else { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
blockUI: function (options) { |
blockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //block whole page
|
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy(); |
abp.ui.setBusy(); |
||||
} else { //block an element
|
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI); |
abp.ui.setBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
unblockUI: function (options) { |
unblockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //unblock whole page
|
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy(); |
abp.ui.clearBusy(); |
||||
} else { //unblock an element
|
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI); |
abp.ui.clearBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
ajaxSendHandler: function (event, request, settings) { |
ajaxSendHandler: function (event, request, settings) { |
||||
var token = abp.security.antiForgery.getToken(); |
var token = abp.security.antiForgery.getToken(); |
||||
if (!token) { |
if (!token) { |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
||||
} |
} |
||||
} |
} |
||||
}); |
}); |
||||
|
|
||||
$(document).ajaxSend(function (event, request, settings) { |
$(document).ajaxSend(function (event, request, settings) { |
||||
return abp.ajax.ajaxSendHandler(event, request, settings); |
return abp.ajax.ajaxSendHandler(event, request, settings); |
||||
}); |
}); |
||||
|
|
||||
abp.event.on('abp.configurationInitialized', function () { |
abp.event.on('abp.configurationInitialized', function () { |
||||
var l = abp.localization.getResource('AbpUi'); |
var l = abp.localization.getResource('AbpUi'); |
||||
|
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
||||
}); |
}); |
||||
|
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
|
||||
/* UrlStates enum */ |
/* UrlStates enum */ |
||||
var UrlStates = { |
var UrlStates = { |
||||
LOADING: 'LOADING', |
LOADING: 'LOADING', |
||||
LOADED: 'LOADED', |
LOADED: 'LOADED', |
||||
FAILED: 'FAILED' |
FAILED: 'FAILED' |
||||
}; |
}; |
||||
|
|
||||
/* UrlInfo class */ |
/* UrlInfo class */ |
||||
function UrlInfo(url) { |
function UrlInfo(url) { |
||||
this.url = url; |
this.url = url; |
||||
this.state = UrlStates.LOADING; |
this.state = UrlStates.LOADING; |
||||
this.loadCallbacks = []; |
this.loadCallbacks = []; |
||||
this.failCallbacks = []; |
this.failCallbacks = []; |
||||
} |
} |
||||
|
|
||||
UrlInfo.prototype.succeed = function () { |
UrlInfo.prototype.succeed = function () { |
||||
this.state = UrlStates.LOADED; |
this.state = UrlStates.LOADED; |
||||
for (var i = 0; i < this.loadCallbacks.length; i++) { |
for (var i = 0; i < this.loadCallbacks.length; i++) { |
||||
this.loadCallbacks[i](); |
this.loadCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.failed = function () { |
UrlInfo.prototype.failed = function () { |
||||
this.state = UrlStates.FAILED; |
this.state = UrlStates.FAILED; |
||||
for (var i = 0; i < this.failCallbacks.length; i++) { |
for (var i = 0; i < this.failCallbacks.length; i++) { |
||||
this.failCallbacks[i](); |
this.failCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
||||
switch (this.state) { |
switch (this.state) { |
||||
case UrlStates.LOADED: |
case UrlStates.LOADED: |
||||
loadCallback && loadCallback(); |
loadCallback && loadCallback(); |
||||
break; |
break; |
||||
case UrlStates.FAILED: |
case UrlStates.FAILED: |
||||
failCallback && failCallback(); |
failCallback && failCallback(); |
||||
break; |
break; |
||||
case UrlStates.LOADING: |
case UrlStates.LOADING: |
||||
this.addCallbacks(loadCallback, failCallback); |
this.addCallbacks(loadCallback, failCallback); |
||||
break; |
break; |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
||||
loadCallback && this.loadCallbacks.push(loadCallback); |
loadCallback && this.loadCallbacks.push(loadCallback); |
||||
failCallback && this.failCallbacks.push(failCallback); |
failCallback && this.failCallbacks.push(failCallback); |
||||
}; |
}; |
||||
|
|
||||
/* ResourceLoader API */ |
/* ResourceLoader API */ |
||||
|
|
||||
abp.ResourceLoader = (function () { |
abp.ResourceLoader = (function () { |
||||
|
|
||||
var _urlInfos = {}; |
var _urlInfos = {}; |
||||
|
|
||||
function getCacheKey(url) { |
function getCacheKey(url) { |
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
function appendTimeToUrl(url) { |
function appendTimeToUrl(url) { |
||||
|
|
||||
if (url.indexOf('?') < 0) { |
if (url.indexOf('?') < 0) { |
||||
url += '?'; |
url += '?'; |
||||
} else { |
} else { |
||||
url += '&'; |
url += '&'; |
||||
} |
} |
||||
|
|
||||
url += '_=' + new Date().getTime(); |
url += '_=' + new Date().getTime(); |
||||
|
|
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
||||
|
|
||||
var cacheKey = getCacheKey(url); |
var cacheKey = getCacheKey(url); |
||||
|
|
||||
var urlInfo = _urlInfos[cacheKey]; |
var urlInfo = _urlInfos[cacheKey]; |
||||
|
|
||||
if (urlInfo) { |
if (urlInfo) { |
||||
urlInfo.handleCallbacks(loadCallback, failCallback); |
urlInfo.handleCallbacks(loadCallback, failCallback); |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
||||
urlInfo.addCallbacks(loadCallback, failCallback); |
urlInfo.addCallbacks(loadCallback, failCallback); |
||||
|
|
||||
serverLoader(urlInfo); |
serverLoader(urlInfo); |
||||
}; |
}; |
||||
|
|
||||
var _loadScript = function (url, loadCallback, failCallback) { |
var _loadScript = function (url, loadCallback, failCallback) { |
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
||||
$.getScript(url) |
$.getScript(url) |
||||
.done(function () { |
.done(function () { |
||||
urlInfo.succeed(); |
urlInfo.succeed(); |
||||
}) |
}) |
||||
.fail(function () { |
.fail(function () { |
||||
urlInfo.failed(); |
urlInfo.failed(); |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
var _loadStyle = function (url) { |
var _loadStyle = function (url) { |
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
||||
|
|
||||
$('<link/>', { |
$('<link/>', { |
||||
rel: 'stylesheet', |
rel: 'stylesheet', |
||||
type: 'text/css', |
type: 'text/css', |
||||
href: appendTimeToUrl(url) |
href: appendTimeToUrl(url) |
||||
}).appendTo('head'); |
}).appendTo('head'); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
return { |
return { |
||||
loadScript: _loadScript, |
loadScript: _loadScript, |
||||
loadStyle: _loadStyle |
loadStyle: _loadStyle |
||||
} |
} |
||||
})(); |
})(); |
||||
|
|
||||
})(jQuery); |
})(jQuery); |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,37 +1,37 @@ |
|||||
{ |
{ |
||||
"name": "malihu-custom-scrollbar-plugin", |
"name": "malihu-custom-scrollbar-plugin", |
||||
"version": "3.1.5", |
"version": "3.1.5", |
||||
"author": "malihu (http://manos.malihu.gr)", |
"author": "malihu (http://manos.malihu.gr)", |
||||
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
||||
"license": "MIT", |
"license": "MIT", |
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
||||
"main": "./jquery.mCustomScrollbar.js", |
"main": "./jquery.mCustomScrollbar.js", |
||||
"repository": { |
"repository": { |
||||
"type": "git", |
"type": "git", |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
||||
}, |
}, |
||||
"bugs": { |
"bugs": { |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
||||
}, |
}, |
||||
"keywords": [ |
"keywords": [ |
||||
"jquery-plugin", |
"jquery-plugin", |
||||
"custom-scrollbar", |
"custom-scrollbar", |
||||
"scrollbar" |
"scrollbar" |
||||
], |
], |
||||
"files": [ |
"files": [ |
||||
"jquery.mCustomScrollbar.js", |
"jquery.mCustomScrollbar.js", |
||||
"jquery.mCustomScrollbar.concat.min.js", |
"jquery.mCustomScrollbar.concat.min.js", |
||||
"jquery.mCustomScrollbar.css", |
"jquery.mCustomScrollbar.css", |
||||
"mCSB_buttons.png", |
"mCSB_buttons.png", |
||||
"readme.md" |
"readme.md" |
||||
], |
], |
||||
"jam": { |
"jam": { |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery": ">=1.6", |
"jquery": ">=1.6", |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
}, |
}, |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
} |
} |
||||
@ -1,82 +1,82 @@ |
|||||
malihu custom scrollbar plugin |
malihu custom scrollbar plugin |
||||
================================ |
================================ |
||||
|
|
||||
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
||||
|
|
||||
* Vertical and/or horizontal scrollbar(s) |
* Vertical and/or horizontal scrollbar(s) |
||||
* Adjustable scrolling momentum |
* Adjustable scrolling momentum |
||||
* Mouse-wheel, keyboard and touch support |
* Mouse-wheel, keyboard and touch support |
||||
* Ready-to-use themes and customization via CSS |
* Ready-to-use themes and customization via CSS |
||||
* RTL direction support |
* RTL direction support |
||||
* Option parameters for full control of scrollbar functionality |
* Option parameters for full control of scrollbar functionality |
||||
* Methods for triggering actions like scroll-to, update, destroy etc. |
* Methods for triggering actions like scroll-to, update, destroy etc. |
||||
* User-defined callbacks |
* User-defined callbacks |
||||
* Selectable/searchable content |
* Selectable/searchable content |
||||
|
|
||||
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
||||
|
|
||||
#### Installation |
#### Installation |
||||
|
|
||||
npm: `npm install malihu-custom-scrollbar-plugin` |
npm: `npm install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin` |
Bower: `bower install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
||||
|
|
||||
#### Usage |
#### Usage |
||||
|
|
||||
Manual: `$(selector).mCustomScrollbar();` |
Manual: `$(selector).mCustomScrollbar();` |
||||
|
|
||||
[Browserify](http://browserify.org/): |
[Browserify](http://browserify.org/): |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
[webpack](https://webpack.github.io/): |
[webpack](https://webpack.github.io/): |
||||
|
|
||||
npm install imports-loader |
npm install imports-loader |
||||
npm install jquery-mousewheel |
npm install jquery-mousewheel |
||||
npm install malihu-custom-scrollbar-plugin |
npm install malihu-custom-scrollbar-plugin |
||||
|
|
||||
module.exports = { |
module.exports = { |
||||
module: { |
module: { |
||||
loaders: [ |
loaders: [ |
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
||||
] |
] |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require("jquery-mousewheel")($); |
require("jquery-mousewheel")($); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
|
|
||||
Requirements |
Requirements |
||||
------------------------- |
------------------------- |
||||
|
|
||||
jQuery version **1.6.0** or higher |
jQuery version **1.6.0** or higher |
||||
|
|
||||
Browser compatibility |
Browser compatibility |
||||
------------------------- |
------------------------- |
||||
|
|
||||
* Internet Explorer 8+ |
* Internet Explorer 8+ |
||||
* Firefox |
* Firefox |
||||
* Chrome |
* Chrome |
||||
* Opera |
* Opera |
||||
* Safari |
* Safari |
||||
* iOS |
* iOS |
||||
* Android |
* Android |
||||
* Windows Phone |
* Windows Phone |
||||
|
|
||||
License |
License |
||||
------------------------- |
------------------------- |
||||
|
|
||||
MIT License (MIT) |
MIT License (MIT) |
||||
|
|
||||
http://opensource.org/licenses/MIT |
http://opensource.org/licenses/MIT |
||||
|
|
||||
Donate |
Donate |
||||
------------------------- |
------------------------- |
||||
|
|
||||
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
||||
@ -1,8 +0,0 @@ |
|||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
|
||||
# yarn lockfile v1 |
|
||||
|
|
||||
|
|
||||
jquery-mousewheel@>=3.0.6: |
|
||||
version "3.1.13" |
|
||||
resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.1.13.tgz#06f0335f16e353a695e7206bf50503cb523a6ee5" |
|
||||
integrity sha1-BvAzXxbjU6aV5yBr9QUDy1I6buU= |
|
||||
@ -1,56 +1,56 @@ |
|||||
@keyframes spin { |
@keyframes spin { |
||||
0% { |
0% { |
||||
transform: translateZ(0) rotate(0deg); |
transform: translateZ(0) rotate(0deg); |
||||
} |
} |
||||
|
|
||||
100% { |
100% { |
||||
transform: translateZ(0) rotate(360deg); |
transform: translateZ(0) rotate(360deg); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.abp-block-area { |
.abp-block-area { |
||||
position: fixed; |
position: fixed; |
||||
top: 0; |
top: 0; |
||||
left: 0; |
left: 0; |
||||
width: 100%; |
width: 100%; |
||||
height: 100%; |
height: 100%; |
||||
z-index: 102; |
z-index: 102; |
||||
background-color: #fff; |
background-color: #fff; |
||||
opacity: .8; |
opacity: .8; |
||||
transition: opacity .25s; |
transition: opacity .25s; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-disappearing { |
.abp-block-area.abp-block-area-disappearing { |
||||
opacity: 0; |
opacity: 0; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:after { |
.abp-block-area.abp-block-area-busy:after { |
||||
content: attr(data-text); |
content: attr(data-text); |
||||
display: block; |
display: block; |
||||
max-width: 125px; |
max-width: 125px; |
||||
position: absolute; |
position: absolute; |
||||
top: 50%; |
top: 50%; |
||||
left: 50%; |
left: 50%; |
||||
transform: translate(-50%, -50%); |
transform: translate(-50%, -50%); |
||||
font-size: 20px; |
font-size: 20px; |
||||
font-family: sans-serif; |
font-family: sans-serif; |
||||
color: #343a40; |
color: #343a40; |
||||
text-align: center; |
text-align: center; |
||||
text-transform: uppercase; |
text-transform: uppercase; |
||||
} |
} |
||||
|
|
||||
.abp-block-area.abp-block-area-busy:before { |
.abp-block-area.abp-block-area-busy:before { |
||||
content: ""; |
content: ""; |
||||
display: block; |
display: block; |
||||
width: 150px; |
width: 150px; |
||||
height: 150px; |
height: 150px; |
||||
border-radius: 50%; |
border-radius: 50%; |
||||
border-width: 2px; |
border-width: 2px; |
||||
border-style: solid; |
border-style: solid; |
||||
border-color: transparent #228ae6 #228ae6 #228ae6; |
border-color: transparent #228ae6 #228ae6 #228ae6; |
||||
position: absolute; |
position: absolute; |
||||
top: calc(50% - 75px); |
top: calc(50% - 75px); |
||||
left: calc(50% - 75px); |
left: calc(50% - 75px); |
||||
will-change: transform; |
will-change: transform; |
||||
animation: spin .75s infinite ease-in-out; |
animation: spin .75s infinite ease-in-out; |
||||
} |
} |
||||
|
|||||
File diff suppressed because it is too large
@ -1,389 +1,389 @@ |
|||||
var abp = abp || {}; |
var abp = abp || {}; |
||||
(function($) { |
(function($) { |
||||
|
|
||||
if (!$) { |
if (!$) { |
||||
throw "abp/jquery library requires the jquery library included to the page!"; |
throw "abp/jquery library requires the jquery library included to the page!"; |
||||
} |
} |
||||
|
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
|
||||
abp.message._showMessage = function (message, title) { |
abp.message._showMessage = function (message, title) { |
||||
alert((title || '') + ' ' + message); |
alert((title || '') + ' ' + message); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(); |
$dfd.resolve(); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) { |
abp.message.confirm = function (message, titleOrCallback, callback) { |
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
||||
callback = titleOrCallback; |
callback = titleOrCallback; |
||||
} |
} |
||||
|
|
||||
var result = confirm(message); |
var result = confirm(message); |
||||
callback && callback(result); |
callback && callback(result); |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$dfd.resolve(result); |
$dfd.resolve(result); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
abp.utils.isFunction = function (obj) { |
abp.utils.isFunction = function (obj) { |
||||
return $.isFunction(obj); |
return $.isFunction(obj); |
||||
}; |
}; |
||||
|
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
|
||||
$.fn.findWithSelf = function (selector) { |
$.fn.findWithSelf = function (selector) { |
||||
return this.filter(selector).add(this.find(selector)); |
return this.filter(selector).add(this.find(selector)); |
||||
}; |
}; |
||||
|
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.dom = abp.dom || {}; |
abp.dom = abp.dom || {}; |
||||
|
|
||||
abp.dom.onNodeAdded = function (callback) { |
abp.dom.onNodeAdded = function (callback) { |
||||
abp.event.on('abp.dom.nodeAdded', callback); |
abp.event.on('abp.dom.nodeAdded', callback); |
||||
}; |
}; |
||||
|
|
||||
abp.dom.onNodeRemoved = function (callback) { |
abp.dom.onNodeRemoved = function (callback) { |
||||
abp.event.on('abp.dom.nodeRemoved', callback); |
abp.event.on('abp.dom.nodeRemoved', callback); |
||||
}; |
}; |
||||
|
|
||||
var mutationObserverCallback = function (mutationsList) { |
var mutationObserverCallback = function (mutationsList) { |
||||
for (var i = 0; i < mutationsList.length; i++) { |
for (var i = 0; i < mutationsList.length; i++) { |
||||
var mutation = mutationsList[i]; |
var mutation = mutationsList[i]; |
||||
if (mutation.type === 'childList') { |
if (mutation.type === 'childList') { |
||||
if (mutation.addedNodes && mutation.removedNodes.length) { |
if (mutation.addedNodes && mutation.removedNodes.length) { |
||||
for (var k = 0; k < mutation.removedNodes.length; k++) { |
for (var k = 0; k < mutation.removedNodes.length; k++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeRemoved', |
'abp.dom.nodeRemoved', |
||||
{ |
{ |
||||
$el: $(mutation.removedNodes[k]) |
$el: $(mutation.removedNodes[k]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) { |
if (mutation.addedNodes && mutation.addedNodes.length) { |
||||
for (var j = 0; j < mutation.addedNodes.length; j++) { |
for (var j = 0; j < mutation.addedNodes.length; j++) { |
||||
abp.event.trigger( |
abp.event.trigger( |
||||
'abp.dom.nodeAdded', |
'abp.dom.nodeAdded', |
||||
{ |
{ |
||||
$el: $(mutation.addedNodes[j]) |
$el: $(mutation.addedNodes[j]) |
||||
} |
} |
||||
); |
); |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
new MutationObserver(mutationObserverCallback).observe( |
new MutationObserver(mutationObserverCallback).observe( |
||||
$('body')[0], |
$('body')[0], |
||||
{ |
{ |
||||
subtree: true, |
subtree: true, |
||||
childList: true |
childList: true |
||||
} |
} |
||||
); |
); |
||||
|
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
|
||||
abp.ajax = function (userOptions) { |
abp.ajax = function (userOptions) { |
||||
userOptions = userOptions || {}; |
userOptions = userOptions || {}; |
||||
|
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
||||
|
|
||||
options.success = undefined; |
options.success = undefined; |
||||
options.error = undefined; |
options.error = undefined; |
||||
|
|
||||
return $.Deferred(function ($dfd) { |
return $.Deferred(function ($dfd) { |
||||
$.ajax(options) |
$.ajax(options) |
||||
.done(function (data, textStatus, jqXHR) { |
.done(function (data, textStatus, jqXHR) { |
||||
$dfd.resolve(data); |
$dfd.resolve(data); |
||||
userOptions.success && userOptions.success(data); |
userOptions.success && userOptions.success(data); |
||||
}).fail(function (jqXHR) { |
}).fail(function (jqXHR) { |
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} else { |
} else { |
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
||||
} |
} |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
$.extend(abp.ajax, { |
$.extend(abp.ajax, { |
||||
defaultOpts: { |
defaultOpts: { |
||||
dataType: 'json', |
dataType: 'json', |
||||
type: 'POST', |
type: 'POST', |
||||
contentType: 'application/json', |
contentType: 'application/json', |
||||
headers: { |
headers: { |
||||
'X-Requested-With': 'XMLHttpRequest' |
'X-Requested-With': 'XMLHttpRequest' |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
defaultError: { |
defaultError: { |
||||
message: 'An error has occurred!', |
message: 'An error has occurred!', |
||||
details: 'Error detail not sent by server.' |
details: 'Error detail not sent by server.' |
||||
}, |
}, |
||||
|
|
||||
defaultError401: { |
defaultError401: { |
||||
message: 'You are not authenticated!', |
message: 'You are not authenticated!', |
||||
details: 'You should be authenticated (sign in) in order to perform this operation.' |
details: 'You should be authenticated (sign in) in order to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError403: { |
defaultError403: { |
||||
message: 'You are not authorized!', |
message: 'You are not authorized!', |
||||
details: 'You are not allowed to perform this operation.' |
details: 'You are not allowed to perform this operation.' |
||||
}, |
}, |
||||
|
|
||||
defaultError404: { |
defaultError404: { |
||||
message: 'Resource not found!', |
message: 'Resource not found!', |
||||
details: 'The resource requested could not found on the server.' |
details: 'The resource requested could not found on the server.' |
||||
}, |
}, |
||||
|
|
||||
logError: function (error) { |
logError: function (error) { |
||||
abp.log.error(error); |
abp.log.error(error); |
||||
}, |
}, |
||||
|
|
||||
showError: function (error) { |
showError: function (error) { |
||||
if (error.details) { |
if (error.details) { |
||||
return abp.message.error(error.details, error.message); |
return abp.message.error(error.details, error.message); |
||||
} else { |
} else { |
||||
return abp.message.error(error.message || abp.ajax.defaultError.message); |
return abp.message.error(error.message || abp.ajax.defaultError.message); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleTargetUrl: function (targetUrl) { |
handleTargetUrl: function (targetUrl) { |
||||
if (!targetUrl) { |
if (!targetUrl) { |
||||
location.href = abp.appPath; |
location.href = abp.appPath; |
||||
} else { |
} else { |
||||
location.href = targetUrl; |
location.href = targetUrl; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleErrorStatusCode: function (status) { |
handleErrorStatusCode: function (status) { |
||||
switch (status) { |
switch (status) { |
||||
case 401: |
case 401: |
||||
abp.ajax.handleUnAuthorizedRequest( |
abp.ajax.handleUnAuthorizedRequest( |
||||
abp.ajax.showError(abp.ajax.defaultError401), |
abp.ajax.showError(abp.ajax.defaultError401), |
||||
abp.appPath |
abp.appPath |
||||
); |
); |
||||
break; |
break; |
||||
case 403: |
case 403: |
||||
abp.ajax.showError(abp.ajax.defaultError403); |
abp.ajax.showError(abp.ajax.defaultError403); |
||||
break; |
break; |
||||
case 404: |
case 404: |
||||
abp.ajax.showError(abp.ajax.defaultError404); |
abp.ajax.showError(abp.ajax.defaultError404); |
||||
break; |
break; |
||||
default: |
default: |
||||
abp.ajax.showError(abp.ajax.defaultError); |
abp.ajax.showError(abp.ajax.defaultError); |
||||
break; |
break; |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleErrorStatusCode(jqXHR.status); |
abp.ajax.handleErrorStatusCode(jqXHR.status); |
||||
} |
} |
||||
|
|
||||
$dfd.reject.apply(this, arguments); |
$dfd.reject.apply(this, arguments); |
||||
userOptions.error && userOptions.error.apply(this, arguments); |
userOptions.error && userOptions.error.apply(this, arguments); |
||||
}, |
}, |
||||
|
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
||||
var messagePromise = null; |
var messagePromise = null; |
||||
|
|
||||
if (userOptions.abpHandleError !== false) { |
if (userOptions.abpHandleError !== false) { |
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
||||
} |
} |
||||
|
|
||||
abp.ajax.logError(jqXHR.responseJSON.error); |
abp.ajax.logError(jqXHR.responseJSON.error); |
||||
|
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
||||
|
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
||||
if (messagePromise) { |
if (messagePromise) { |
||||
messagePromise.done(function () { |
messagePromise.done(function () { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
}); |
}); |
||||
} else { |
} else { |
||||
abp.ajax.handleTargetUrl(targetUrl); |
abp.ajax.handleTargetUrl(targetUrl); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
blockUI: function (options) { |
blockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //block whole page
|
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy(); |
abp.ui.setBusy(); |
||||
} else { //block an element
|
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI); |
abp.ui.setBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
unblockUI: function (options) { |
unblockUI: function (options) { |
||||
if (options.blockUI) { |
if (options.blockUI) { |
||||
if (options.blockUI === true) { //unblock whole page
|
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy(); |
abp.ui.clearBusy(); |
||||
} else { //unblock an element
|
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI); |
abp.ui.clearBusy(options.blockUI); |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
ajaxSendHandler: function (event, request, settings) { |
ajaxSendHandler: function (event, request, settings) { |
||||
var token = abp.security.antiForgery.getToken(); |
var token = abp.security.antiForgery.getToken(); |
||||
if (!token) { |
if (!token) { |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
||||
} |
} |
||||
} |
} |
||||
}); |
}); |
||||
|
|
||||
$(document).ajaxSend(function (event, request, settings) { |
$(document).ajaxSend(function (event, request, settings) { |
||||
return abp.ajax.ajaxSendHandler(event, request, settings); |
return abp.ajax.ajaxSendHandler(event, request, settings); |
||||
}); |
}); |
||||
|
|
||||
abp.event.on('abp.configurationInitialized', function () { |
abp.event.on('abp.configurationInitialized', function () { |
||||
var l = abp.localization.getResource('AbpUi'); |
var l = abp.localization.getResource('AbpUi'); |
||||
|
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
||||
}); |
}); |
||||
|
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
|
||||
/* UrlStates enum */ |
/* UrlStates enum */ |
||||
var UrlStates = { |
var UrlStates = { |
||||
LOADING: 'LOADING', |
LOADING: 'LOADING', |
||||
LOADED: 'LOADED', |
LOADED: 'LOADED', |
||||
FAILED: 'FAILED' |
FAILED: 'FAILED' |
||||
}; |
}; |
||||
|
|
||||
/* UrlInfo class */ |
/* UrlInfo class */ |
||||
function UrlInfo(url) { |
function UrlInfo(url) { |
||||
this.url = url; |
this.url = url; |
||||
this.state = UrlStates.LOADING; |
this.state = UrlStates.LOADING; |
||||
this.loadCallbacks = []; |
this.loadCallbacks = []; |
||||
this.failCallbacks = []; |
this.failCallbacks = []; |
||||
} |
} |
||||
|
|
||||
UrlInfo.prototype.succeed = function () { |
UrlInfo.prototype.succeed = function () { |
||||
this.state = UrlStates.LOADED; |
this.state = UrlStates.LOADED; |
||||
for (var i = 0; i < this.loadCallbacks.length; i++) { |
for (var i = 0; i < this.loadCallbacks.length; i++) { |
||||
this.loadCallbacks[i](); |
this.loadCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.failed = function () { |
UrlInfo.prototype.failed = function () { |
||||
this.state = UrlStates.FAILED; |
this.state = UrlStates.FAILED; |
||||
for (var i = 0; i < this.failCallbacks.length; i++) { |
for (var i = 0; i < this.failCallbacks.length; i++) { |
||||
this.failCallbacks[i](); |
this.failCallbacks[i](); |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
||||
switch (this.state) { |
switch (this.state) { |
||||
case UrlStates.LOADED: |
case UrlStates.LOADED: |
||||
loadCallback && loadCallback(); |
loadCallback && loadCallback(); |
||||
break; |
break; |
||||
case UrlStates.FAILED: |
case UrlStates.FAILED: |
||||
failCallback && failCallback(); |
failCallback && failCallback(); |
||||
break; |
break; |
||||
case UrlStates.LOADING: |
case UrlStates.LOADING: |
||||
this.addCallbacks(loadCallback, failCallback); |
this.addCallbacks(loadCallback, failCallback); |
||||
break; |
break; |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
||||
loadCallback && this.loadCallbacks.push(loadCallback); |
loadCallback && this.loadCallbacks.push(loadCallback); |
||||
failCallback && this.failCallbacks.push(failCallback); |
failCallback && this.failCallbacks.push(failCallback); |
||||
}; |
}; |
||||
|
|
||||
/* ResourceLoader API */ |
/* ResourceLoader API */ |
||||
|
|
||||
abp.ResourceLoader = (function () { |
abp.ResourceLoader = (function () { |
||||
|
|
||||
var _urlInfos = {}; |
var _urlInfos = {}; |
||||
|
|
||||
function getCacheKey(url) { |
function getCacheKey(url) { |
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
function appendTimeToUrl(url) { |
function appendTimeToUrl(url) { |
||||
|
|
||||
if (url.indexOf('?') < 0) { |
if (url.indexOf('?') < 0) { |
||||
url += '?'; |
url += '?'; |
||||
} else { |
} else { |
||||
url += '&'; |
url += '&'; |
||||
} |
} |
||||
|
|
||||
url += '_=' + new Date().getTime(); |
url += '_=' + new Date().getTime(); |
||||
|
|
||||
return url; |
return url; |
||||
} |
} |
||||
|
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
||||
|
|
||||
var cacheKey = getCacheKey(url); |
var cacheKey = getCacheKey(url); |
||||
|
|
||||
var urlInfo = _urlInfos[cacheKey]; |
var urlInfo = _urlInfos[cacheKey]; |
||||
|
|
||||
if (urlInfo) { |
if (urlInfo) { |
||||
urlInfo.handleCallbacks(loadCallback, failCallback); |
urlInfo.handleCallbacks(loadCallback, failCallback); |
||||
return; |
return; |
||||
} |
} |
||||
|
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
||||
urlInfo.addCallbacks(loadCallback, failCallback); |
urlInfo.addCallbacks(loadCallback, failCallback); |
||||
|
|
||||
serverLoader(urlInfo); |
serverLoader(urlInfo); |
||||
}; |
}; |
||||
|
|
||||
var _loadScript = function (url, loadCallback, failCallback) { |
var _loadScript = function (url, loadCallback, failCallback) { |
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
||||
$.getScript(url) |
$.getScript(url) |
||||
.done(function () { |
.done(function () { |
||||
urlInfo.succeed(); |
urlInfo.succeed(); |
||||
}) |
}) |
||||
.fail(function () { |
.fail(function () { |
||||
urlInfo.failed(); |
urlInfo.failed(); |
||||
}); |
}); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
var _loadStyle = function (url) { |
var _loadStyle = function (url) { |
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
||||
|
|
||||
$('<link/>', { |
$('<link/>', { |
||||
rel: 'stylesheet', |
rel: 'stylesheet', |
||||
type: 'text/css', |
type: 'text/css', |
||||
href: appendTimeToUrl(url) |
href: appendTimeToUrl(url) |
||||
}).appendTo('head'); |
}).appendTo('head'); |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
return { |
return { |
||||
loadScript: _loadScript, |
loadScript: _loadScript, |
||||
loadStyle: _loadStyle |
loadStyle: _loadStyle |
||||
} |
} |
||||
})(); |
})(); |
||||
|
|
||||
})(jQuery); |
})(jQuery); |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,37 +1,37 @@ |
|||||
{ |
{ |
||||
"name": "malihu-custom-scrollbar-plugin", |
"name": "malihu-custom-scrollbar-plugin", |
||||
"version": "3.1.5", |
"version": "3.1.5", |
||||
"author": "malihu (http://manos.malihu.gr)", |
"author": "malihu (http://manos.malihu.gr)", |
||||
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.", |
||||
"license": "MIT", |
"license": "MIT", |
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller", |
||||
"main": "./jquery.mCustomScrollbar.js", |
"main": "./jquery.mCustomScrollbar.js", |
||||
"repository": { |
"repository": { |
||||
"type": "git", |
"type": "git", |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git" |
||||
}, |
}, |
||||
"bugs": { |
"bugs": { |
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues" |
||||
}, |
}, |
||||
"keywords": [ |
"keywords": [ |
||||
"jquery-plugin", |
"jquery-plugin", |
||||
"custom-scrollbar", |
"custom-scrollbar", |
||||
"scrollbar" |
"scrollbar" |
||||
], |
], |
||||
"files": [ |
"files": [ |
||||
"jquery.mCustomScrollbar.js", |
"jquery.mCustomScrollbar.js", |
||||
"jquery.mCustomScrollbar.concat.min.js", |
"jquery.mCustomScrollbar.concat.min.js", |
||||
"jquery.mCustomScrollbar.css", |
"jquery.mCustomScrollbar.css", |
||||
"mCSB_buttons.png", |
"mCSB_buttons.png", |
||||
"readme.md" |
"readme.md" |
||||
], |
], |
||||
"jam": { |
"jam": { |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery": ">=1.6", |
"jquery": ">=1.6", |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
}, |
}, |
||||
"dependencies": { |
"dependencies": { |
||||
"jquery-mousewheel": ">=3.0.6" |
"jquery-mousewheel": ">=3.0.6" |
||||
} |
} |
||||
} |
} |
||||
@ -1,82 +1,82 @@ |
|||||
malihu custom scrollbar plugin |
malihu custom scrollbar plugin |
||||
================================ |
================================ |
||||
|
|
||||
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
Highly customizable custom scrollbar jQuery plugin ([Demo](http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/complete_examples.html)). Features include: |
||||
|
|
||||
* Vertical and/or horizontal scrollbar(s) |
* Vertical and/or horizontal scrollbar(s) |
||||
* Adjustable scrolling momentum |
* Adjustable scrolling momentum |
||||
* Mouse-wheel, keyboard and touch support |
* Mouse-wheel, keyboard and touch support |
||||
* Ready-to-use themes and customization via CSS |
* Ready-to-use themes and customization via CSS |
||||
* RTL direction support |
* RTL direction support |
||||
* Option parameters for full control of scrollbar functionality |
* Option parameters for full control of scrollbar functionality |
||||
* Methods for triggering actions like scroll-to, update, destroy etc. |
* Methods for triggering actions like scroll-to, update, destroy etc. |
||||
* User-defined callbacks |
* User-defined callbacks |
||||
* Selectable/searchable content |
* Selectable/searchable content |
||||
|
|
||||
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
**[Plugin homepage and documentation](http://manos.malihu.gr/jquery-custom-content-scroller/)** ([Changelog](http://manos.malihu.gr/jquery-custom-content-scroller/2/)) |
||||
|
|
||||
#### Installation |
#### Installation |
||||
|
|
||||
npm: `npm install malihu-custom-scrollbar-plugin` |
npm: `npm install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin` |
Bower: `bower install malihu-custom-scrollbar-plugin` |
||||
|
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section) |
||||
|
|
||||
#### Usage |
#### Usage |
||||
|
|
||||
Manual: `$(selector).mCustomScrollbar();` |
Manual: `$(selector).mCustomScrollbar();` |
||||
|
|
||||
[Browserify](http://browserify.org/): |
[Browserify](http://browserify.org/): |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
[webpack](https://webpack.github.io/): |
[webpack](https://webpack.github.io/): |
||||
|
|
||||
npm install imports-loader |
npm install imports-loader |
||||
npm install jquery-mousewheel |
npm install jquery-mousewheel |
||||
npm install malihu-custom-scrollbar-plugin |
npm install malihu-custom-scrollbar-plugin |
||||
|
|
||||
module.exports = { |
module.exports = { |
||||
module: { |
module: { |
||||
loaders: [ |
loaders: [ |
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" }, |
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" } |
||||
] |
] |
||||
} |
} |
||||
}; |
}; |
||||
|
|
||||
var $ = require('jquery'); |
var $ = require('jquery'); |
||||
require("jquery-mousewheel")($); |
require("jquery-mousewheel")($); |
||||
require('malihu-custom-scrollbar-plugin')($); |
require('malihu-custom-scrollbar-plugin')($); |
||||
|
|
||||
|
|
||||
Requirements |
Requirements |
||||
------------------------- |
------------------------- |
||||
|
|
||||
jQuery version **1.6.0** or higher |
jQuery version **1.6.0** or higher |
||||
|
|
||||
Browser compatibility |
Browser compatibility |
||||
------------------------- |
------------------------- |
||||
|
|
||||
* Internet Explorer 8+ |
* Internet Explorer 8+ |
||||
* Firefox |
* Firefox |
||||
* Chrome |
* Chrome |
||||
* Opera |
* Opera |
||||
* Safari |
* Safari |
||||
* iOS |
* iOS |
||||
* Android |
* Android |
||||
* Windows Phone |
* Windows Phone |
||||
|
|
||||
License |
License |
||||
------------------------- |
------------------------- |
||||
|
|
||||
MIT License (MIT) |
MIT License (MIT) |
||||
|
|
||||
http://opensource.org/licenses/MIT |
http://opensource.org/licenses/MIT |
||||
|
|
||||
Donate |
Donate |
||||
------------------------- |
------------------------- |
||||
|
|
||||
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28 |
||||
Loading…
Reference in new issue