mirror of https://github.com/abpframework/abp
parent
44b439514b
commit
4cbfbc7093
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"packages": ["dist/*"],
|
||||
"npmClient": "yarn"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"packages": ["packages/*"],
|
||||
"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,56 +1,56 @@
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,389 +1,389 @@
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,37 +1,37 @@
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
}
|
@ -1,82 +1,82 @@
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
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 {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,389 +1,389 @@
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,37 +1,37 @@
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
}
|
@ -1,82 +1,82 @@
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
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 {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,389 +1,389 @@
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,37 +1,37 @@
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
}
|
@ -1,82 +1,82 @@
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
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 {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,389 +1,389 @@
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,37 +1,37 @@
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
}
|
@ -1,82 +1,82 @@
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
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 {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,389 +1,389 @@
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,37 +1,37 @@
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
}
|
@ -1,82 +1,82 @@
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
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 {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,389 +1,389 @@
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,37 +1,37 @@
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
}
|
@ -1,82 +1,82 @@
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
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 {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: translateZ(0) rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateZ(0) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.abp-block-area {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 102;
|
||||
background-color: #fff;
|
||||
opacity: .8;
|
||||
transition: opacity .25s;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-disappearing {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:after {
|
||||
content: attr(data-text);
|
||||
display: block;
|
||||
max-width: 125px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 20px;
|
||||
font-family: sans-serif;
|
||||
color: #343a40;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.abp-block-area.abp-block-area-busy:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: transparent #228ae6 #228ae6 #228ae6;
|
||||
position: absolute;
|
||||
top: calc(50% - 75px);
|
||||
left: calc(50% - 75px);
|
||||
will-change: transform;
|
||||
animation: spin .75s infinite ease-in-out;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,389 +1,389 @@
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
var abp = abp || {};
|
||||
(function($) {
|
||||
|
||||
if (!$) {
|
||||
throw "abp/jquery library requires the jquery library included to the page!";
|
||||
}
|
||||
|
||||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
||||
|
||||
abp.message._showMessage = function (message, title) {
|
||||
alert((title || '') + ' ' + message);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
abp.message.confirm = function (message, titleOrCallback, callback) {
|
||||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
|
||||
callback = titleOrCallback;
|
||||
}
|
||||
|
||||
var result = confirm(message);
|
||||
callback && callback(result);
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$dfd.resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
abp.utils.isFunction = function (obj) {
|
||||
return $.isFunction(obj);
|
||||
};
|
||||
|
||||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
||||
|
||||
$.fn.findWithSelf = function (selector) {
|
||||
return this.filter(selector).add(this.find(selector));
|
||||
};
|
||||
|
||||
// DOM ////////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.dom = abp.dom || {};
|
||||
|
||||
abp.dom.onNodeAdded = function (callback) {
|
||||
abp.event.on('abp.dom.nodeAdded', callback);
|
||||
};
|
||||
|
||||
abp.dom.onNodeRemoved = function (callback) {
|
||||
abp.event.on('abp.dom.nodeRemoved', callback);
|
||||
};
|
||||
|
||||
var mutationObserverCallback = function (mutationsList) {
|
||||
for (var i = 0; i < mutationsList.length; i++) {
|
||||
var mutation = mutationsList[i];
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes && mutation.removedNodes.length) {
|
||||
for (var k = 0; k < mutation.removedNodes.length; k++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeRemoved',
|
||||
{
|
||||
$el: $(mutation.removedNodes[k])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mutation.addedNodes && mutation.addedNodes.length) {
|
||||
for (var j = 0; j < mutation.addedNodes.length; j++) {
|
||||
abp.event.trigger(
|
||||
'abp.dom.nodeAdded',
|
||||
{
|
||||
$el: $(mutation.addedNodes[j])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(mutationObserverCallback).observe(
|
||||
$('body')[0],
|
||||
{
|
||||
subtree: true,
|
||||
childList: true
|
||||
}
|
||||
);
|
||||
|
||||
// AJAX ///////////////////////////////////////////////////////////////////
|
||||
|
||||
abp.ajax = function (userOptions) {
|
||||
userOptions = userOptions || {};
|
||||
|
||||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
|
||||
|
||||
options.success = undefined;
|
||||
options.error = undefined;
|
||||
|
||||
return $.Deferred(function ($dfd) {
|
||||
$.ajax(options)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
$dfd.resolve(data);
|
||||
userOptions.success && userOptions.success(data);
|
||||
}).fail(function (jqXHR) {
|
||||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
|
||||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
} else {
|
||||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(abp.ajax, {
|
||||
defaultOpts: {
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
|
||||
defaultError: {
|
||||
message: 'An error has occurred!',
|
||||
details: 'Error detail not sent by server.'
|
||||
},
|
||||
|
||||
defaultError401: {
|
||||
message: 'You are not authenticated!',
|
||||
details: 'You should be authenticated (sign in) in order to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError403: {
|
||||
message: 'You are not authorized!',
|
||||
details: 'You are not allowed to perform this operation.'
|
||||
},
|
||||
|
||||
defaultError404: {
|
||||
message: 'Resource not found!',
|
||||
details: 'The resource requested could not found on the server.'
|
||||
},
|
||||
|
||||
logError: function (error) {
|
||||
abp.log.error(error);
|
||||
},
|
||||
|
||||
showError: function (error) {
|
||||
if (error.details) {
|
||||
return abp.message.error(error.details, error.message);
|
||||
} else {
|
||||
return abp.message.error(error.message || abp.ajax.defaultError.message);
|
||||
}
|
||||
},
|
||||
|
||||
handleTargetUrl: function (targetUrl) {
|
||||
if (!targetUrl) {
|
||||
location.href = abp.appPath;
|
||||
} else {
|
||||
location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
|
||||
handleErrorStatusCode: function (status) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
abp.ajax.handleUnAuthorizedRequest(
|
||||
abp.ajax.showError(abp.ajax.defaultError401),
|
||||
abp.appPath
|
||||
);
|
||||
break;
|
||||
case 403:
|
||||
abp.ajax.showError(abp.ajax.defaultError403);
|
||||
break;
|
||||
case 404:
|
||||
abp.ajax.showError(abp.ajax.defaultError404);
|
||||
break;
|
||||
default:
|
||||
abp.ajax.showError(abp.ajax.defaultError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleErrorStatusCode(jqXHR.status);
|
||||
}
|
||||
|
||||
$dfd.reject.apply(this, arguments);
|
||||
userOptions.error && userOptions.error.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
|
||||
var messagePromise = null;
|
||||
|
||||
if (userOptions.abpHandleError !== false) {
|
||||
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
|
||||
}
|
||||
|
||||
abp.ajax.logError(jqXHR.responseJSON.error);
|
||||
|
||||
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
|
||||
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
|
||||
|
||||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
|
||||
abp.ajax.handleUnAuthorizedRequest(messagePromise);
|
||||
}
|
||||
},
|
||||
|
||||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
|
||||
if (messagePromise) {
|
||||
messagePromise.done(function () {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
});
|
||||
} else {
|
||||
abp.ajax.handleTargetUrl(targetUrl);
|
||||
}
|
||||
},
|
||||
|
||||
blockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //block whole page
|
||||
abp.ui.setBusy();
|
||||
} else { //block an element
|
||||
abp.ui.setBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
unblockUI: function (options) {
|
||||
if (options.blockUI) {
|
||||
if (options.blockUI === true) { //unblock whole page
|
||||
abp.ui.clearBusy();
|
||||
} else { //unblock an element
|
||||
abp.ui.clearBusy(options.blockUI);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ajaxSendHandler: function (event, request, settings) {
|
||||
var token = abp.security.antiForgery.getToken();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
|
||||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, request, settings) {
|
||||
return abp.ajax.ajaxSendHandler(event, request, settings);
|
||||
});
|
||||
|
||||
abp.event.on('abp.configurationInitialized', function () {
|
||||
var l = abp.localization.getResource('AbpUi');
|
||||
|
||||
abp.ajax.defaultError.message = l('DefaultErrorMessage');
|
||||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
|
||||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
|
||||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
|
||||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
|
||||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
|
||||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
|
||||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
|
||||
});
|
||||
|
||||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
||||
|
||||
/* UrlStates enum */
|
||||
var UrlStates = {
|
||||
LOADING: 'LOADING',
|
||||
LOADED: 'LOADED',
|
||||
FAILED: 'FAILED'
|
||||
};
|
||||
|
||||
/* UrlInfo class */
|
||||
function UrlInfo(url) {
|
||||
this.url = url;
|
||||
this.state = UrlStates.LOADING;
|
||||
this.loadCallbacks = [];
|
||||
this.failCallbacks = [];
|
||||
}
|
||||
|
||||
UrlInfo.prototype.succeed = function () {
|
||||
this.state = UrlStates.LOADED;
|
||||
for (var i = 0; i < this.loadCallbacks.length; i++) {
|
||||
this.loadCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.failed = function () {
|
||||
this.state = UrlStates.FAILED;
|
||||
for (var i = 0; i < this.failCallbacks.length; i++) {
|
||||
this.failCallbacks[i]();
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
|
||||
switch (this.state) {
|
||||
case UrlStates.LOADED:
|
||||
loadCallback && loadCallback();
|
||||
break;
|
||||
case UrlStates.FAILED:
|
||||
failCallback && failCallback();
|
||||
break;
|
||||
case UrlStates.LOADING:
|
||||
this.addCallbacks(loadCallback, failCallback);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
|
||||
loadCallback && this.loadCallbacks.push(loadCallback);
|
||||
failCallback && this.failCallbacks.push(failCallback);
|
||||
};
|
||||
|
||||
/* ResourceLoader API */
|
||||
|
||||
abp.ResourceLoader = (function () {
|
||||
|
||||
var _urlInfos = {};
|
||||
|
||||
function getCacheKey(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function appendTimeToUrl(url) {
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += '_=' + new Date().getTime();
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
|
||||
|
||||
var cacheKey = getCacheKey(url);
|
||||
|
||||
var urlInfo = _urlInfos[cacheKey];
|
||||
|
||||
if (urlInfo) {
|
||||
urlInfo.handleCallbacks(loadCallback, failCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
|
||||
urlInfo.addCallbacks(loadCallback, failCallback);
|
||||
|
||||
serverLoader(urlInfo);
|
||||
};
|
||||
|
||||
var _loadScript = function (url, loadCallback, failCallback) {
|
||||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
|
||||
$.getScript(url)
|
||||
.done(function () {
|
||||
urlInfo.succeed();
|
||||
})
|
||||
.fail(function () {
|
||||
urlInfo.failed();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _loadStyle = function (url) {
|
||||
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
|
||||
|
||||
$('<link/>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: appendTimeToUrl(url)
|
||||
}).appendTo('head');
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
loadScript: _loadScript,
|
||||
loadStyle: _loadStyle
|
||||
}
|
||||
})();
|
||||
|
||||
})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,37 +1,37 @@
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "3.1.5",
|
||||
"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.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/malihu/malihu-custom-scrollbar-plugin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"custom-scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"files": [
|
||||
"jquery.mCustomScrollbar.js",
|
||||
"jquery.mCustomScrollbar.concat.min.js",
|
||||
"jquery.mCustomScrollbar.css",
|
||||
"mCSB_buttons.png",
|
||||
"readme.md"
|
||||
],
|
||||
"jam": {
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
}
|
||||
}
|
@ -1,82 +1,82 @@
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
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:
|
||||
|
||||
* Vertical and/or horizontal scrollbar(s)
|
||||
* Adjustable scrolling momentum
|
||||
* Mouse-wheel, keyboard and touch support
|
||||
* Ready-to-use themes and customization via CSS
|
||||
* RTL direction support
|
||||
* Option parameters for full control of scrollbar functionality
|
||||
* Methods for triggering actions like scroll-to, update, destroy etc.
|
||||
* User-defined callbacks
|
||||
* 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/))
|
||||
|
||||
#### Installation
|
||||
|
||||
npm: `npm install malihu-custom-scrollbar-plugin`
|
||||
|
||||
Bower: `bower install malihu-custom-scrollbar-plugin`
|
||||
|
||||
[Manual](http://manos.malihu.gr/jquery-custom-content-scroller/#get-started-section)
|
||||
|
||||
#### Usage
|
||||
|
||||
Manual: `$(selector).mCustomScrollbar();`
|
||||
|
||||
[Browserify](http://browserify.org/):
|
||||
|
||||
var $ = require('jquery');
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
[webpack](https://webpack.github.io/):
|
||||
|
||||
npm install imports-loader
|
||||
npm install jquery-mousewheel
|
||||
npm install malihu-custom-scrollbar-plugin
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /jquery-mousewheel/, loader: "imports?define=>false&this=>window" },
|
||||
{ test: /malihu-custom-scrollbar-plugin/, loader: "imports?define=>false&this=>window" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var $ = require('jquery');
|
||||
require("jquery-mousewheel")($);
|
||||
require('malihu-custom-scrollbar-plugin')($);
|
||||
|
||||
|
||||
Requirements
|
||||
-------------------------
|
||||
|
||||
jQuery version **1.6.0** or higher
|
||||
|
||||
Browser compatibility
|
||||
-------------------------
|
||||
|
||||
* Internet Explorer 8+
|
||||
* Firefox
|
||||
* Chrome
|
||||
* Opera
|
||||
* Safari
|
||||
* iOS
|
||||
* Android
|
||||
* Windows Phone
|
||||
|
||||
License
|
||||
-------------------------
|
||||
|
||||
MIT License (MIT)
|
||||
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
Donate
|
||||
-------------------------
|
||||
|
||||
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28
|
Loading…
Reference in new issue