| 1 |
"use strict"; |
| 2 |
(self["webpackChunkadminify"] = self["webpackChunkadminify"] || []).push([["/assets/admin/js/wp-adminify--folder"],{ |
| 3 |
|
| 4 |
/***/ "./dev/admin/modules/folder/folder.js": |
| 5 |
/*!********************************************!*\ |
| 6 |
!*** ./dev/admin/modules/folder/folder.js ***! |
| 7 |
\********************************************/ |
| 8 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 9 |
|
| 10 |
__webpack_require__.r(__webpack_exports__); |
| 11 |
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm.js"); |
| 12 |
|
| 13 |
vue__WEBPACK_IMPORTED_MODULE_0__["default"].component('folder-app', (__webpack_require__(/*! ./folder-app.vue */ "./dev/admin/modules/folder/folder-app.vue")["default"])); |
| 14 |
vue__WEBPACK_IMPORTED_MODULE_0__["default"].component('folders', (__webpack_require__(/*! ./components/folders.vue */ "./dev/admin/modules/folder/components/folders.vue")["default"])); |
| 15 |
jQuery(function ($) { |
| 16 |
if ($('#wp-adminify--folder-app').length) { |
| 17 |
new vue__WEBPACK_IMPORTED_MODULE_0__["default"]({ |
| 18 |
el: '#wp-adminify--folder-app', |
| 19 |
template: '<folder-app></folder-app>' |
| 20 |
}); |
| 21 |
} |
| 22 |
}); |
| 23 |
|
| 24 |
/***/ }), |
| 25 |
|
| 26 |
/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./dev/admin/modules/folder/components/folders.vue?vue&type=script&lang=js&": |
| 27 |
/*!**************************************************************************************************************************************************************************************************************************!*\ |
| 28 |
!*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./dev/admin/modules/folder/components/folders.vue?vue&type=script&lang=js& ***! |
| 29 |
\**************************************************************************************************************************************************************************************************************************/ |
| 30 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 31 |
|
| 32 |
__webpack_require__.r(__webpack_exports__); |
| 33 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 34 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 35 |
/* harmony export */ }); |
| 36 |
// |
| 37 |
// |
| 38 |
// |
| 39 |
// |
| 40 |
// |
| 41 |
// |
| 42 |
// |
| 43 |
// |
| 44 |
// |
| 45 |
// |
| 46 |
// |
| 47 |
// |
| 48 |
// |
| 49 |
// |
| 50 |
// |
| 51 |
// |
| 52 |
// |
| 53 |
// |
| 54 |
// |
| 55 |
// |
| 56 |
// |
| 57 |
// |
| 58 |
// |
| 59 |
// |
| 60 |
// |
| 61 |
// |
| 62 |
// |
| 63 |
// |
| 64 |
// |
| 65 |
// |
| 66 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ |
| 67 |
props: { |
| 68 |
folders: { |
| 69 |
type: Array, |
| 70 |
required: true |
| 71 |
}, |
| 72 |
folder_select_toggle: { |
| 73 |
type: Boolean, |
| 74 |
required: true |
| 75 |
} |
| 76 |
}, |
| 77 |
methods: { |
| 78 |
is_folder: function is_folder(_folder) { |
| 79 |
return this.$parent.is_folder(_folder); |
| 80 |
}, |
| 81 |
get_folder_url: function get_folder_url(_folder) { |
| 82 |
return this.$parent.get_folder_url(_folder); |
| 83 |
}, |
| 84 |
folderActions: function folderActions($event, _folder) { |
| 85 |
this.$parent.folderActions($event, _folder); |
| 86 |
}, |
| 87 |
showRenameFolderPopup: function showRenameFolderPopup(_folder) { |
| 88 |
this.$parent.showRenameFolderPopup(_folder); |
| 89 |
}, |
| 90 |
showDeleteFolderPopup: function showDeleteFolderPopup(_folder) { |
| 91 |
this.$parent.showDeleteFolderPopup(_folder); |
| 92 |
}, |
| 93 |
showNewSubFolderPopup: function showNewSubFolderPopup(_folder) { |
| 94 |
this.$parent.showNewSubFolderPopup(_folder); |
| 95 |
} |
| 96 |
} |
| 97 |
}); |
| 98 |
|
| 99 |
/***/ }), |
| 100 |
|
| 101 |
/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./dev/admin/modules/folder/folder-app.vue?vue&type=script&lang=js&": |
| 102 |
/*!******************************************************************************************************************************************************************************************************************!*\ |
| 103 |
!*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./dev/admin/modules/folder/folder-app.vue?vue&type=script&lang=js& ***! |
| 104 |
\******************************************************************************************************************************************************************************************************************/ |
| 105 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 106 |
|
| 107 |
__webpack_require__.r(__webpack_exports__); |
| 108 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 109 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 110 |
/* harmony export */ }); |
| 111 |
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); |
| 112 |
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__); |
| 113 |
/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! js-cookie */ "./node_modules/js-cookie/dist/js.cookie.mjs"); |
| 114 |
|
| 115 |
|
| 116 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } |
| 117 |
|
| 118 |
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } |
| 119 |
|
| 120 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 121 |
|
| 122 |
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 123 |
|
| 124 |
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 125 |
|
| 126 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 127 |
|
| 128 |
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } |
| 129 |
|
| 130 |
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } |
| 131 |
|
| 132 |
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } |
| 133 |
|
| 134 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 135 |
|
| 136 |
// |
| 137 |
// |
| 138 |
// |
| 139 |
// |
| 140 |
// |
| 141 |
// |
| 142 |
// |
| 143 |
// |
| 144 |
// |
| 145 |
// |
| 146 |
// |
| 147 |
// |
| 148 |
// |
| 149 |
// |
| 150 |
// |
| 151 |
// |
| 152 |
// |
| 153 |
// |
| 154 |
// |
| 155 |
// |
| 156 |
// |
| 157 |
// |
| 158 |
// |
| 159 |
// |
| 160 |
// |
| 161 |
// |
| 162 |
// |
| 163 |
// |
| 164 |
// |
| 165 |
// |
| 166 |
// |
| 167 |
// |
| 168 |
// |
| 169 |
// |
| 170 |
// |
| 171 |
// |
| 172 |
// |
| 173 |
// |
| 174 |
// |
| 175 |
// |
| 176 |
// |
| 177 |
// |
| 178 |
// |
| 179 |
// |
| 180 |
// |
| 181 |
// |
| 182 |
// |
| 183 |
// |
| 184 |
// |
| 185 |
// |
| 186 |
// |
| 187 |
// |
| 188 |
// |
| 189 |
// |
| 190 |
// |
| 191 |
// |
| 192 |
// |
| 193 |
// |
| 194 |
// |
| 195 |
// |
| 196 |
// |
| 197 |
// |
| 198 |
// |
| 199 |
// |
| 200 |
// |
| 201 |
// |
| 202 |
// |
| 203 |
// |
| 204 |
// |
| 205 |
// |
| 206 |
// |
| 207 |
// |
| 208 |
// |
| 209 |
// |
| 210 |
// |
| 211 |
// |
| 212 |
// |
| 213 |
// |
| 214 |
// |
| 215 |
// |
| 216 |
// |
| 217 |
// |
| 218 |
// |
| 219 |
// |
| 220 |
// |
| 221 |
// |
| 222 |
// |
| 223 |
// |
| 224 |
// |
| 225 |
// |
| 226 |
// |
| 227 |
// |
| 228 |
// |
| 229 |
// |
| 230 |
// |
| 231 |
// |
| 232 |
// |
| 233 |
// |
| 234 |
// |
| 235 |
// |
| 236 |
// |
| 237 |
// |
| 238 |
// |
| 239 |
// |
| 240 |
// |
| 241 |
// |
| 242 |
// |
| 243 |
// |
| 244 |
// |
| 245 |
// |
| 246 |
// |
| 247 |
// |
| 248 |
// |
| 249 |
// |
| 250 |
// |
| 251 |
// |
| 252 |
// |
| 253 |
// |
| 254 |
// |
| 255 |
// |
| 256 |
// |
| 257 |
// |
| 258 |
// |
| 259 |
// |
| 260 |
// |
| 261 |
// |
| 262 |
// |
| 263 |
// |
| 264 |
// |
| 265 |
// |
| 266 |
// |
| 267 |
// |
| 268 |
// |
| 269 |
// |
| 270 |
// |
| 271 |
// |
| 272 |
// |
| 273 |
// |
| 274 |
// |
| 275 |
// |
| 276 |
// |
| 277 |
// |
| 278 |
// |
| 279 |
// |
| 280 |
// |
| 281 |
// |
| 282 |
// |
| 283 |
// |
| 284 |
// |
| 285 |
// |
| 286 |
// |
| 287 |
// |
| 288 |
// |
| 289 |
// |
| 290 |
// |
| 291 |
// |
| 292 |
// |
| 293 |
// |
| 294 |
// |
| 295 |
// |
| 296 |
// |
| 297 |
// |
| 298 |
// |
| 299 |
// |
| 300 |
// |
| 301 |
// |
| 302 |
// |
| 303 |
// |
| 304 |
// |
| 305 |
// |
| 306 |
// |
| 307 |
// |
| 308 |
// |
| 309 |
// |
| 310 |
// |
| 311 |
// |
| 312 |
// |
| 313 |
// |
| 314 |
// |
| 315 |
// |
| 316 |
// |
| 317 |
// |
| 318 |
// |
| 319 |
// |
| 320 |
// |
| 321 |
// |
| 322 |
// |
| 323 |
// |
| 324 |
// |
| 325 |
// |
| 326 |
// |
| 327 |
// |
| 328 |
// |
| 329 |
// |
| 330 |
// |
| 331 |
// |
| 332 |
// |
| 333 |
// |
| 334 |
// |
| 335 |
// |
| 336 |
// |
| 337 |
// |
| 338 |
// |
| 339 |
// |
| 340 |
// |
| 341 |
// |
| 342 |
// |
| 343 |
// |
| 344 |
// |
| 345 |
|
| 346 |
var $ = jQuery; |
| 347 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ |
| 348 |
data: function data() { |
| 349 |
var _ref; |
| 350 |
|
| 351 |
return _ref = { |
| 352 |
post_type: '', |
| 353 |
post_type_tax: '', |
| 354 |
folders: [], |
| 355 |
posts: {}, |
| 356 |
filter_folder: '', |
| 357 |
total_uncat_posts: '' |
| 358 |
}, _defineProperty(_ref, "total_uncat_posts", ''), _defineProperty(_ref, "folder_select_toggle", false), _defineProperty(_ref, "create_folder_popup", false), _defineProperty(_ref, "new_folder_name", null), _defineProperty(_ref, "create_folder_error", null), _defineProperty(_ref, "rename_folder_popup", false), _defineProperty(_ref, "rename_folder_name", null), _defineProperty(_ref, "rename_folder_error", null), _defineProperty(_ref, "delete_folder_popup", false), _defineProperty(_ref, "delete_folder_error", null), _defineProperty(_ref, "move_to_folder_popup", false), _defineProperty(_ref, "color_tags", ['#7B61FF', '#0347FF', '#F24AE1', '#ED2E7E', '#FFC804', '#00BA88']), _defineProperty(_ref, "active_color_tag", '#7B61FF'), _defineProperty(_ref, "currentView", 'all'), _defineProperty(_ref, "sort", 'a-z'), _defineProperty(_ref, "is_pro", !!wp_adminify__folder_data.is_pro), _defineProperty(_ref, "pro_notice", wp_adminify__folder_data.pro_notice), _defineProperty(_ref, "total_posts", { |
| 359 |
'auto-draft': 0, |
| 360 |
'draft': 0, |
| 361 |
'future': 0, |
| 362 |
'inherit': 0, |
| 363 |
'pending': 0, |
| 364 |
'private': 0, |
| 365 |
'publish': 0, |
| 366 |
'request-completed': 0, |
| 367 |
'request-confirmed': 0, |
| 368 |
'request-failed': 0, |
| 369 |
'request-pending': 0, |
| 370 |
'trash': 0 |
| 371 |
}), _ref; |
| 372 |
}, |
| 373 |
mounted: function mounted() { |
| 374 |
this.post_type = wp_adminify__folder_data.post_type; |
| 375 |
this.post_type_tax = wp_adminify__folder_data.post_type_tax; |
| 376 |
this.folders = wp_adminify__folder_data.folders; |
| 377 |
this.total_posts = wp_adminify__folder_data.total_posts; |
| 378 |
this.total_uncat_posts = wp_adminify__folder_data.total_uncat_posts; |
| 379 |
this._active_color_tag = this.active_color_tag; |
| 380 |
this.adminurl = wp_adminify__folder_data.adminurl; |
| 381 |
this.folder_hierarchy = wp_adminify__folder_data.folder_hierarchy; |
| 382 |
this.folders_to_edit = []; |
| 383 |
var sort = js_cookie__WEBPACK_IMPORTED_MODULE_1__["default"].get(this.post_type_tax + '__sort'); |
| 384 |
if (sort) this.sort = sort; |
| 385 |
this.init_folder_events(); |
| 386 |
$(function () { |
| 387 |
this.init_draggable_events(); |
| 388 |
this.init_droppable_events(); |
| 389 |
this.reset_on_other_ajax_events(); |
| 390 |
this.init_submenu_events(); |
| 391 |
this.set_posts_folders(); |
| 392 |
}.bind(this)); |
| 393 |
}, |
| 394 |
methods: { |
| 395 |
set_posts_folders: function set_posts_folders() { |
| 396 |
var that = this; |
| 397 |
$('#the-list .adminify-move-file').each(function () { |
| 398 |
var id = $(this).data('id'); |
| 399 |
var folders = $(this).data('folders'); |
| 400 |
folders = folders ? String(folders).split(',').map(function (folder) { |
| 401 |
return Number(folder); |
| 402 |
}) : []; |
| 403 |
that.posts[id] = folders; |
| 404 |
}); |
| 405 |
}, |
| 406 |
get_folder_by_id: function get_folder_by_id(id) { |
| 407 |
return this.folders.find(function (folder) { |
| 408 |
return folder.term_id == id; |
| 409 |
}); |
| 410 |
}, |
| 411 |
get_folder_ids_by_post_id: function get_folder_ids_by_post_id(post_id) { |
| 412 |
return this.posts[post_id]; |
| 413 |
}, |
| 414 |
init_submenu_events: function init_submenu_events() { |
| 415 |
$('.folder--actions .has--sub-menu > a').on('click', function (event) { |
| 416 |
event.preventDefault(); |
| 417 |
event.stopImmediatePropagation(); |
| 418 |
$(this).parent().toggleClass('sub-menu--open'); |
| 419 |
}); |
| 420 |
$('body').on('click', function () { |
| 421 |
$('.has--sub-menu.sub-menu--open').removeClass('sub-menu--open'); |
| 422 |
}); |
| 423 |
}, |
| 424 |
reset_on_other_ajax_events: function reset_on_other_ajax_events() { |
| 425 |
var _this3 = this; |
| 426 |
|
| 427 |
$(document).ajaxComplete(function (event, xhr, settings) { |
| 428 |
var _this2 = this; |
| 429 |
|
| 430 |
if (settings.dataType == 'html') { |
| 431 |
return this.init_draggable_events(); |
| 432 |
} |
| 433 |
|
| 434 |
if (!settings.data) return; |
| 435 |
var accepted = ['inline-save', 'query-attachments', 'delete-post'].some(function (_action) { |
| 436 |
return settings.data.indexOf("action=".concat(_action)) != -1; |
| 437 |
}); |
| 438 |
|
| 439 |
if (accepted) { |
| 440 |
setTimeout(function () { |
| 441 |
_this2.init_draggable_events(); |
| 442 |
|
| 443 |
_this2.refresh_folders_data_ajax(); |
| 444 |
}, 100); |
| 445 |
} |
| 446 |
}.bind(this)); |
| 447 |
|
| 448 |
if (wp.Uploader && wp.Uploader.queue) { |
| 449 |
wp.Uploader.queue.on('reset', function () { |
| 450 |
_this3.init_draggable_events(); |
| 451 |
|
| 452 |
_this3.refresh_folders_data_ajax(); |
| 453 |
}); |
| 454 |
} |
| 455 |
}, |
| 456 |
init_folder_events: function init_folder_events() { |
| 457 |
var that = this; |
| 458 |
|
| 459 |
if (wp.media) { |
| 460 |
var AttachmentsView = wp.media.view.Attachments; |
| 461 |
wp.media.view.Attachments = AttachmentsView.extend({ |
| 462 |
initialize: function initialize() { |
| 463 |
var _this = this; |
| 464 |
|
| 465 |
AttachmentsView.prototype.initialize.apply(this, arguments); |
| 466 |
$('.folder--lists, .folder--stats').on('click', 'li a', function (event) { |
| 467 |
event.preventDefault(); |
| 468 |
var url = $(this).attr('href'); |
| 469 |
|
| 470 |
if ($('.attachments-browser .attachments').length) { |
| 471 |
_this.model.get('library').props.set('media_folder', that.getUrlParameter(url, 'media_folder')); |
| 472 |
|
| 473 |
var state = that.getUrlParameter(url); |
| 474 |
window.history.pushState(state, '', url); |
| 475 |
} |
| 476 |
}); |
| 477 |
} |
| 478 |
}); |
| 479 |
} else { |
| 480 |
$('.folder--lists, .folder--stats').on('click', 'li a', function (event) { |
| 481 |
event.preventDefault(); |
| 482 |
var url = $(this).attr('href'); |
| 483 |
$('.folder--lists, .folder--stats').find('li').removeClass('active'); |
| 484 |
$(this).closest('li').addClass('active'); |
| 485 |
|
| 486 |
if ($('#the-list').length) { |
| 487 |
$('#the-list').load("".concat(url, " #the-list > tr")); |
| 488 |
var state = that.getUrlParameter(url); |
| 489 |
window.history.pushState(state, '', url); |
| 490 |
} |
| 491 |
}); |
| 492 |
} |
| 493 |
}, |
| 494 |
folderActions: function folderActions(event, folder) { |
| 495 |
event.preventDefault(); |
| 496 |
this.folders.forEach(function (_folder) { |
| 497 |
_folder.contexted = false; |
| 498 |
}); |
| 499 |
folder.contexted = true; |
| 500 |
$('.folder--lists li').removeClass('sub-menu--open'); |
| 501 |
$(event.target).closest('li').addClass('sub-menu--open'); |
| 502 |
}, |
| 503 |
get_active_folder: function get_active_folder() { |
| 504 |
return $('.folder--lists li.active').toArray().map(function (_folder_dom) { |
| 505 |
return $(_folder_dom).data('folder'); |
| 506 |
}); |
| 507 |
}, |
| 508 |
is_folder: function is_folder(folder) { |
| 509 |
// let URLParams = new URLSearchParams( window.location.href ); |
| 510 |
// let currentFolder = URLParams.get( 'folder' ); |
| 511 |
// if ( folder == 'all' && ! currentFolder ) return true; |
| 512 |
// if ( this.get_folder_url( ) == currentFolder ) return true; |
| 513 |
// return false; |
| 514 |
var currenturl = window.location.href; |
| 515 |
if (folder == 'all' && currenturl.indexOf(wp_adminify__folder_data.post_type_tax) > -1) return false; |
| 516 |
return currenturl == this.get_folder_url(folder); |
| 517 |
}, |
| 518 |
getUrlParameter: function getUrlParameter(querystring, sParam) { |
| 519 |
querystring = querystring.substring(querystring.indexOf('?') + 1); |
| 520 |
var params = new URLSearchParams(querystring); |
| 521 |
var obj = {}; |
| 522 |
|
| 523 |
var _iterator = _createForOfIteratorHelper(params.keys()), |
| 524 |
_step; |
| 525 |
|
| 526 |
try { |
| 527 |
for (_iterator.s(); !(_step = _iterator.n()).done;) { |
| 528 |
var key = _step.value; |
| 529 |
|
| 530 |
if (params.getAll(key).length > 1) { |
| 531 |
obj[key] = params.getAll(key); |
| 532 |
} else { |
| 533 |
obj[key] = params.get(key); |
| 534 |
} |
| 535 |
} |
| 536 |
} catch (err) { |
| 537 |
_iterator.e(err); |
| 538 |
} finally { |
| 539 |
_iterator.f(); |
| 540 |
} |
| 541 |
|
| 542 |
if (sParam) { |
| 543 |
if (sParam in obj) return obj[sParam]; |
| 544 |
return ''; |
| 545 |
} |
| 546 |
|
| 547 |
return obj; |
| 548 |
}, |
| 549 |
get_folder_url: function get_folder_url(folder) { |
| 550 |
var queryStrings = location.search; |
| 551 |
var searchParams = new URLSearchParams(queryStrings); |
| 552 |
var postType = searchParams.get('post_type'); |
| 553 |
var baseURL = new URL(location.protocol + '//' + location.host + location.pathname); |
| 554 |
if (postType) baseURL.searchParams.set('post_type', postType); |
| 555 |
|
| 556 |
if (folder !== 'all') { |
| 557 |
var folderSlug = folder == 'uncategorized' ? '-1' : folder.slug; |
| 558 |
baseURL.searchParams.set(this.post_type_tax, folderSlug); |
| 559 |
} |
| 560 |
|
| 561 |
var _iterator2 = _createForOfIteratorHelper(searchParams.entries()), |
| 562 |
_step2; |
| 563 |
|
| 564 |
try { |
| 565 |
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { |
| 566 |
var _step2$value = _slicedToArray(_step2.value, 2), |
| 567 |
key = _step2$value[0], |
| 568 |
value = _step2$value[1]; |
| 569 |
|
| 570 |
if (key == 'post_type') continue; |
| 571 |
if (key == this.post_type_tax) continue; |
| 572 |
baseURL.searchParams.set(key, value); |
| 573 |
} |
| 574 |
} catch (err) { |
| 575 |
_iterator2.e(err); |
| 576 |
} finally { |
| 577 |
_iterator2.f(); |
| 578 |
} |
| 579 |
|
| 580 |
return baseURL.toJSON(); |
| 581 |
}, |
| 582 |
showPopupOverlay: function showPopupOverlay() { |
| 583 |
$('body').addClass('wp-adminify--popup-show'); |
| 584 |
}, |
| 585 |
hidePopupOverlay: function hidePopupOverlay() { |
| 586 |
$('body').removeClass('wp-adminify--popup-show'); |
| 587 |
}, |
| 588 |
showNewFolderPopup: function showNewFolderPopup() { |
| 589 |
this.showPopupOverlay(); |
| 590 |
this.create_folder_popup = true; |
| 591 |
this.parent_folder = null; |
| 592 |
this.active_color_tag = this.color_tags[0]; |
| 593 |
this._active_color_tag = this.active_color_tag; |
| 594 |
}, |
| 595 |
showNewSubFolderPopup: function showNewSubFolderPopup(folder) { |
| 596 |
this.showPopupOverlay(); |
| 597 |
this.create_folder_popup = true; |
| 598 |
this.parent_folder = folder.term_id; |
| 599 |
this.active_color_tag = this.color_tags[0]; |
| 600 |
this._active_color_tag = this.active_color_tag; |
| 601 |
}, |
| 602 |
showRenameFolderPopup: function showRenameFolderPopup() { |
| 603 |
var _this4 = this; |
| 604 |
|
| 605 |
var folder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; |
| 606 |
|
| 607 |
// Set Editable Folders |
| 608 |
if (folder && folder.term_id) { |
| 609 |
this.folders_to_edit = [folder]; |
| 610 |
} else if (this.get_active_folder().length) { |
| 611 |
this.folders_to_edit = [this.folders.find(function (_folder) { |
| 612 |
return _folder.term_id == _this4.get_active_folder()[0]; |
| 613 |
})]; |
| 614 |
} else { |
| 615 |
this.folders_to_edit = null; |
| 616 |
} |
| 617 |
|
| 618 |
if (!this.folders_to_edit || !this.folders_to_edit.length) return; |
| 619 |
folder = this.folders_to_edit[0]; |
| 620 |
this._rename_folder_name = folder.name; |
| 621 |
this.rename_folder_name = folder.name; |
| 622 |
this.active_color_tag = folder.color; |
| 623 |
this._active_color_tag = this.active_color_tag; |
| 624 |
this.showPopupOverlay(); |
| 625 |
this.rename_folder_popup = true; |
| 626 |
}, |
| 627 |
showDeleteFolderPopup: function showDeleteFolderPopup() { |
| 628 |
var _this5 = this; |
| 629 |
|
| 630 |
var folder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; |
| 631 |
|
| 632 |
// Set Editable Folders |
| 633 |
if (folder && folder.term_id) { |
| 634 |
this.folders_to_edit = [folder]; |
| 635 |
} else if (this.folder_select_toggle) { |
| 636 |
this.folders_to_edit = this.folders.filter(function (_folder) { |
| 637 |
return _folder.selected; |
| 638 |
}); |
| 639 |
} else if (this.get_active_folder().length) { |
| 640 |
this.folders_to_edit = [this.folders.find(function (_folder) { |
| 641 |
return _folder.term_id == _this5.get_active_folder()[0]; |
| 642 |
})]; |
| 643 |
} else { |
| 644 |
this.folders_to_edit = null; |
| 645 |
} |
| 646 |
|
| 647 |
if (!this.folders_to_edit || !this.folders_to_edit.length) return; |
| 648 |
this.showPopupOverlay(); |
| 649 |
this.delete_folder_popup = true; |
| 650 |
}, |
| 651 |
hide_rename_folder_popup: function hide_rename_folder_popup() { |
| 652 |
this.hidePopupOverlay(); |
| 653 |
this.rename_folder_popup = false; |
| 654 |
this.rename_folder_error = null; |
| 655 |
}, |
| 656 |
hide_delete_folder_popup: function hide_delete_folder_popup() { |
| 657 |
this.hidePopupOverlay(); |
| 658 |
this.delete_folder_popup = false; |
| 659 |
this.delete_folder_error = null; |
| 660 |
}, |
| 661 |
hide_move_to_folder_popup: function hide_move_to_folder_popup() { |
| 662 |
this.hidePopupOverlay(); |
| 663 |
this.move_to_folder_popup = false; |
| 664 |
}, |
| 665 |
hide_create_folder_popup: function hide_create_folder_popup() { |
| 666 |
this.hidePopupOverlay(); |
| 667 |
this.create_folder_popup = false; |
| 668 |
this.new_folder_name = null; |
| 669 |
this.create_folder_error = null; |
| 670 |
this.active_color_tag = this._active_color_tag; |
| 671 |
}, |
| 672 |
saveNewFolder: function saveNewFolder() { |
| 673 |
var _this = this; |
| 674 |
|
| 675 |
var data = { |
| 676 |
post_type: wp_adminify__folder_data.post_type, |
| 677 |
post_type_tax: wp_adminify__folder_data.post_type_tax, |
| 678 |
new_folder_name: this.new_folder_name, |
| 679 |
folder_color_tag: this.active_color_tag, |
| 680 |
parent_folder: this.parent_folder, |
| 681 |
action: 'adminify_folder', |
| 682 |
route: 'create_new_folder', |
| 683 |
_ajax_nonce: wp_adminify__folder_data.nonce |
| 684 |
}; |
| 685 |
|
| 686 |
if (this.is_pro) { |
| 687 |
data.parent_folder = this.parent_folder; |
| 688 |
} |
| 689 |
|
| 690 |
$.ajax({ |
| 691 |
url: wp_adminify__folder_data.ajaxurl, |
| 692 |
method: 'post', |
| 693 |
data: data |
| 694 |
}).done(function (response, status, xhr) { |
| 695 |
if (response.success && xhr.status == 200) { |
| 696 |
_this.refresh_folders_data(response.data); |
| 697 |
|
| 698 |
_this.hide_create_folder_popup(); |
| 699 |
} else { |
| 700 |
_this.create_folder_error = response.data.message; |
| 701 |
} |
| 702 |
}); |
| 703 |
}, |
| 704 |
renameFolder: function renameFolder() { |
| 705 |
var folder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; |
| 706 |
|
| 707 |
var _this = this; |
| 708 |
|
| 709 |
var changes = false; |
| 710 |
if (this.active_color_tag != this._active_color_tag) changes = true; |
| 711 |
if (!changes && this._rename_folder_name.trim() != this.rename_folder_name.trim()) changes = true; |
| 712 |
if (!changes) return this.hide_rename_folder_popup(); |
| 713 |
$.ajax({ |
| 714 |
url: wp_adminify__folder_data.ajaxurl, |
| 715 |
method: 'post', |
| 716 |
data: { |
| 717 |
post_type: wp_adminify__folder_data.post_type, |
| 718 |
post_type_tax: wp_adminify__folder_data.post_type_tax, |
| 719 |
term_id: _this.folders_to_edit[0].term_id, |
| 720 |
folder_name: _this.rename_folder_name, |
| 721 |
folder_color_tag: _this.active_color_tag, |
| 722 |
action: 'adminify_folder', |
| 723 |
route: 'rename_folder', |
| 724 |
_ajax_nonce: wp_adminify__folder_data.nonce |
| 725 |
} |
| 726 |
}).done(function (response, status, xhr) { |
| 727 |
if (response.success && xhr.status == 200) { |
| 728 |
_this.refresh_folders_data(response.data); |
| 729 |
|
| 730 |
_this.hide_rename_folder_popup(); |
| 731 |
|
| 732 |
$('.folder--lists li.active > a').trigger('click'); |
| 733 |
} else { |
| 734 |
_this.rename_folder_error = response.data.message; |
| 735 |
} |
| 736 |
}); |
| 737 |
}, |
| 738 |
init_draggable_events: function init_draggable_events() { |
| 739 |
$('.adminify-move-file:not(.ui-draggable), .adminify-move-multiple:not(.ui-draggable)').draggable({ |
| 740 |
revert: "invalid", |
| 741 |
containment: "document", |
| 742 |
helper: "clone", |
| 743 |
cursor: "move", |
| 744 |
start: function start(event, ui) { |
| 745 |
$(this).closest('td').addClass('adminify-draggable'); |
| 746 |
$('body').addClass('adminify--items-dragging'); |
| 747 |
}, |
| 748 |
stop: function stop(event, ui) { |
| 749 |
$(this).closest('td').removeClass('adminify-draggable'); |
| 750 |
$('body').removeClass('adminify--items-dragging'); |
| 751 |
} // helper: function (event, ui) { |
| 752 |
// console.log( event ) |
| 753 |
// console.log( this ) |
| 754 |
// // if ( ui.draggable.hasClass( 'adminify-move-multiple') ) { |
| 755 |
// let items = $('#the-list .check-column input[type="checkbox"]:checked').length; |
| 756 |
// return $(`<div>Move ${items} Items</div>`); |
| 757 |
// // $('.adminify--selected-items').remove(); |
| 758 |
// // let selectedItems = $('.attachments-browser li.attachment.selected').length; |
| 759 |
// // selectedItems = (selectedItems < 2) ? '1 Item' : `${selectedItems} Items`; |
| 760 |
// // return $(`<div class='adminify--selected-items'><span class='total-post-count'>${selectedItems} Selected</span></div>`); |
| 761 |
// }, |
| 762 |
|
| 763 |
}); |
| 764 |
$('.attachments-browser li.attachment:not(.ui-draggable)').draggable({ |
| 765 |
revert: "invalid", |
| 766 |
containment: "document", |
| 767 |
cursor: "move", |
| 768 |
cursorAt: { |
| 769 |
left: 0, |
| 770 |
top: 0 |
| 771 |
}, |
| 772 |
start: function start(event, ui) { |
| 773 |
$('body').addClass('adminify--items-dragging'); |
| 774 |
}, |
| 775 |
stop: function stop(event, ui) { |
| 776 |
$('.adminify--selected-items').remove(); |
| 777 |
$('body').removeClass('adminify--items-dragging'); |
| 778 |
} |
| 779 |
}); |
| 780 |
}, |
| 781 |
init_droppable_events: function init_droppable_events() { |
| 782 |
var _this6 = this; |
| 783 |
|
| 784 |
return _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee2() { |
| 785 |
var _this; |
| 786 |
|
| 787 |
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee2$(_context2) { |
| 788 |
while (1) { |
| 789 |
switch (_context2.prev = _context2.next) { |
| 790 |
case 0: |
| 791 |
_this = _this6; |
| 792 |
$('.folder--lists li a:not(.ui-droppable), .folder--stats li.folder--single-uncategorized a:not(.ui-droppable)').droppable({ |
| 793 |
accept: '.adminify-move-file, .adminify-move-multiple, .attachments-browser li.attachment', |
| 794 |
hoverClass: 'adminify-drop-hover', |
| 795 |
classes: { |
| 796 |
'ui-droppable-active': 'ui-state-highlight' |
| 797 |
}, |
| 798 |
tolerance: 'pointer', |
| 799 |
drop: function () { |
| 800 |
var _drop = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee(event, ui) { |
| 801 |
var folderID, postIDs, move_to_folder, folder_found, mode; |
| 802 |
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) { |
| 803 |
while (1) { |
| 804 |
switch (_context.prev = _context.next) { |
| 805 |
case 0: |
| 806 |
folderID = $(this).parent("li").data('folder'); |
| 807 |
|
| 808 |
if (folderID) { |
| 809 |
_context.next = 3; |
| 810 |
break; |
| 811 |
} |
| 812 |
|
| 813 |
return _context.abrupt("return"); |
| 814 |
|
| 815 |
case 3: |
| 816 |
postIDs = []; |
| 817 |
|
| 818 |
if (ui.draggable.hasClass('adminify-move-multiple')) { |
| 819 |
postIDs = $('#the-list .check-column input[type=checkbox]:checked').toArray().map(function (_input) { |
| 820 |
return _input.value; |
| 821 |
}); |
| 822 |
$('.wp-list-table .manage-column.check-column input').prop('checked', false); |
| 823 |
} else if (ui.draggable.hasClass('adminify-move-file')) { |
| 824 |
postIDs = [ui.draggable[0].attributes['data-id'].nodeValue]; |
| 825 |
} else if (ui.draggable.hasClass('attachment')) { |
| 826 |
if ($('.media-toolbar.wp-filter').hasClass('media-toolbar-mode-select')) { |
| 827 |
postIDs = $('.attachments-browser li.attachment.selected').toArray().map(function (_media) { |
| 828 |
return _media.dataset.id; |
| 829 |
}); |
| 830 |
} else { |
| 831 |
postIDs = [ui.draggable[0].attributes['data-id'].nodeValue]; |
| 832 |
} |
| 833 |
} |
| 834 |
|
| 835 |
if (postIDs.length) { |
| 836 |
_context.next = 7; |
| 837 |
break; |
| 838 |
} |
| 839 |
|
| 840 |
return _context.abrupt("return"); |
| 841 |
|
| 842 |
case 7: |
| 843 |
move_to_folder = false; |
| 844 |
|
| 845 |
if (!(folderID != 'uncategorized')) { |
| 846 |
_context.next = 14; |
| 847 |
break; |
| 848 |
} |
| 849 |
|
| 850 |
folder_found = postIDs.some(function (post_id) { |
| 851 |
var folder_ids = _this.get_folder_ids_by_post_id(post_id); |
| 852 |
|
| 853 |
if (folder_ids.length) return true; |
| 854 |
return false; |
| 855 |
}); |
| 856 |
|
| 857 |
if (!folder_found) { |
| 858 |
_context.next = 14; |
| 859 |
break; |
| 860 |
} |
| 861 |
|
| 862 |
_context.next = 13; |
| 863 |
return _this.shouldWeMoveToFolder(); |
| 864 |
|
| 865 |
case 13: |
| 866 |
move_to_folder = _context.sent; |
| 867 |
|
| 868 |
case 14: |
| 869 |
if (!ui.draggable.hasClass('attachment')) { |
| 870 |
mode = $('input[name=post_view]').first().val() || 'list'; |
| 871 |
$.ajax({ |
| 872 |
url: wp_adminify__folder_data.ajaxurl, |
| 873 |
method: 'post', |
| 874 |
data: { |
| 875 |
post_ids: postIDs, |
| 876 |
folder_id: folderID, |
| 877 |
post_type: wp_adminify__folder_data.post_type, |
| 878 |
post_type_tax: wp_adminify__folder_data.post_type_tax, |
| 879 |
action: 'adminify_folder', |
| 880 |
route: 'move_to_folder', |
| 881 |
move_to_folder: move_to_folder, |
| 882 |
screen: pagenow, |
| 883 |
mode: mode, |
| 884 |
_ajax_nonce: wp_adminify__folder_data.nonce |
| 885 |
} |
| 886 |
}).done(function (response, status) { |
| 887 |
if (response.success) { |
| 888 |
_this.refresh_rows(); |
| 889 |
|
| 890 |
_this.refresh_folders_data(response.data); |
| 891 |
} |
| 892 |
}); |
| 893 |
} |
| 894 |
|
| 895 |
if (ui.draggable.hasClass('attachment')) { |
| 896 |
$.ajax({ |
| 897 |
url: wp_adminify__folder_data.ajaxurl, |
| 898 |
method: 'post', |
| 899 |
data: { |
| 900 |
post_ids: postIDs, |
| 901 |
folder_id: folderID, |
| 902 |
post_type: wp_adminify__folder_data.post_type, |
| 903 |
post_type_tax: wp_adminify__folder_data.post_type_tax, |
| 904 |
action: 'adminify_folder', |
| 905 |
route: 'move_to_folder', |
| 906 |
copy_type: copy_type, |
| 907 |
screen: pagenow, |
| 908 |
mode: 'grid', |
| 909 |
_ajax_nonce: wp_adminify__folder_data.nonce |
| 910 |
} |
| 911 |
}).done(function (response, status) { |
| 912 |
if (response.success) { |
| 913 |
_this.refresh_rows(); |
| 914 |
|
| 915 |
_this.refresh_folders_data(response.data); |
| 916 |
} |
| 917 |
}); |
| 918 |
} |
| 919 |
|
| 920 |
case 16: |
| 921 |
case "end": |
| 922 |
return _context.stop(); |
| 923 |
} |
| 924 |
} |
| 925 |
}, _callee, this); |
| 926 |
})); |
| 927 |
|
| 928 |
function drop(_x, _x2) { |
| 929 |
return _drop.apply(this, arguments); |
| 930 |
} |
| 931 |
|
| 932 |
return drop; |
| 933 |
}() |
| 934 |
}); |
| 935 |
|
| 936 |
case 2: |
| 937 |
case "end": |
| 938 |
return _context2.stop(); |
| 939 |
} |
| 940 |
} |
| 941 |
}, _callee2); |
| 942 |
}))(); |
| 943 |
}, |
| 944 |
shouldWeMoveToFolder: function shouldWeMoveToFolder() { |
| 945 |
var _this7 = this; |
| 946 |
|
| 947 |
this.showPopupOverlay(); |
| 948 |
this.move_to_folder_popup = true; |
| 949 |
return new Promise(function (resolve) { |
| 950 |
jQuery('body').on('click.promptDialog', '.button-move, .button-copy', function (e) { |
| 951 |
e.preventDefault(); |
| 952 |
if (jQuery(this).hasClass('button-move')) resolve(true); |
| 953 |
resolve(false); |
| 954 |
}); |
| 955 |
})["finally"](function () { |
| 956 |
jQuery('.button-move, .button-copy').off('click.promptDialog'); |
| 957 |
|
| 958 |
_this7.hidePopupOverlay(); |
| 959 |
|
| 960 |
_this7.move_to_folder_popup = false; |
| 961 |
}); |
| 962 |
}, |
| 963 |
refresh_rows: function refresh_rows() { |
| 964 |
var $currentItem = $('.folder--lists li.active, .folder--stats li.active').first(); |
| 965 |
if (!$currentItem.length) $currentItem = $('.folder--stats li').first(); |
| 966 |
$currentItem.children('a').trigger('click'); |
| 967 |
}, |
| 968 |
get_allowed_status: function get_allowed_status() { |
| 969 |
return ['pending', 'draft', 'future', 'private', 'publish', 'inherit']; |
| 970 |
}, |
| 971 |
refresh_folders_data: function refresh_folders_data() { |
| 972 |
var _this8 = this; |
| 973 |
|
| 974 |
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 975 |
this.folders = data.folders; |
| 976 |
this.total_posts = data.total_posts; |
| 977 |
this.total_uncat_posts = data.total_uncat_posts; |
| 978 |
this.folder_hierarchy = data.folder_hierarchy; |
| 979 |
setTimeout(function () { |
| 980 |
_this8.init_droppable_events(); |
| 981 |
|
| 982 |
_this8.init_draggable_events(); |
| 983 |
|
| 984 |
_this8.set_posts_folders(); |
| 985 |
}, 200); |
| 986 |
}, |
| 987 |
refresh_folders_data_ajax: function refresh_folders_data_ajax() { |
| 988 |
var _this = this; |
| 989 |
|
| 990 |
$.ajax({ |
| 991 |
url: wp_adminify__folder_data.ajaxurl, |
| 992 |
method: 'post', |
| 993 |
data: { |
| 994 |
post_type: wp_adminify__folder_data.post_type, |
| 995 |
post_type_tax: wp_adminify__folder_data.post_type_tax, |
| 996 |
action: 'adminify_folder', |
| 997 |
route: 'refresh_folders', |
| 998 |
_ajax_nonce: wp_adminify__folder_data.nonce |
| 999 |
} |
| 1000 |
}).done(function (response, status) { |
| 1001 |
if (response.success) { |
| 1002 |
_this.refresh_folders_data(response.data); |
| 1003 |
} |
| 1004 |
}); |
| 1005 |
}, |
| 1006 |
get_color_tags: function get_color_tags() { |
| 1007 |
if (!this.folders_to_edit && !this.folders_to_edit.length) return; |
| 1008 |
var folder = this.folders_to_edit[0]; |
| 1009 |
var active_color = ''; |
| 1010 |
|
| 1011 |
if (folder && folder.color) { |
| 1012 |
active_color = folder.color; |
| 1013 |
} |
| 1014 |
|
| 1015 |
if (!active_color || this.color_tags.includes(active_color)) return this.color_tags; |
| 1016 |
return this.color_tags.concat([active_color]); |
| 1017 |
}, |
| 1018 |
deleteFolders: function deleteFolders() { |
| 1019 |
var _this = this; |
| 1020 |
|
| 1021 |
var folders = this.folders_to_edit; |
| 1022 |
if (!folders.length) return this.hide_delete_folder_popup(); |
| 1023 |
folders = folders.map(function (_folder) { |
| 1024 |
return _folder.term_id; |
| 1025 |
}); |
| 1026 |
$.ajax({ |
| 1027 |
url: wp_adminify__folder_data.ajaxurl, |
| 1028 |
method: 'post', |
| 1029 |
data: { |
| 1030 |
post_type: wp_adminify__folder_data.post_type, |
| 1031 |
post_type_tax: wp_adminify__folder_data.post_type_tax, |
| 1032 |
term_ids: folders, |
| 1033 |
action: 'adminify_folder', |
| 1034 |
route: 'delete_folders', |
| 1035 |
_ajax_nonce: wp_adminify__folder_data.nonce |
| 1036 |
} |
| 1037 |
}).done(function (response, status, xhr) { |
| 1038 |
if (response.success && xhr.status == 200) { |
| 1039 |
_this.refresh_folders_data(response.data); |
| 1040 |
|
| 1041 |
_this.hide_delete_folder_popup(); |
| 1042 |
|
| 1043 |
$('.folder--lists, .folder--stats').find('li.active > a').trigger('click'); |
| 1044 |
} |
| 1045 |
}); |
| 1046 |
}, |
| 1047 |
sortFolders: function sortFolders(event) { |
| 1048 |
var sort = $(event.currentTarget).data('sort'); |
| 1049 |
|
| 1050 |
if (sort) { |
| 1051 |
js_cookie__WEBPACK_IMPORTED_MODULE_1__["default"].set(this.post_type_tax + '__sort', sort); |
| 1052 |
this.sort = sort; |
| 1053 |
} |
| 1054 |
} |
| 1055 |
}, |
| 1056 |
computed: { |
| 1057 |
_filter_folder: function _filter_folder() { |
| 1058 |
return this.filter_folder.trim().toLowerCase(); |
| 1059 |
}, |
| 1060 |
filtered_folders: function filtered_folders() { |
| 1061 |
var _this9 = this; |
| 1062 |
|
| 1063 |
var that = this; // Set Default Options |
| 1064 |
|
| 1065 |
var folders = this.folders.map(function (_folder) { |
| 1066 |
_folder.selected = false; |
| 1067 |
_folder.contexted = false; |
| 1068 |
_folder.children = []; |
| 1069 |
return _folder; |
| 1070 |
}); // Sort for Folders |
| 1071 |
|
| 1072 |
folders = folders.sort(function (a, b) { |
| 1073 |
if (_this9.sort == 'a-z') { |
| 1074 |
if (a.name < b.name) { |
| 1075 |
return -1; |
| 1076 |
} |
| 1077 |
|
| 1078 |
if (a.name > b.name) { |
| 1079 |
return 1; |
| 1080 |
} |
| 1081 |
} |
| 1082 |
|
| 1083 |
if (_this9.sort == 'z-a') { |
| 1084 |
if (a.name < b.name) { |
| 1085 |
return 1; |
| 1086 |
} |
| 1087 |
|
| 1088 |
if (a.name > b.name) { |
| 1089 |
return -1; |
| 1090 |
} |
| 1091 |
} |
| 1092 |
|
| 1093 |
return 0; |
| 1094 |
}); |
| 1095 |
|
| 1096 |
function addChild(folder, _folders) { |
| 1097 |
that.folder_hierarchy[folder.term_id].forEach(function (child_id) { |
| 1098 |
var child_folder = folders.find(function (_folder) { |
| 1099 |
return _folder.term_id == child_id; |
| 1100 |
}); |
| 1101 |
var child_folder_index = folders.findIndex(function (_folder) { |
| 1102 |
return _folder.term_id == child_id; |
| 1103 |
}); |
| 1104 |
|
| 1105 |
if (child_folder && child_folder_index > -1) { |
| 1106 |
if (!folder.children.find(function (_fol_ch) { |
| 1107 |
return _fol_ch.term_id == child_folder.term_id; |
| 1108 |
})) { |
| 1109 |
folder.children.push(child_folder); |
| 1110 |
child_folder = folder.children.find(function (_folder) { |
| 1111 |
return _folder.term_id == child_id; |
| 1112 |
}); |
| 1113 |
if (child_id in that.folder_hierarchy) addChild(child_folder, _folders); |
| 1114 |
} |
| 1115 |
} |
| 1116 |
}); |
| 1117 |
} // Search Filter |
| 1118 |
|
| 1119 |
|
| 1120 |
if (this._filter_folder) { |
| 1121 |
var _folders = folders.filter(function (_folder) { |
| 1122 |
return _folder.name.toLowerCase().search(_this9._filter_folder.toLowerCase()) > -1; |
| 1123 |
}); |
| 1124 |
|
| 1125 |
if (_folders.length) return _folders; |
| 1126 |
} // Set Sub Folders |
| 1127 |
|
| 1128 |
|
| 1129 |
folders.forEach(function (folder) { |
| 1130 |
if (folder.term_id in that.folder_hierarchy) { |
| 1131 |
addChild(folder, folders); |
| 1132 |
} |
| 1133 |
}); // Cleanup Extra Sub Folders |
| 1134 |
|
| 1135 |
for (var parent_item in that.folder_hierarchy) { |
| 1136 |
that.folder_hierarchy[parent_item].forEach(function (child_id) { |
| 1137 |
var index = folders.findIndex(function (_folder) { |
| 1138 |
return _folder.term_id == child_id; |
| 1139 |
}); |
| 1140 |
folders.splice(index, 1); |
| 1141 |
}); |
| 1142 |
} |
| 1143 |
|
| 1144 |
return folders; |
| 1145 |
}, |
| 1146 |
total_posts_count: function total_posts_count() { |
| 1147 |
var _this10 = this; |
| 1148 |
|
| 1149 |
var total = 0; |
| 1150 |
this.get_allowed_status().forEach(function (status) { |
| 1151 |
total += Number(_this10.total_posts[status]); |
| 1152 |
}); |
| 1153 |
return total; |
| 1154 |
}, |
| 1155 |
is_reached_limit: function is_reached_limit() { |
| 1156 |
if (this.is_pro) return false; // go unlimited |
| 1157 |
|
| 1158 |
if (this.folders && this.folders.length) { |
| 1159 |
return this.folders.length >= 3; |
| 1160 |
} |
| 1161 |
|
| 1162 |
return false; |
| 1163 |
} |
| 1164 |
}, |
| 1165 |
watch: { |
| 1166 |
filter_folder: function filter_folder() { |
| 1167 |
var _this11 = this; |
| 1168 |
|
| 1169 |
setTimeout(function () { |
| 1170 |
_this11.init_draggable_events(); |
| 1171 |
|
| 1172 |
_this11.init_droppable_events(); |
| 1173 |
}, 50); |
| 1174 |
} |
| 1175 |
} |
| 1176 |
}); |
| 1177 |
|
| 1178 |
/***/ }), |
| 1179 |
|
| 1180 |
/***/ "./dev/admin/modules/folder/components/folders.vue": |
| 1181 |
/*!*********************************************************!*\ |
| 1182 |
!*** ./dev/admin/modules/folder/components/folders.vue ***! |
| 1183 |
\*********************************************************/ |
| 1184 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1185 |
|
| 1186 |
__webpack_require__.r(__webpack_exports__); |
| 1187 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1188 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1189 |
/* harmony export */ }); |
| 1190 |
/* harmony import */ var _folders_vue_vue_type_template_id_b43c4ba6___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./folders.vue?vue&type=template&id=b43c4ba6& */ "./dev/admin/modules/folder/components/folders.vue?vue&type=template&id=b43c4ba6&"); |
| 1191 |
/* harmony import */ var _folders_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./folders.vue?vue&type=script&lang=js& */ "./dev/admin/modules/folder/components/folders.vue?vue&type=script&lang=js&"); |
| 1192 |
/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); |
| 1193 |
|
| 1194 |
|
| 1195 |
|
| 1196 |
|
| 1197 |
|
| 1198 |
/* normalize component */ |
| 1199 |
; |
| 1200 |
var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( |
| 1201 |
_folders_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], |
| 1202 |
_folders_vue_vue_type_template_id_b43c4ba6___WEBPACK_IMPORTED_MODULE_0__.render, |
| 1203 |
_folders_vue_vue_type_template_id_b43c4ba6___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, |
| 1204 |
false, |
| 1205 |
null, |
| 1206 |
null, |
| 1207 |
null |
| 1208 |
|
| 1209 |
) |
| 1210 |
|
| 1211 |
/* hot reload */ |
| 1212 |
if (false) { var api; } |
| 1213 |
component.options.__file = "dev/admin/modules/folder/components/folders.vue" |
| 1214 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); |
| 1215 |
|
| 1216 |
/***/ }), |
| 1217 |
|
| 1218 |
/***/ "./dev/admin/modules/folder/folder-app.vue": |
| 1219 |
/*!*************************************************!*\ |
| 1220 |
!*** ./dev/admin/modules/folder/folder-app.vue ***! |
| 1221 |
\*************************************************/ |
| 1222 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1223 |
|
| 1224 |
__webpack_require__.r(__webpack_exports__); |
| 1225 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1226 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1227 |
/* harmony export */ }); |
| 1228 |
/* harmony import */ var _folder_app_vue_vue_type_template_id_4bcdf0a3___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./folder-app.vue?vue&type=template&id=4bcdf0a3& */ "./dev/admin/modules/folder/folder-app.vue?vue&type=template&id=4bcdf0a3&"); |
| 1229 |
/* harmony import */ var _folder_app_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./folder-app.vue?vue&type=script&lang=js& */ "./dev/admin/modules/folder/folder-app.vue?vue&type=script&lang=js&"); |
| 1230 |
/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); |
| 1231 |
|
| 1232 |
|
| 1233 |
|
| 1234 |
|
| 1235 |
|
| 1236 |
/* normalize component */ |
| 1237 |
; |
| 1238 |
var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( |
| 1239 |
_folder_app_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], |
| 1240 |
_folder_app_vue_vue_type_template_id_4bcdf0a3___WEBPACK_IMPORTED_MODULE_0__.render, |
| 1241 |
_folder_app_vue_vue_type_template_id_4bcdf0a3___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, |
| 1242 |
false, |
| 1243 |
null, |
| 1244 |
null, |
| 1245 |
null |
| 1246 |
|
| 1247 |
) |
| 1248 |
|
| 1249 |
/* hot reload */ |
| 1250 |
if (false) { var api; } |
| 1251 |
component.options.__file = "dev/admin/modules/folder/folder-app.vue" |
| 1252 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); |
| 1253 |
|
| 1254 |
/***/ }), |
| 1255 |
|
| 1256 |
/***/ "./dev/admin/modules/folder/components/folders.vue?vue&type=script&lang=js&": |
| 1257 |
/*!**********************************************************************************!*\ |
| 1258 |
!*** ./dev/admin/modules/folder/components/folders.vue?vue&type=script&lang=js& ***! |
| 1259 |
\**********************************************************************************/ |
| 1260 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1261 |
|
| 1262 |
__webpack_require__.r(__webpack_exports__); |
| 1263 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1264 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1265 |
/* harmony export */ }); |
| 1266 |
/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_folders_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./folders.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./dev/admin/modules/folder/components/folders.vue?vue&type=script&lang=js&"); |
| 1267 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_folders_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); |
| 1268 |
|
| 1269 |
/***/ }), |
| 1270 |
|
| 1271 |
/***/ "./dev/admin/modules/folder/folder-app.vue?vue&type=script&lang=js&": |
| 1272 |
/*!**************************************************************************!*\ |
| 1273 |
!*** ./dev/admin/modules/folder/folder-app.vue?vue&type=script&lang=js& ***! |
| 1274 |
\**************************************************************************/ |
| 1275 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1276 |
|
| 1277 |
__webpack_require__.r(__webpack_exports__); |
| 1278 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1279 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1280 |
/* harmony export */ }); |
| 1281 |
/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_folder_app_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./folder-app.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./dev/admin/modules/folder/folder-app.vue?vue&type=script&lang=js&"); |
| 1282 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_folder_app_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); |
| 1283 |
|
| 1284 |
/***/ }), |
| 1285 |
|
| 1286 |
/***/ "./dev/admin/modules/folder/components/folders.vue?vue&type=template&id=b43c4ba6&": |
| 1287 |
/*!****************************************************************************************!*\ |
| 1288 |
!*** ./dev/admin/modules/folder/components/folders.vue?vue&type=template&id=b43c4ba6& ***! |
| 1289 |
\****************************************************************************************/ |
| 1290 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1291 |
|
| 1292 |
__webpack_require__.r(__webpack_exports__); |
| 1293 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1294 |
/* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_folders_vue_vue_type_template_id_b43c4ba6___WEBPACK_IMPORTED_MODULE_0__.render), |
| 1295 |
/* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_folders_vue_vue_type_template_id_b43c4ba6___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) |
| 1296 |
/* harmony export */ }); |
| 1297 |
/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_folders_vue_vue_type_template_id_b43c4ba6___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./folders.vue?vue&type=template&id=b43c4ba6& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./dev/admin/modules/folder/components/folders.vue?vue&type=template&id=b43c4ba6&"); |
| 1298 |
|
| 1299 |
|
| 1300 |
/***/ }), |
| 1301 |
|
| 1302 |
/***/ "./dev/admin/modules/folder/folder-app.vue?vue&type=template&id=4bcdf0a3&": |
| 1303 |
/*!********************************************************************************!*\ |
| 1304 |
!*** ./dev/admin/modules/folder/folder-app.vue?vue&type=template&id=4bcdf0a3& ***! |
| 1305 |
\********************************************************************************/ |
| 1306 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1307 |
|
| 1308 |
__webpack_require__.r(__webpack_exports__); |
| 1309 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1310 |
/* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_folder_app_vue_vue_type_template_id_4bcdf0a3___WEBPACK_IMPORTED_MODULE_0__.render), |
| 1311 |
/* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_folder_app_vue_vue_type_template_id_4bcdf0a3___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) |
| 1312 |
/* harmony export */ }); |
| 1313 |
/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_folder_app_vue_vue_type_template_id_4bcdf0a3___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./folder-app.vue?vue&type=template&id=4bcdf0a3& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./dev/admin/modules/folder/folder-app.vue?vue&type=template&id=4bcdf0a3&"); |
| 1314 |
|
| 1315 |
|
| 1316 |
/***/ }), |
| 1317 |
|
| 1318 |
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./dev/admin/modules/folder/components/folders.vue?vue&type=template&id=b43c4ba6&": |
| 1319 |
/*!*******************************************************************************************************************************************************************************************************************************!*\ |
| 1320 |
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./dev/admin/modules/folder/components/folders.vue?vue&type=template&id=b43c4ba6& ***! |
| 1321 |
\*******************************************************************************************************************************************************************************************************************************/ |
| 1322 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1323 |
|
| 1324 |
__webpack_require__.r(__webpack_exports__); |
| 1325 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1326 |
/* harmony export */ "render": () => (/* binding */ render), |
| 1327 |
/* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) |
| 1328 |
/* harmony export */ }); |
| 1329 |
var render = function() { |
| 1330 |
var _vm = this |
| 1331 |
var _h = _vm.$createElement |
| 1332 |
var _c = _vm._self._c || _h |
| 1333 |
return _c( |
| 1334 |
"ul", |
| 1335 |
_vm._l(_vm.folders, function(_folder) { |
| 1336 |
return _c( |
| 1337 |
"li", |
| 1338 |
{ |
| 1339 |
key: _folder.term_id, |
| 1340 |
staticClass: "folder--single-root has--sub-menu", |
| 1341 |
class: _vm.is_folder(_folder) && "active", |
| 1342 |
attrs: { "data-folder": _folder.term_id } |
| 1343 |
}, |
| 1344 |
[ |
| 1345 |
_c( |
| 1346 |
"a", |
| 1347 |
{ |
| 1348 |
style: { color: _folder.color }, |
| 1349 |
attrs: { href: _vm.get_folder_url(_folder) }, |
| 1350 |
on: { |
| 1351 |
contextmenu: function($event) { |
| 1352 |
return _vm.folderActions($event, _folder) |
| 1353 |
} |
| 1354 |
} |
| 1355 |
}, |
| 1356 |
[ |
| 1357 |
_c("span", { staticClass: "wp-adminify--folder-left" }, [ |
| 1358 |
_c("span", { staticClass: "wp-adminify--icon-control" }, [ |
| 1359 |
!_vm.folder_select_toggle |
| 1360 |
? _c("span", { |
| 1361 |
staticClass: |
| 1362 |
"wp-adminify--icon dashicons dashicons-open-folder" |
| 1363 |
}) |
| 1364 |
: _vm._e(), |
| 1365 |
_vm._v(" "), |
| 1366 |
_vm.folder_select_toggle |
| 1367 |
? _c("input", { |
| 1368 |
directives: [ |
| 1369 |
{ |
| 1370 |
name: "model", |
| 1371 |
rawName: "v-model", |
| 1372 |
value: _folder.selected, |
| 1373 |
expression: "_folder.selected" |
| 1374 |
} |
| 1375 |
], |
| 1376 |
staticClass: "wp-adminify--control", |
| 1377 |
attrs: { type: "checkbox" }, |
| 1378 |
domProps: { |
| 1379 |
checked: Array.isArray(_folder.selected) |
| 1380 |
? _vm._i(_folder.selected, null) > -1 |
| 1381 |
: _folder.selected |
| 1382 |
}, |
| 1383 |
on: { |
| 1384 |
"!click": function($event) { |
| 1385 |
$event.stopPropagation() |
| 1386 |
}, |
| 1387 |
change: function($event) { |
| 1388 |
var $$a = _folder.selected, |
| 1389 |
$$el = $event.target, |
| 1390 |
$$c = $$el.checked ? true : false |
| 1391 |
if (Array.isArray($$a)) { |
| 1392 |
var $$v = null, |
| 1393 |
$$i = _vm._i($$a, $$v) |
| 1394 |
if ($$el.checked) { |
| 1395 |
$$i < 0 && |
| 1396 |
_vm.$set( |
| 1397 |
_folder, |
| 1398 |
"selected", |
| 1399 |
$$a.concat([$$v]) |
| 1400 |
) |
| 1401 |
} else { |
| 1402 |
$$i > -1 && |
| 1403 |
_vm.$set( |
| 1404 |
_folder, |
| 1405 |
"selected", |
| 1406 |
$$a.slice(0, $$i).concat($$a.slice($$i + 1)) |
| 1407 |
) |
| 1408 |
} |
| 1409 |
} else { |
| 1410 |
_vm.$set(_folder, "selected", $$c) |
| 1411 |
} |
| 1412 |
} |
| 1413 |
} |
| 1414 |
}) |
| 1415 |
: _vm._e() |
| 1416 |
]), |
| 1417 |
_vm._v(" "), |
| 1418 |
_c("span", { staticClass: "wp-adminify--name" }, [ |
| 1419 |
_vm._v(_vm._s(_folder.name)) |
| 1420 |
]) |
| 1421 |
]), |
| 1422 |
_vm._v(" "), |
| 1423 |
_c("span", { staticClass: "wp-adminify--count" }, [ |
| 1424 |
_vm._v(_vm._s(_folder.count)) |
| 1425 |
]) |
| 1426 |
] |
| 1427 |
), |
| 1428 |
_vm._v(" "), |
| 1429 |
_folder.children.length |
| 1430 |
? _c("folders", { |
| 1431 |
staticClass: "folder--sub-lists", |
| 1432 |
attrs: { |
| 1433 |
folders: _folder.children, |
| 1434 |
folder_select_toggle: _vm.folder_select_toggle |
| 1435 |
} |
| 1436 |
}) |
| 1437 |
: _vm._e(), |
| 1438 |
_vm._v(" "), |
| 1439 |
_c("ul", { staticClass: "adminify--sub-menu" }, [ |
| 1440 |
_c("li", [ |
| 1441 |
_c( |
| 1442 |
"a", |
| 1443 |
{ |
| 1444 |
attrs: { href: "#" }, |
| 1445 |
on: { |
| 1446 |
click: function($event) { |
| 1447 |
$event.preventDefault() |
| 1448 |
$event.stopPropagation() |
| 1449 |
return _vm.showNewSubFolderPopup(_folder) |
| 1450 |
} |
| 1451 |
} |
| 1452 |
}, |
| 1453 |
[_vm._v("New Sub-folder")] |
| 1454 |
) |
| 1455 |
]), |
| 1456 |
_vm._v(" "), |
| 1457 |
_c("li", [ |
| 1458 |
_c( |
| 1459 |
"a", |
| 1460 |
{ |
| 1461 |
attrs: { href: "#" }, |
| 1462 |
on: { |
| 1463 |
click: function($event) { |
| 1464 |
$event.preventDefault() |
| 1465 |
$event.stopPropagation() |
| 1466 |
return _vm.showRenameFolderPopup(_folder) |
| 1467 |
} |
| 1468 |
} |
| 1469 |
}, |
| 1470 |
[_vm._v("Rename")] |
| 1471 |
) |
| 1472 |
]), |
| 1473 |
_vm._v(" "), |
| 1474 |
_c("li", [ |
| 1475 |
_c( |
| 1476 |
"a", |
| 1477 |
{ |
| 1478 |
attrs: { href: "#" }, |
| 1479 |
on: { |
| 1480 |
click: function($event) { |
| 1481 |
$event.preventDefault() |
| 1482 |
$event.stopPropagation() |
| 1483 |
return _vm.showDeleteFolderPopup(_folder) |
| 1484 |
} |
| 1485 |
} |
| 1486 |
}, |
| 1487 |
[_vm._v("Delete")] |
| 1488 |
) |
| 1489 |
]) |
| 1490 |
]) |
| 1491 |
], |
| 1492 |
1 |
| 1493 |
) |
| 1494 |
}), |
| 1495 |
0 |
| 1496 |
) |
| 1497 |
} |
| 1498 |
var staticRenderFns = [] |
| 1499 |
render._withStripped = true |
| 1500 |
|
| 1501 |
|
| 1502 |
|
| 1503 |
/***/ }), |
| 1504 |
|
| 1505 |
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./dev/admin/modules/folder/folder-app.vue?vue&type=template&id=4bcdf0a3&": |
| 1506 |
/*!***********************************************************************************************************************************************************************************************************************!*\ |
| 1507 |
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./dev/admin/modules/folder/folder-app.vue?vue&type=template&id=4bcdf0a3& ***! |
| 1508 |
\***********************************************************************************************************************************************************************************************************************/ |
| 1509 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1510 |
|
| 1511 |
__webpack_require__.r(__webpack_exports__); |
| 1512 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1513 |
/* harmony export */ "render": () => (/* binding */ render), |
| 1514 |
/* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) |
| 1515 |
/* harmony export */ }); |
| 1516 |
var render = function() { |
| 1517 |
var _vm = this |
| 1518 |
var _h = _vm.$createElement |
| 1519 |
var _c = _vm._self._c || _h |
| 1520 |
return _c("div", { attrs: { id: "wp-adminify--folder-app" } }, [ |
| 1521 |
_c("div", { staticClass: "wp-adminify--folder-widget" }, [ |
| 1522 |
_c("div", { staticClass: "wp-adminify--folder-app" }, [ |
| 1523 |
_c( |
| 1524 |
"div", |
| 1525 |
{ staticClass: "wp-adminify--folder-app--inner" }, |
| 1526 |
[ |
| 1527 |
_c("div", { staticClass: "folder--header" }, [ |
| 1528 |
_c("span", [_vm._v("Folders")]), |
| 1529 |
_vm._v(" -\n "), |
| 1530 |
_c( |
| 1531 |
"a", |
| 1532 |
{ |
| 1533 |
attrs: { href: "#" }, |
| 1534 |
on: { |
| 1535 |
click: function($event) { |
| 1536 |
$event.preventDefault() |
| 1537 |
return _vm.showNewFolderPopup.apply(null, arguments) |
| 1538 |
} |
| 1539 |
} |
| 1540 |
}, |
| 1541 |
[_vm._v("Create New Folder")] |
| 1542 |
) |
| 1543 |
]), |
| 1544 |
_vm._v(" "), |
| 1545 |
_c("div", { staticClass: "folder--actions" }, [ |
| 1546 |
_c("span", [ |
| 1547 |
_c("input", { |
| 1548 |
directives: [ |
| 1549 |
{ |
| 1550 |
name: "model", |
| 1551 |
rawName: "v-model", |
| 1552 |
value: _vm.folder_select_toggle, |
| 1553 |
expression: "folder_select_toggle" |
| 1554 |
} |
| 1555 |
], |
| 1556 |
attrs: { type: "checkbox" }, |
| 1557 |
domProps: { |
| 1558 |
checked: Array.isArray(_vm.folder_select_toggle) |
| 1559 |
? _vm._i(_vm.folder_select_toggle, null) > -1 |
| 1560 |
: _vm.folder_select_toggle |
| 1561 |
}, |
| 1562 |
on: { |
| 1563 |
change: function($event) { |
| 1564 |
var $$a = _vm.folder_select_toggle, |
| 1565 |
$$el = $event.target, |
| 1566 |
$$c = $$el.checked ? true : false |
| 1567 |
if (Array.isArray($$a)) { |
| 1568 |
var $$v = null, |
| 1569 |
$$i = _vm._i($$a, $$v) |
| 1570 |
if ($$el.checked) { |
| 1571 |
$$i < 0 && |
| 1572 |
(_vm.folder_select_toggle = $$a.concat([$$v])) |
| 1573 |
} else { |
| 1574 |
$$i > -1 && |
| 1575 |
(_vm.folder_select_toggle = $$a |
| 1576 |
.slice(0, $$i) |
| 1577 |
.concat($$a.slice($$i + 1))) |
| 1578 |
} |
| 1579 |
} else { |
| 1580 |
_vm.folder_select_toggle = $$c |
| 1581 |
} |
| 1582 |
} |
| 1583 |
} |
| 1584 |
}) |
| 1585 |
]), |
| 1586 |
_vm._v(" "), |
| 1587 |
_c( |
| 1588 |
"a", |
| 1589 |
{ |
| 1590 |
staticClass: "btn--folder-rename", |
| 1591 |
attrs: { href: "#" }, |
| 1592 |
on: { |
| 1593 |
click: function($event) { |
| 1594 |
$event.preventDefault() |
| 1595 |
$event.stopPropagation() |
| 1596 |
return _vm.showRenameFolderPopup.apply(null, arguments) |
| 1597 |
} |
| 1598 |
} |
| 1599 |
}, |
| 1600 |
[_vm._v("Rename")] |
| 1601 |
), |
| 1602 |
_vm._v(" "), |
| 1603 |
_c( |
| 1604 |
"a", |
| 1605 |
{ |
| 1606 |
staticClass: "btn--folder-delete", |
| 1607 |
attrs: { href: "#" }, |
| 1608 |
on: { |
| 1609 |
click: function($event) { |
| 1610 |
$event.preventDefault() |
| 1611 |
$event.stopPropagation() |
| 1612 |
return _vm.showDeleteFolderPopup.apply(null, arguments) |
| 1613 |
} |
| 1614 |
} |
| 1615 |
}, |
| 1616 |
[_vm._v("Delete")] |
| 1617 |
), |
| 1618 |
_vm._v(" "), |
| 1619 |
_c("ul", { staticClass: "folder-sort--list" }, [ |
| 1620 |
_vm._m(0), |
| 1621 |
_vm._v(" "), |
| 1622 |
_c("li", { staticClass: "folder--sort has--sub-menu" }, [ |
| 1623 |
_vm._m(1), |
| 1624 |
_vm._v(" "), |
| 1625 |
_c("ul", { staticClass: "adminify--sub-menu" }, [ |
| 1626 |
_c("li", [ |
| 1627 |
_c( |
| 1628 |
"a", |
| 1629 |
{ |
| 1630 |
attrs: { "data-sort": "a-z", href: "#" }, |
| 1631 |
on: { |
| 1632 |
click: function($event) { |
| 1633 |
$event.preventDefault() |
| 1634 |
return _vm.sortFolders($event) |
| 1635 |
} |
| 1636 |
} |
| 1637 |
}, |
| 1638 |
[_vm._v("A → Z")] |
| 1639 |
) |
| 1640 |
]), |
| 1641 |
_vm._v(" "), |
| 1642 |
_c("li", [ |
| 1643 |
_c( |
| 1644 |
"a", |
| 1645 |
{ |
| 1646 |
attrs: { "data-sort": "z-a", href: "#" }, |
| 1647 |
on: { |
| 1648 |
click: function($event) { |
| 1649 |
$event.preventDefault() |
| 1650 |
return _vm.sortFolders($event) |
| 1651 |
} |
| 1652 |
} |
| 1653 |
}, |
| 1654 |
[_vm._v("Z → A")] |
| 1655 |
) |
| 1656 |
]) |
| 1657 |
]) |
| 1658 |
]) |
| 1659 |
]) |
| 1660 |
]), |
| 1661 |
_vm._v(" "), |
| 1662 |
_c("div", { staticClass: "folder--search" }, [ |
| 1663 |
_c("input", { |
| 1664 |
directives: [ |
| 1665 |
{ |
| 1666 |
name: "model", |
| 1667 |
rawName: "v-model", |
| 1668 |
value: _vm.filter_folder, |
| 1669 |
expression: "filter_folder" |
| 1670 |
} |
| 1671 |
], |
| 1672 |
attrs: { type: "text", placeholder: "Search folder" }, |
| 1673 |
domProps: { value: _vm.filter_folder }, |
| 1674 |
on: { |
| 1675 |
input: function($event) { |
| 1676 |
if ($event.target.composing) { |
| 1677 |
return |
| 1678 |
} |
| 1679 |
_vm.filter_folder = $event.target.value |
| 1680 |
} |
| 1681 |
} |
| 1682 |
}) |
| 1683 |
]), |
| 1684 |
_vm._v(" "), |
| 1685 |
_c("ul", { staticClass: "folder--stats" }, [ |
| 1686 |
_c( |
| 1687 |
"li", |
| 1688 |
{ |
| 1689 |
staticClass: "folder--single-all", |
| 1690 |
class: _vm.is_folder("all") && "active", |
| 1691 |
attrs: { "data-folder": "all" } |
| 1692 |
}, |
| 1693 |
[ |
| 1694 |
_c("a", { attrs: { href: _vm.get_folder_url("all") } }, [ |
| 1695 |
_c("span", [_vm._v("All")]), |
| 1696 |
_c("span", { staticClass: "wp-adminify--count" }, [ |
| 1697 |
_vm._v(_vm._s(_vm.total_posts_count)) |
| 1698 |
]) |
| 1699 |
]) |
| 1700 |
] |
| 1701 |
), |
| 1702 |
_vm._v(" "), |
| 1703 |
_c( |
| 1704 |
"li", |
| 1705 |
{ |
| 1706 |
staticClass: "folder--single-uncategorized", |
| 1707 |
class: _vm.is_folder("uncategorized") && "active", |
| 1708 |
attrs: { "data-folder": "uncategorized" } |
| 1709 |
}, |
| 1710 |
[ |
| 1711 |
_c( |
| 1712 |
"a", |
| 1713 |
{ attrs: { href: _vm.get_folder_url("uncategorized") } }, |
| 1714 |
[ |
| 1715 |
_c("span", [_vm._v("Uncategorized")]), |
| 1716 |
_c("span", { staticClass: "wp-adminify--count" }, [ |
| 1717 |
_vm._v(_vm._s(_vm.total_uncat_posts)) |
| 1718 |
]) |
| 1719 |
] |
| 1720 |
) |
| 1721 |
] |
| 1722 |
) |
| 1723 |
]), |
| 1724 |
_vm._v(" "), |
| 1725 |
_vm.folders |
| 1726 |
? _c("folders", { |
| 1727 |
staticClass: "folder--lists", |
| 1728 |
attrs: { |
| 1729 |
folders: _vm.filtered_folders, |
| 1730 |
folder_select_toggle: _vm.folder_select_toggle |
| 1731 |
} |
| 1732 |
}) |
| 1733 |
: _vm._e() |
| 1734 |
], |
| 1735 |
1 |
| 1736 |
) |
| 1737 |
]) |
| 1738 |
]), |
| 1739 |
_vm._v(" "), |
| 1740 |
_c("div", { staticClass: "wp-adminify--popup-area" }, [ |
| 1741 |
_c("div", { staticClass: "wp-adminify--popup-container" }, [ |
| 1742 |
_c("div", { staticClass: "wp-adminify--popup-container_inner" }, [ |
| 1743 |
_vm.create_folder_popup |
| 1744 |
? _c( |
| 1745 |
"div", |
| 1746 |
{ staticClass: "popup--create-new-folder" }, |
| 1747 |
[ |
| 1748 |
_c( |
| 1749 |
"a", |
| 1750 |
{ |
| 1751 |
staticClass: "wp-adminify--popup-close", |
| 1752 |
attrs: { href: "#" }, |
| 1753 |
on: { |
| 1754 |
click: function($event) { |
| 1755 |
$event.preventDefault() |
| 1756 |
return _vm.hide_create_folder_popup.apply( |
| 1757 |
null, |
| 1758 |
arguments |
| 1759 |
) |
| 1760 |
} |
| 1761 |
} |
| 1762 |
}, |
| 1763 |
[_c("span", { staticClass: "dashicons dashicons-no-alt" })] |
| 1764 |
), |
| 1765 |
_vm._v(" "), |
| 1766 |
_vm.parent_folder |
| 1767 |
? [ |
| 1768 |
_c("h3", [_vm._v("New Sub Folder")]), |
| 1769 |
_vm._v(" "), |
| 1770 |
_vm.is_pro |
| 1771 |
? [ |
| 1772 |
_c( |
| 1773 |
"div", |
| 1774 |
{ staticClass: "popup--new-folder__name" }, |
| 1775 |
[ |
| 1776 |
_c("div", [_vm._v("Sub Folder Name")]), |
| 1777 |
_vm._v(" "), |
| 1778 |
_c("div", [ |
| 1779 |
_c("input", { |
| 1780 |
directives: [ |
| 1781 |
{ |
| 1782 |
name: "model", |
| 1783 |
rawName: "v-model", |
| 1784 |
value: _vm.new_folder_name, |
| 1785 |
expression: "new_folder_name" |
| 1786 |
} |
| 1787 |
], |
| 1788 |
attrs: { |
| 1789 |
type: "text", |
| 1790 |
placeholder: "Write here" |
| 1791 |
}, |
| 1792 |
domProps: { value: _vm.new_folder_name }, |
| 1793 |
on: { |
| 1794 |
input: [ |
| 1795 |
function($event) { |
| 1796 |
if ($event.target.composing) { |
| 1797 |
return |
| 1798 |
} |
| 1799 |
_vm.new_folder_name = |
| 1800 |
$event.target.value |
| 1801 |
}, |
| 1802 |
function($event) { |
| 1803 |
_vm.create_folder_error = null |
| 1804 |
} |
| 1805 |
] |
| 1806 |
} |
| 1807 |
}) |
| 1808 |
]) |
| 1809 |
] |
| 1810 |
), |
| 1811 |
_vm._v(" "), |
| 1812 |
_c("br"), |
| 1813 |
_vm._v(" "), |
| 1814 |
_c( |
| 1815 |
"div", |
| 1816 |
{ staticClass: "popup--new-folder__color" }, |
| 1817 |
[ |
| 1818 |
_c("div", [_vm._v("Colour Tag")]), |
| 1819 |
_vm._v(" "), |
| 1820 |
_c("div", [ |
| 1821 |
_c( |
| 1822 |
"ul", |
| 1823 |
{ staticClass: "wp-adminify--colors" }, |
| 1824 |
_vm._l(_vm.color_tags, function( |
| 1825 |
color_tag |
| 1826 |
) { |
| 1827 |
return _c( |
| 1828 |
"li", |
| 1829 |
{ |
| 1830 |
key: color_tag, |
| 1831 |
class: |
| 1832 |
color_tag == _vm.active_color_tag |
| 1833 |
? "active" |
| 1834 |
: "" |
| 1835 |
}, |
| 1836 |
[ |
| 1837 |
_c("a", { |
| 1838 |
style: |
| 1839 |
"background: " + |
| 1840 |
color_tag + |
| 1841 |
";", |
| 1842 |
attrs: { href: "#" }, |
| 1843 |
on: { |
| 1844 |
click: function($event) { |
| 1845 |
$event.preventDefault() |
| 1846 |
_vm.active_color_tag = color_tag |
| 1847 |
} |
| 1848 |
} |
| 1849 |
}) |
| 1850 |
] |
| 1851 |
) |
| 1852 |
}), |
| 1853 |
0 |
| 1854 |
) |
| 1855 |
]) |
| 1856 |
] |
| 1857 |
), |
| 1858 |
_vm._v(" "), |
| 1859 |
_c( |
| 1860 |
"a", |
| 1861 |
{ |
| 1862 |
staticClass: "button button-primary", |
| 1863 |
attrs: { href: "#" }, |
| 1864 |
on: { |
| 1865 |
click: function($event) { |
| 1866 |
$event.preventDefault() |
| 1867 |
return _vm.saveNewFolder.apply( |
| 1868 |
null, |
| 1869 |
arguments |
| 1870 |
) |
| 1871 |
} |
| 1872 |
} |
| 1873 |
}, |
| 1874 |
[_vm._v("Save Folder")] |
| 1875 |
), |
| 1876 |
_vm._v(" "), |
| 1877 |
_vm.create_folder_error |
| 1878 |
? _c( |
| 1879 |
"div", |
| 1880 |
{ staticClass: "popup--new-folder-error" }, |
| 1881 |
[_vm._v(_vm._s(_vm.create_folder_error))] |
| 1882 |
) |
| 1883 |
: _vm._e() |
| 1884 |
] |
| 1885 |
: [ |
| 1886 |
_c("div", { |
| 1887 |
staticClass: "wp-adminify-folder--pro-notice", |
| 1888 |
domProps: { innerHTML: _vm._s(_vm.pro_notice) } |
| 1889 |
}) |
| 1890 |
] |
| 1891 |
] |
| 1892 |
: [ |
| 1893 |
_c("h3", [_vm._v("New Folder")]), |
| 1894 |
_vm._v(" "), |
| 1895 |
_vm.is_reached_limit |
| 1896 |
? [ |
| 1897 |
_c("div", { |
| 1898 |
staticClass: "wp-adminify-folder--pro-notice", |
| 1899 |
domProps: { innerHTML: _vm._s(_vm.pro_notice) } |
| 1900 |
}) |
| 1901 |
] |
| 1902 |
: [ |
| 1903 |
_c( |
| 1904 |
"div", |
| 1905 |
{ staticClass: "popup--new-folder__name" }, |
| 1906 |
[ |
| 1907 |
_c("div", [_vm._v("Folder Name")]), |
| 1908 |
_vm._v(" "), |
| 1909 |
_c("div", [ |
| 1910 |
_c("input", { |
| 1911 |
directives: [ |
| 1912 |
{ |
| 1913 |
name: "model", |
| 1914 |
rawName: "v-model", |
| 1915 |
value: _vm.new_folder_name, |
| 1916 |
expression: "new_folder_name" |
| 1917 |
} |
| 1918 |
], |
| 1919 |
attrs: { |
| 1920 |
type: "text", |
| 1921 |
placeholder: "Write here" |
| 1922 |
}, |
| 1923 |
domProps: { value: _vm.new_folder_name }, |
| 1924 |
on: { |
| 1925 |
input: [ |
| 1926 |
function($event) { |
| 1927 |
if ($event.target.composing) { |
| 1928 |
return |
| 1929 |
} |
| 1930 |
_vm.new_folder_name = |
| 1931 |
$event.target.value |
| 1932 |
}, |
| 1933 |
function($event) { |
| 1934 |
_vm.create_folder_error = null |
| 1935 |
} |
| 1936 |
] |
| 1937 |
} |
| 1938 |
}) |
| 1939 |
]) |
| 1940 |
] |
| 1941 |
), |
| 1942 |
_vm._v(" "), |
| 1943 |
_c("br"), |
| 1944 |
_vm._v(" "), |
| 1945 |
_c( |
| 1946 |
"div", |
| 1947 |
{ staticClass: "popup--new-folder__color" }, |
| 1948 |
[ |
| 1949 |
_c("div", [_vm._v("Colour Tag")]), |
| 1950 |
_vm._v(" "), |
| 1951 |
_c("div", [ |
| 1952 |
_c( |
| 1953 |
"ul", |
| 1954 |
{ staticClass: "wp-adminify--colors" }, |
| 1955 |
_vm._l(_vm.color_tags, function( |
| 1956 |
color_tag |
| 1957 |
) { |
| 1958 |
return _c( |
| 1959 |
"li", |
| 1960 |
{ |
| 1961 |
key: color_tag, |
| 1962 |
class: |
| 1963 |
color_tag == _vm.active_color_tag |
| 1964 |
? "active" |
| 1965 |
: "" |
| 1966 |
}, |
| 1967 |
[ |
| 1968 |
_c("a", { |
| 1969 |
style: |
| 1970 |
"background: " + |
| 1971 |
color_tag + |
| 1972 |
";", |
| 1973 |
attrs: { href: "#" }, |
| 1974 |
on: { |
| 1975 |
click: function($event) { |
| 1976 |
$event.preventDefault() |
| 1977 |
_vm.active_color_tag = color_tag |
| 1978 |
} |
| 1979 |
} |
| 1980 |
}) |
| 1981 |
] |
| 1982 |
) |
| 1983 |
}), |
| 1984 |
0 |
| 1985 |
) |
| 1986 |
]) |
| 1987 |
] |
| 1988 |
), |
| 1989 |
_vm._v(" "), |
| 1990 |
_c( |
| 1991 |
"a", |
| 1992 |
{ |
| 1993 |
staticClass: "button button-primary", |
| 1994 |
attrs: { href: "#" }, |
| 1995 |
on: { |
| 1996 |
click: function($event) { |
| 1997 |
$event.preventDefault() |
| 1998 |
return _vm.saveNewFolder.apply( |
| 1999 |
null, |
| 2000 |
arguments |
| 2001 |
) |
| 2002 |
} |
| 2003 |
} |
| 2004 |
}, |
| 2005 |
[_vm._v("Save Folder")] |
| 2006 |
), |
| 2007 |
_vm._v(" "), |
| 2008 |
_vm.create_folder_error |
| 2009 |
? _c( |
| 2010 |
"div", |
| 2011 |
{ staticClass: "popup--new-folder-error" }, |
| 2012 |
[_vm._v(_vm._s(_vm.create_folder_error))] |
| 2013 |
) |
| 2014 |
: _vm._e() |
| 2015 |
] |
| 2016 |
] |
| 2017 |
], |
| 2018 |
2 |
| 2019 |
) |
| 2020 |
: _vm._e(), |
| 2021 |
_vm._v(" "), |
| 2022 |
_vm.rename_folder_popup |
| 2023 |
? _c("div", { staticClass: "popup--rename-folder" }, [ |
| 2024 |
_c( |
| 2025 |
"a", |
| 2026 |
{ |
| 2027 |
staticClass: "wp-adminify--popup-close", |
| 2028 |
attrs: { href: "#" }, |
| 2029 |
on: { |
| 2030 |
click: function($event) { |
| 2031 |
$event.preventDefault() |
| 2032 |
return _vm.hide_rename_folder_popup.apply( |
| 2033 |
null, |
| 2034 |
arguments |
| 2035 |
) |
| 2036 |
} |
| 2037 |
} |
| 2038 |
}, |
| 2039 |
[_c("span", { staticClass: "dashicons dashicons-no-alt" })] |
| 2040 |
), |
| 2041 |
_vm._v(" "), |
| 2042 |
_c("h3", [_vm._v("Rename Folder")]), |
| 2043 |
_vm._v(" "), |
| 2044 |
_c("div", { staticClass: "popup--new-folder__name" }, [ |
| 2045 |
_c("div", [_vm._v("Rename Folder")]), |
| 2046 |
_vm._v(" "), |
| 2047 |
_c("div", [ |
| 2048 |
_c("input", { |
| 2049 |
directives: [ |
| 2050 |
{ |
| 2051 |
name: "model", |
| 2052 |
rawName: "v-model", |
| 2053 |
value: _vm.rename_folder_name, |
| 2054 |
expression: "rename_folder_name" |
| 2055 |
} |
| 2056 |
], |
| 2057 |
attrs: { type: "text", placeholder: "Write here" }, |
| 2058 |
domProps: { value: _vm.rename_folder_name }, |
| 2059 |
on: { |
| 2060 |
input: [ |
| 2061 |
function($event) { |
| 2062 |
if ($event.target.composing) { |
| 2063 |
return |
| 2064 |
} |
| 2065 |
_vm.rename_folder_name = $event.target.value |
| 2066 |
}, |
| 2067 |
function($event) { |
| 2068 |
_vm.rename_folder_error = null |
| 2069 |
} |
| 2070 |
] |
| 2071 |
} |
| 2072 |
}) |
| 2073 |
]) |
| 2074 |
]), |
| 2075 |
_vm._v(" "), |
| 2076 |
_c("br"), |
| 2077 |
_vm._v(" "), |
| 2078 |
_c("div", { staticClass: "popup--new-folder__color" }, [ |
| 2079 |
_c("div", [_vm._v("Change Color")]), |
| 2080 |
_vm._v(" "), |
| 2081 |
_c("div", [ |
| 2082 |
_c( |
| 2083 |
"ul", |
| 2084 |
{ staticClass: "wp-adminify--colors" }, |
| 2085 |
_vm._l(_vm.get_color_tags(), function(color_tag) { |
| 2086 |
return _c( |
| 2087 |
"li", |
| 2088 |
{ |
| 2089 |
key: color_tag, |
| 2090 |
class: |
| 2091 |
color_tag == _vm.active_color_tag ? "active" : "" |
| 2092 |
}, |
| 2093 |
[ |
| 2094 |
_c("a", { |
| 2095 |
style: "background: " + color_tag + ";", |
| 2096 |
attrs: { href: "#" }, |
| 2097 |
on: { |
| 2098 |
click: function($event) { |
| 2099 |
$event.preventDefault() |
| 2100 |
_vm.active_color_tag = color_tag |
| 2101 |
} |
| 2102 |
} |
| 2103 |
}) |
| 2104 |
] |
| 2105 |
) |
| 2106 |
}), |
| 2107 |
0 |
| 2108 |
) |
| 2109 |
]) |
| 2110 |
]), |
| 2111 |
_vm._v(" "), |
| 2112 |
_c( |
| 2113 |
"a", |
| 2114 |
{ |
| 2115 |
staticClass: "button button-primary", |
| 2116 |
attrs: { href: "#" }, |
| 2117 |
on: { |
| 2118 |
click: function($event) { |
| 2119 |
$event.preventDefault() |
| 2120 |
return _vm.renameFolder.apply(null, arguments) |
| 2121 |
} |
| 2122 |
} |
| 2123 |
}, |
| 2124 |
[_vm._v("Save Folder")] |
| 2125 |
), |
| 2126 |
_vm._v(" "), |
| 2127 |
_vm.rename_folder_error |
| 2128 |
? _c("div", { staticClass: "popup--new-folder-error" }, [ |
| 2129 |
_vm._v(_vm._s(_vm.rename_folder_error)) |
| 2130 |
]) |
| 2131 |
: _vm._e() |
| 2132 |
]) |
| 2133 |
: _vm._e(), |
| 2134 |
_vm._v(" "), |
| 2135 |
_vm.delete_folder_popup |
| 2136 |
? _c("div", { staticClass: "popup--delete-folder" }, [ |
| 2137 |
_c( |
| 2138 |
"a", |
| 2139 |
{ |
| 2140 |
staticClass: "wp-adminify--popup-close", |
| 2141 |
attrs: { href: "#" }, |
| 2142 |
on: { |
| 2143 |
click: function($event) { |
| 2144 |
$event.preventDefault() |
| 2145 |
return _vm.hide_delete_folder_popup.apply( |
| 2146 |
null, |
| 2147 |
arguments |
| 2148 |
) |
| 2149 |
} |
| 2150 |
} |
| 2151 |
}, |
| 2152 |
[_c("span", { staticClass: "dashicons dashicons-no-alt" })] |
| 2153 |
), |
| 2154 |
_vm._v(" "), |
| 2155 |
_c("h3", [ |
| 2156 |
_vm._v("Are you sure you want to delete the selected folder?") |
| 2157 |
]), |
| 2158 |
_vm._v(" "), |
| 2159 |
_c("p", [_vm._v("Items in the folder will not be deleted.")]), |
| 2160 |
_vm._v(" "), |
| 2161 |
_c("div", [ |
| 2162 |
_c( |
| 2163 |
"a", |
| 2164 |
{ |
| 2165 |
staticClass: "button", |
| 2166 |
attrs: { href: "#" }, |
| 2167 |
on: { |
| 2168 |
click: function($event) { |
| 2169 |
$event.preventDefault() |
| 2170 |
return _vm.hide_delete_folder_popup.apply( |
| 2171 |
null, |
| 2172 |
arguments |
| 2173 |
) |
| 2174 |
} |
| 2175 |
} |
| 2176 |
}, |
| 2177 |
[_vm._v("No, Keep it")] |
| 2178 |
), |
| 2179 |
_vm._v(" "), |
| 2180 |
_c( |
| 2181 |
"a", |
| 2182 |
{ |
| 2183 |
staticClass: "button button-primary", |
| 2184 |
attrs: { href: "#" }, |
| 2185 |
on: { |
| 2186 |
click: function($event) { |
| 2187 |
$event.preventDefault() |
| 2188 |
return _vm.deleteFolders.apply(null, arguments) |
| 2189 |
} |
| 2190 |
} |
| 2191 |
}, |
| 2192 |
[_vm._v("Yes, Delete it!")] |
| 2193 |
) |
| 2194 |
]) |
| 2195 |
]) |
| 2196 |
: _vm._e(), |
| 2197 |
_vm._v(" "), |
| 2198 |
_vm.move_to_folder_popup |
| 2199 |
? _c("div", { staticClass: "popup--move-to-folder" }, [ |
| 2200 |
_c("h3", [_vm._v("Few posts are already in another Folder")]), |
| 2201 |
_vm._v(" "), |
| 2202 |
_c("p", [ |
| 2203 |
_vm._v( |
| 2204 |
"Please choose a option whether you want to copy or move to new Folder." |
| 2205 |
) |
| 2206 |
]), |
| 2207 |
_vm._v(" "), |
| 2208 |
_vm._m(2) |
| 2209 |
]) |
| 2210 |
: _vm._e() |
| 2211 |
]) |
| 2212 |
]) |
| 2213 |
]) |
| 2214 |
]) |
| 2215 |
} |
| 2216 |
var staticRenderFns = [ |
| 2217 |
function() { |
| 2218 |
var _vm = this |
| 2219 |
var _h = _vm.$createElement |
| 2220 |
var _c = _vm._self._c || _h |
| 2221 |
return _c("li", { staticClass: "folder--expand" }, [ |
| 2222 |
_c("a", { staticClass: "btn--folder-expand", attrs: { href: "#" } }, [ |
| 2223 |
_c("span", { staticClass: "dashicons dashicons-arrow-down-alt2" }) |
| 2224 |
]) |
| 2225 |
]) |
| 2226 |
}, |
| 2227 |
function() { |
| 2228 |
var _vm = this |
| 2229 |
var _h = _vm.$createElement |
| 2230 |
var _c = _vm._self._c || _h |
| 2231 |
return _c("a", { staticClass: "btn--folder-sort", attrs: { href: "#" } }, [ |
| 2232 |
_c("span", { staticClass: "dashicons dashicons-sort" }) |
| 2233 |
]) |
| 2234 |
}, |
| 2235 |
function() { |
| 2236 |
var _vm = this |
| 2237 |
var _h = _vm.$createElement |
| 2238 |
var _c = _vm._self._c || _h |
| 2239 |
return _c("div", [ |
| 2240 |
_c("a", { staticClass: "button button-copy", attrs: { href: "#" } }, [ |
| 2241 |
_vm._v("Copy To Folder") |
| 2242 |
]), |
| 2243 |
_vm._v(" "), |
| 2244 |
_c( |
| 2245 |
"a", |
| 2246 |
{ |
| 2247 |
staticClass: "button button-primary button-move", |
| 2248 |
attrs: { href: "#" } |
| 2249 |
}, |
| 2250 |
[_vm._v("Move To Folder")] |
| 2251 |
) |
| 2252 |
]) |
| 2253 |
} |
| 2254 |
] |
| 2255 |
render._withStripped = true |
| 2256 |
|
| 2257 |
|
| 2258 |
|
| 2259 |
/***/ }) |
| 2260 |
|
| 2261 |
}, |
| 2262 |
/******/ __webpack_require__ => { // webpackRuntimeModules |
| 2263 |
/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) |
| 2264 |
/******/ __webpack_require__.O(0, ["/assets/admin/js/vendor"], () => (__webpack_exec__("./dev/admin/modules/folder/folder.js"))); |
| 2265 |
/******/ var __webpack_exports__ = __webpack_require__.O(); |
| 2266 |
/******/ } |
| 2267 |
]); |
| 2268 |
//# sourceMappingURL=wp-adminify--folder.js.map |