|
|
@@ -86,448 +86,14 @@
|
|
|
/************************************************************************/
|
|
|
/******/ ({
|
|
|
|
|
|
-/***/ "./resources/assets/dcat/Dcat.js":
|
|
|
-/*!***************************************!*\
|
|
|
- !*** ./resources/assets/dcat/Dcat.js ***!
|
|
|
- \***************************************/
|
|
|
-/*! exports provided: default */
|
|
|
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
-
|
|
|
-"use strict";
|
|
|
-__webpack_require__.r(__webpack_exports__);
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Dcat; });
|
|
|
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
-
|
|
|
-function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
-
|
|
|
-function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
-
|
|
|
-var $ = jQuery,
|
|
|
- _pjaxResponded = false,
|
|
|
- bootingCallbacks = [],
|
|
|
- formCallbacks = {
|
|
|
- before: [],
|
|
|
- success: [],
|
|
|
- error: []
|
|
|
-};
|
|
|
-
|
|
|
-var Dcat = /*#__PURE__*/function () {
|
|
|
- function Dcat(config) {
|
|
|
- _classCallCheck(this, Dcat);
|
|
|
-
|
|
|
- this.withConfig(config);
|
|
|
- this.pjaxContainer = config['pjax_container_selector'] || '#pjax-container';
|
|
|
- }
|
|
|
-
|
|
|
- _createClass(Dcat, [{
|
|
|
- key: "booting",
|
|
|
- value: function booting(callback) {
|
|
|
- bootingCallbacks.push(callback);
|
|
|
- return this;
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "boot",
|
|
|
- value: function boot() {
|
|
|
- var _this = this;
|
|
|
-
|
|
|
- bootingCallbacks.forEach(function (callback) {
|
|
|
- return callback(_this);
|
|
|
- });
|
|
|
- bootingCallbacks = [];
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "ready",
|
|
|
- value: function ready(callback, _window) {
|
|
|
- if (!_window || _window === window) {
|
|
|
- if (!_pjaxResponded) {
|
|
|
- return $(callback);
|
|
|
- }
|
|
|
-
|
|
|
- return $(document).one('pjax:loaded', callback);
|
|
|
- }
|
|
|
-
|
|
|
- var proxy = function proxy(e) {
|
|
|
- _window.$(_window.$(this.pjaxContainer)).one('pjax:loaded', proxy);
|
|
|
-
|
|
|
- callback(e);
|
|
|
- };
|
|
|
-
|
|
|
- _window.Dcat.ready(proxy);
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "withConfig",
|
|
|
- value: function withConfig(config) {
|
|
|
- this.config = config;
|
|
|
- this.withLang(config['lang']);
|
|
|
- this.withToken(config['token']);
|
|
|
- return this;
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "withToken",
|
|
|
- value: function withToken(token) {
|
|
|
- token && (this.token = token);
|
|
|
- return this;
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "withLang",
|
|
|
- value: function withLang(lang) {
|
|
|
- lang && (this.lang = lang);
|
|
|
- return this;
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "pjaxResponded",
|
|
|
- value: function pjaxResponded() {
|
|
|
- _pjaxResponded = true;
|
|
|
- return this;
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "submiting",
|
|
|
- value: function submiting(callback) {
|
|
|
- typeof callback == 'function' && formCallbacks.before.push(callback);
|
|
|
- return this;
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "submitted",
|
|
|
- value: function submitted(success, error) {
|
|
|
- typeof success == 'function' && formCallbacks.success.push(success);
|
|
|
- typeof error == 'function' && formCallbacks.error.push(error);
|
|
|
- return this;
|
|
|
- }
|
|
|
- }]);
|
|
|
-
|
|
|
- return Dcat;
|
|
|
-}();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-/***/ }),
|
|
|
-
|
|
|
-/***/ "./resources/assets/dcat/bootstrappers/Footer.js":
|
|
|
-/*!*******************************************************!*\
|
|
|
- !*** ./resources/assets/dcat/bootstrappers/Footer.js ***!
|
|
|
- \*******************************************************/
|
|
|
-/*! exports provided: default */
|
|
|
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
-
|
|
|
-"use strict";
|
|
|
-__webpack_require__.r(__webpack_exports__);
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Footer; });
|
|
|
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
-
|
|
|
-function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
-
|
|
|
-function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
-
|
|
|
-var Footer = /*#__PURE__*/function () {
|
|
|
- function Footer(Dcat) {
|
|
|
- _classCallCheck(this, Footer);
|
|
|
-
|
|
|
- Dcat.booting(this.bootScrollTop);
|
|
|
- }
|
|
|
-
|
|
|
- _createClass(Footer, [{
|
|
|
- key: "bootScrollTop",
|
|
|
- value: function bootScrollTop() {
|
|
|
- $(window).scroll(function () {
|
|
|
- if ($(this).scrollTop() > 400) {
|
|
|
- $('.scroll-top').fadeIn();
|
|
|
- } else {
|
|
|
- $('.scroll-top').fadeOut();
|
|
|
- }
|
|
|
- }); //Click event to scroll to top
|
|
|
-
|
|
|
- $('.scroll-top').click(function () {
|
|
|
- $('html, body').animate({
|
|
|
- scrollTop: 0
|
|
|
- }, 1000);
|
|
|
- });
|
|
|
- }
|
|
|
- }]);
|
|
|
-
|
|
|
- return Footer;
|
|
|
-}();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-/***/ }),
|
|
|
-
|
|
|
-/***/ "./resources/assets/dcat/bootstrappers/Pjax.js":
|
|
|
-/*!*****************************************************!*\
|
|
|
- !*** ./resources/assets/dcat/bootstrappers/Pjax.js ***!
|
|
|
- \*****************************************************/
|
|
|
-/*! exports provided: default */
|
|
|
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
-
|
|
|
-"use strict";
|
|
|
-__webpack_require__.r(__webpack_exports__);
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Pjax; });
|
|
|
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
-
|
|
|
-function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
-
|
|
|
-function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
-
|
|
|
-var $d = $(document);
|
|
|
-
|
|
|
-var Pjax = /*#__PURE__*/function () {
|
|
|
- function Pjax(Dcat) {
|
|
|
- _classCallCheck(this, Pjax);
|
|
|
-
|
|
|
- Dcat.booting(function () {
|
|
|
- this.boot(Dcat);
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- _createClass(Pjax, [{
|
|
|
- key: "boot",
|
|
|
- value: function boot(Dcat) {
|
|
|
- $d.pjax('a:not(a[target="_blank"])', '#pjax-container', {
|
|
|
- fragment: 'body'
|
|
|
- });
|
|
|
- NP.configure({
|
|
|
- parent: Dcat.pjaxContainer
|
|
|
- });
|
|
|
- $d.on('pjax:timeout', function (event) {
|
|
|
- event.preventDefault();
|
|
|
- });
|
|
|
- $d.on('submit', 'form[pjax-container]', function (event) {
|
|
|
- $.pjax.submit(event, '#pjax-container');
|
|
|
- });
|
|
|
- $d.on("pjax:popstate", function () {
|
|
|
- $d.one("pjax:end", function (event) {
|
|
|
- $(event.target).find("script[data-exec-on-popstate]").each(function () {
|
|
|
- $.globalEval(this.text || this.textContent || this.innerHTML || '');
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
- $d.on('pjax:send', function (xhr) {
|
|
|
- if (xhr.relatedTarget && xhr.relatedTarget.tagName && xhr.relatedTarget.tagName.toLowerCase() === 'form') {
|
|
|
- var $submit_btn = $('form[pjax-container] :submit');
|
|
|
-
|
|
|
- if ($submit_btn) {
|
|
|
- $submit_btn.button('loading');
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- NP.start();
|
|
|
- });
|
|
|
- $d.on('pjax:complete', function (xhr) {
|
|
|
- if (xhr.relatedTarget && xhr.relatedTarget.tagName && xhr.relatedTarget.tagName.toLowerCase() === 'form') {
|
|
|
- var $submit_btn = $('form[pjax-container] :submit');
|
|
|
-
|
|
|
- if ($submit_btn) {
|
|
|
- $submit_btn.button('reset');
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- NP.done();
|
|
|
- }); // 新页面加载,重新初始化
|
|
|
-
|
|
|
- $d.on('pjax:loaded', Dcat.boot);
|
|
|
- }
|
|
|
- }]);
|
|
|
-
|
|
|
- return Pjax;
|
|
|
-}();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-/***/ }),
|
|
|
-
|
|
|
/***/ "./resources/assets/dcat/dcat-bootstrap.js":
|
|
|
/*!*************************************************!*\
|
|
|
!*** ./resources/assets/dcat/dcat-bootstrap.js ***!
|
|
|
\*************************************************/
|
|
|
/*! no exports provided */
|
|
|
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
-
|
|
|
-"use strict";
|
|
|
-__webpack_require__.r(__webpack_exports__);
|
|
|
-/* harmony import */ var _Dcat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Dcat */ "./resources/assets/dcat/Dcat.js");
|
|
|
-/* harmony import */ var _extensions_Ajax__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./extensions/Ajax */ "./resources/assets/dcat/extensions/Ajax.js");
|
|
|
-/* harmony import */ var _extensions_Dialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./extensions/Dialog */ "./resources/assets/dcat/extensions/Dialog.js");
|
|
|
-/* harmony import */ var _bootstrappers_Footer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bootstrappers/Footer */ "./resources/assets/dcat/bootstrappers/Footer.js");
|
|
|
-/* harmony import */ var _bootstrappers_Pjax__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bootstrappers/Pjax */ "./resources/assets/dcat/bootstrappers/Pjax.js");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-var $ = jQuery,
|
|
|
- extend = function extend(Dcat) {
|
|
|
- // 扩展Dcat对象
|
|
|
- new _extensions_Ajax__WEBPACK_IMPORTED_MODULE_1__["default"](Dcat);
|
|
|
- new _extensions_Dialog__WEBPACK_IMPORTED_MODULE_2__["default"](Dcat);
|
|
|
-},
|
|
|
- on = function on(Dcat) {
|
|
|
- // 初始化
|
|
|
- new _bootstrappers_Footer__WEBPACK_IMPORTED_MODULE_3__["default"](Dcat);
|
|
|
- new _bootstrappers_Pjax__WEBPACK_IMPORTED_MODULE_4__["default"](Dcat);
|
|
|
-},
|
|
|
- boot = function boot(Dcat) {
|
|
|
- extend(Dcat);
|
|
|
- on(Dcat);
|
|
|
- $(Dcat.boot);
|
|
|
- return Dcat;
|
|
|
-};
|
|
|
-
|
|
|
-(function () {
|
|
|
- this.CreateDcat = function (config) {
|
|
|
- return boot(new _Dcat__WEBPACK_IMPORTED_MODULE_0__["default"](config));
|
|
|
- };
|
|
|
-}).call(window);
|
|
|
-
|
|
|
-/***/ }),
|
|
|
-
|
|
|
-/***/ "./resources/assets/dcat/extensions/Ajax.js":
|
|
|
-/*!**************************************************!*\
|
|
|
- !*** ./resources/assets/dcat/extensions/Ajax.js ***!
|
|
|
- \**************************************************/
|
|
|
-/*! exports provided: default */
|
|
|
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
-
|
|
|
-"use strict";
|
|
|
-__webpack_require__.r(__webpack_exports__);
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Ajax; });
|
|
|
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
-
|
|
|
-function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
-
|
|
|
-function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
-
|
|
|
-var Ajax = /*#__PURE__*/function () {
|
|
|
- function Ajax(Dcat) {
|
|
|
- _classCallCheck(this, Ajax);
|
|
|
-
|
|
|
- this.Dcat = Dcat;
|
|
|
- this.extend(Dcat);
|
|
|
- }
|
|
|
-
|
|
|
- _createClass(Ajax, [{
|
|
|
- key: "extend",
|
|
|
- value: function extend(Dcat) {
|
|
|
- Dcat.handleAjaxError = this.handleAjaxError;
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "handleAjaxError",
|
|
|
- value: function handleAjaxError(xhr, text, msg) {
|
|
|
- var Dcat = this.Dcat;
|
|
|
- Dcat.NP.done();
|
|
|
- Dcat.loading(false); // 关闭所有loading效果
|
|
|
-
|
|
|
- var json = xhr.responseJSON || {},
|
|
|
- _msg = json.message;
|
|
|
-
|
|
|
- switch (xhr.status) {
|
|
|
- case 500:
|
|
|
- return Dcat.error(_msg || Dcat.lang['500'] || 'Server internal error.');
|
|
|
-
|
|
|
- case 403:
|
|
|
- return Dcat.error(_msg || Dcat.lang['403'] || 'Permission deny!');
|
|
|
-
|
|
|
- case 401:
|
|
|
- if (json.login) {
|
|
|
- return location.href = json.login;
|
|
|
- }
|
|
|
-
|
|
|
- return Dcat.error(Dcat.lang['401'] || 'Unauthorized.');
|
|
|
-
|
|
|
- case 419:
|
|
|
- return Dcat.error(Dcat.lang['419'] || 'Sorry, your page has expired.');
|
|
|
-
|
|
|
- case 422:
|
|
|
- if (json.errors) {
|
|
|
- try {
|
|
|
- var err = [],
|
|
|
- i;
|
|
|
-
|
|
|
- for (i in json.errors) {
|
|
|
- err.push(json.errors[i].join('<br/>'));
|
|
|
- }
|
|
|
-
|
|
|
- Dcat.error(err.join('<br/>'));
|
|
|
- } catch (e) {}
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- Dcat.error(_msg || xhr.status + ' ' + msg);
|
|
|
- }
|
|
|
- }]);
|
|
|
-
|
|
|
- return Ajax;
|
|
|
-}();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-/***/ }),
|
|
|
-
|
|
|
-/***/ "./resources/assets/dcat/extensions/Dialog.js":
|
|
|
-/*!****************************************************!*\
|
|
|
- !*** ./resources/assets/dcat/extensions/Dialog.js ***!
|
|
|
- \****************************************************/
|
|
|
-/*! exports provided: default */
|
|
|
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
-
|
|
|
-"use strict";
|
|
|
-__webpack_require__.r(__webpack_exports__);
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Dialog; });
|
|
|
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
-
|
|
|
-function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
-
|
|
|
-function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
-
|
|
|
-var Dialog = /*#__PURE__*/function () {
|
|
|
- function Dialog(Dcat) {
|
|
|
- _classCallCheck(this, Dialog);
|
|
|
-
|
|
|
- this.extend(Dcat);
|
|
|
- }
|
|
|
-
|
|
|
- _createClass(Dialog, [{
|
|
|
- key: "extend",
|
|
|
- value: function extend(Dcat) {
|
|
|
- var _this = this;
|
|
|
-
|
|
|
- Dcat.success = _this.success;
|
|
|
- Dcat.error = _this.error;
|
|
|
- Dcat.info = _this.info;
|
|
|
- Dcat.warning = _this.warning;
|
|
|
- Dcat.confirm = _this.confirm;
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "success",
|
|
|
- value: function success(message, title, options) {
|
|
|
- toastr.success(message, title, options);
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "error",
|
|
|
- value: function error(message, title, options) {
|
|
|
- toastr.error(message, title, options);
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "info",
|
|
|
- value: function info(message, title, options) {
|
|
|
- toastr.info(message, title, options);
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "warning",
|
|
|
- value: function warning(message, title, options) {
|
|
|
- toastr.warning(message, title, options);
|
|
|
- }
|
|
|
- }, {
|
|
|
- key: "confirm",
|
|
|
- value: function confirm(message, title, success, error, options) {}
|
|
|
- }]);
|
|
|
-
|
|
|
- return Dialog;
|
|
|
-}();
|
|
|
-
|
|
|
+/***/ (function(module, exports) {
|
|
|
|
|
|
+throw new Error("Module build failed (from ./node_modules/babel-loader/lib/index.js):\nError: ENOENT: no such file or directory, open 'F:\\p\\dcat-admin-github\\dcat-admin\\resources\\assets\\dcat\\dcat-bootstrap.js'");
|
|
|
|
|
|
/***/ }),
|
|
|
|