|
|
@ -5875,6 +5875,8 @@ var _DateUtils = _interopRequireDefault(require("../../../../../brain/tools/util
|
|
|
|
|
|
|
|
|
|
|
|
var _DBUtils = _interopRequireDefault(require("../../../../../brain/tools/utilities/DBUtils"));
|
|
|
|
var _DBUtils = _interopRequireDefault(require("../../../../../brain/tools/utilities/DBUtils"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DataEvent = _interopRequireWildcard(require("../../../../../brain/tools/events/DataEvent"));
|
|
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
|
|
|
|
|
|
|
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
|
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
|
@ -5966,6 +5968,7 @@ function () {
|
|
|
|
|
|
|
|
|
|
|
|
self.dbUtils.modify(id, freshData).then(function (response) {
|
|
|
|
self.dbUtils.modify(id, freshData).then(function (response) {
|
|
|
|
resolve(response);
|
|
|
|
resolve(response);
|
|
|
|
|
|
|
|
if (id != null) freshData.page == 'true' ? self.updateNav(true, id, freshData) : self.updateNav(false, id, freshData);
|
|
|
|
}).catch(function (err) {
|
|
|
|
}).catch(function (err) {
|
|
|
|
reject(err);
|
|
|
|
reject(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -5985,6 +5988,38 @@ function () {
|
|
|
|
reject(error);
|
|
|
|
reject(error);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
key: "updateNav",
|
|
|
|
|
|
|
|
value: function updateNav(add, id, post) {
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
this.dataUtils.request('/api/settings/nav', DataEvent.SETTINGS_LOADED).then(function (response) {
|
|
|
|
|
|
|
|
var menu = JSON.parse(response.request['response']);
|
|
|
|
|
|
|
|
var item = {
|
|
|
|
|
|
|
|
id: id,
|
|
|
|
|
|
|
|
uuid: post.uuid,
|
|
|
|
|
|
|
|
title: post.title,
|
|
|
|
|
|
|
|
slug: post.slug
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (add) {
|
|
|
|
|
|
|
|
menu.push(item);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
for (var index = 0; index < menu.length; index++) {
|
|
|
|
|
|
|
|
if (menu[index].id == id) {
|
|
|
|
|
|
|
|
menu.splice(index, 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.dataUtils.request('/api/settings/nav-sync', DataEvent.SETTINGS_UPDATED, _DataUtils.REQUEST_TYPE_POST, _DataUtils.CONTENT_TYPE_JSON, menu).then(function (response) {
|
|
|
|
|
|
|
|
console.log(response);
|
|
|
|
|
|
|
|
}).catch(function (err) {
|
|
|
|
|
|
|
|
console.log(err);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}).catch(function (err) {
|
|
|
|
|
|
|
|
console.log(err);
|
|
|
|
|
|
|
|
});
|
|
|
|
} //--------------------------
|
|
|
|
} //--------------------------
|
|
|
|
// event handlers
|
|
|
|
// event handlers
|
|
|
|
//--------------------------
|
|
|
|
//--------------------------
|
|
|
@ -5995,7 +6030,7 @@ function () {
|
|
|
|
}();
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
|
|
exports.default = PostActions;
|
|
|
|
exports.default = PostActions;
|
|
|
|
},{"../../../../../brain//tools/utilities/DataUtils":"../../../../brain/tools/utilities/DataUtils.js","../../../../../brain//tools/utilities/StringUtils":"../../../../brain/tools/utilities/StringUtils.js","../../../../../brain/tools/utilities/DateUtils":"../../../../brain/tools/utilities/DateUtils.js","../../../../../brain/tools/utilities/DBUtils":"../../../../brain/tools/utilities/DBUtils.js","uuid/v4":"../../../../node_modules/uuid/v4.js"}],"../../../../brain/tools/events/EditorEvent.js":[function(require,module,exports) {
|
|
|
|
},{"../../../../../brain//tools/utilities/DataUtils":"../../../../brain/tools/utilities/DataUtils.js","../../../../../brain//tools/utilities/StringUtils":"../../../../brain/tools/utilities/StringUtils.js","../../../../../brain/tools/utilities/DateUtils":"../../../../brain/tools/utilities/DateUtils.js","../../../../../brain/tools/utilities/DBUtils":"../../../../brain/tools/utilities/DBUtils.js","uuid/v4":"../../../../node_modules/uuid/v4.js","../../../../../brain/tools/events/DataEvent":"../../../../brain/tools/events/DataEvent.js"}],"../../../../brain/tools/events/EditorEvent.js":[function(require,module,exports) {
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
@ -8044,7 +8079,6 @@ function () {
|
|
|
|
(0, _tinyDatePicker.default)(document.getElementById('post-date'), {
|
|
|
|
(0, _tinyDatePicker.default)(document.getElementById('post-date'), {
|
|
|
|
mode: 'dp-below',
|
|
|
|
mode: 'dp-below',
|
|
|
|
format: function format(date) {
|
|
|
|
format: function format(date) {
|
|
|
|
//return date;
|
|
|
|
|
|
|
|
return self.dateUtils.getDate('origin', date);
|
|
|
|
return self.dateUtils.getDate('origin', date);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -8188,8 +8222,7 @@ function () {
|
|
|
|
image.src = f.target.result;
|
|
|
|
image.src = f.target.result;
|
|
|
|
image.title = escape(theFile.name);
|
|
|
|
image.title = escape(theFile.name);
|
|
|
|
var span = document.createElement('div');
|
|
|
|
var span = document.createElement('div');
|
|
|
|
span.innerHTML = ['<img src="', f.target.result, '" title="', escape(theFile.name), '"/>'].join(''); //document.getElementById('featured-image-drop').insertBefore(span, null);
|
|
|
|
span.innerHTML = ['<img src="', f.target.result, '" title="', escape(theFile.name), '"/>'].join('');
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById('featured-image-drop').innerHTML = '';
|
|
|
|
document.getElementById('featured-image-drop').innerHTML = '';
|
|
|
|
document.getElementById('featured-image-drop').appendChild(image);
|
|
|
|
document.getElementById('featured-image-drop').appendChild(image);
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -8656,7 +8689,6 @@ function () {
|
|
|
|
|
|
|
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
self.dataUtils.request('/api/settings/nav-sync', DataEvent.SETTINGS_UPDATED, _DataUtils.REQUEST_TYPE_POST, _DataUtils.CONTENT_TYPE_JSON, navData).then(function (response) {
|
|
|
|
self.dataUtils.request('/api/settings/nav-sync', DataEvent.SETTINGS_UPDATED, _DataUtils.REQUEST_TYPE_POST, _DataUtils.CONTENT_TYPE_JSON, navData).then(function (response) {
|
|
|
|
//console.log("RESPONSE", response)
|
|
|
|
|
|
|
|
resolve(response);
|
|
|
|
resolve(response);
|
|
|
|
}).catch(function (err) {
|
|
|
|
}).catch(function (err) {
|
|
|
|
reject(err);
|
|
|
|
reject(err);
|
|
|
@ -8765,7 +8797,7 @@ function () {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "edit-item":
|
|
|
|
case "edit-item":
|
|
|
|
console.log("EDIT STUFF");
|
|
|
|
window.location = "/@/dashboard/posts/edit/" + e.target.getAttribute('data-id');
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|