Register ckeditor component

parent d673c13a
......@@ -13960,6 +13960,7 @@ Vue.use(__WEBPACK_IMPORTED_MODULE_1_vue_data_tables___default.a, { locale: __WEB
*/
Vue.component('example', __webpack_require__(108));
Vue.component('ckeditor', __webpack_require__(120));
Vue.component('DeleteButton', __webpack_require__(111));
Vue.component('PageTable', __webpack_require__(114));
Vue.component('PageForm', __webpack_require__(117));
......@@ -69496,6 +69497,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
//
//
//
//
......@@ -69521,8 +69523,8 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
ogType: '',
template: '',
templates: {
'blog.index': 'blog/index',
'blog.show': 'blog/show'
'index': 'index',
'home': 'home'
}
};
},
......@@ -69532,7 +69534,17 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
__WEBPACK_IMPORTED_MODULE_0_axios___default.a.post(route('api.page.page.store'), this.page).then(function (response) {
console.log(response);
});
},
setPageTypes: function setPageTypes() {
var _this = this;
__WEBPACK_IMPORTED_MODULE_0_axios___default.a.get(route('api.page.page-templates.index')).then(function (response) {
_this.templates = response.data;
});
}
},
mounted: function mounted() {
this.setPageTypes();
}
});
......@@ -69590,7 +69602,19 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
},
expression: "page[locale].slug"
}
})], 1), _vm._v("\n\n // Textarea\n\n "), _c('div', {
})], 1), _vm._v(" "), _c('el-form-item', {
attrs: {
"label": _vm.translate('page', 'body')
}
}, [_c('ckeditor', {
model: {
value: (_vm.page[locale].body),
callback: function($$v) {
_vm.page[locale].body = $$v
},
expression: "page[locale].body"
}
})], 1), _vm._v(" "), _c('div', {
staticClass: "panel box box-primary"
}, [_c('div', {
staticClass: "box-header"
......@@ -69746,7 +69770,13 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
attrs: {
"label": ""
}
}, [_c('el-checkbox-group', {
}, [_c('el-checkbox', {
attrs: {
"true-label": 1,
"false-label": 0,
"name": "is_home",
"label": _vm.translate('page', 'is homepage')
},
model: {
value: (_vm.page.is_home),
callback: function($$v) {
......@@ -69754,16 +69784,14 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
},
expression: "page.is_home"
}
}, [_c('el-checkbox', {
attrs: {
"label": _vm.translate('page', 'is homepage'),
"name": "is_home"
}
})], 1)], 1), _vm._v(" "), _c('el-form-item', {
})], 1), _vm._v(" "), _c('el-form-item', {
attrs: {
"label": _vm.translate('page', 'template')
}
}, [_c('el-select', {
attrs: {
"filterable": ""
},
model: {
value: (_vm.template),
callback: function($$v) {
......@@ -69789,5 +69817,472 @@ if (false) {
}
}
/***/ }),
/* 120 */
/***/ (function(module, exports, __webpack_require__) {
var disposed = false
function injectStyle (ssrContext) {
if (disposed) return
__webpack_require__(121)
}
var Component = __webpack_require__(8)(
/* script */
__webpack_require__(125),
/* template */
__webpack_require__(126),
/* styles */
injectStyle,
/* scopeId */
null,
/* moduleIdentifier (server only) */
null
)
Component.options.__file = "/Users/nicolaswidart/Sites/Asguard/Platform/Modules/Core/Assets/js/components/CkEditor.vue"
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
if (Component.options.functional) {console.error("[vue-loader] CkEditor.vue: functional components are not supported with templates, they should use render functions.")}
/* hot reload */
if (false) {(function () {
var hotAPI = require("vue-hot-reload-api")
hotAPI.install(require("vue"), false)
if (!hotAPI.compatible) return
module.hot.accept()
if (!module.hot.data) {
hotAPI.createRecord("data-v-2c0ddf4a", Component.options)
} else {
hotAPI.reload("data-v-2c0ddf4a", Component.options)
}
module.hot.dispose(function (data) {
disposed = true
})
})()}
module.exports = Component.exports
/***/ }),
/* 121 */
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(122);
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var update = __webpack_require__(123)("1fbf6846", content, false);
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2c0ddf4a\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./CkEditor.vue", function() {
var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2c0ddf4a\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./CkEditor.vue");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/* 122 */
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(102)(undefined);
// imports
// module
exports.push([module.i, "\n.ckeditor::after {\n content: \"\";\n display: table;\n clear: both;\n}\n", ""]);
// exports
/***/ }),
/* 123 */
/***/ (function(module, exports, __webpack_require__) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
Modified by Evan You @yyx990803
*/
var hasDocument = typeof document !== 'undefined'
if (typeof DEBUG !== 'undefined' && DEBUG) {
if (!hasDocument) {
throw new Error(
'vue-style-loader cannot be used in a non-browser environment. ' +
"Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
) }
}
var listToStyles = __webpack_require__(124)
/*
type StyleObject = {
id: number;
parts: Array<StyleObjectPart>
}
type StyleObjectPart = {
css: string;
media: string;
sourceMap: ?string
}
*/
var stylesInDom = {/*
[id: number]: {
id: number,
refs: number,
parts: Array<(obj?: StyleObjectPart) => void>
}
*/}
var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
var singletonElement = null
var singletonCounter = 0
var isProduction = false
var noop = function () {}
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page
var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
module.exports = function (parentId, list, _isProduction) {
isProduction = _isProduction
var styles = listToStyles(parentId, list)
addStylesToDom(styles)
return function update (newList) {
var mayRemove = []
for (var i = 0; i < styles.length; i++) {
var item = styles[i]
var domStyle = stylesInDom[item.id]
domStyle.refs--
mayRemove.push(domStyle)
}
if (newList) {
styles = listToStyles(parentId, newList)
addStylesToDom(styles)
} else {
styles = []
}
for (var i = 0; i < mayRemove.length; i++) {
var domStyle = mayRemove[i]
if (domStyle.refs === 0) {
for (var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j]()
}
delete stylesInDom[domStyle.id]
}
}
}
}
function addStylesToDom (styles /* Array<StyleObject> */) {
for (var i = 0; i < styles.length; i++) {
var item = styles[i]
var domStyle = stylesInDom[item.id]
if (domStyle) {
domStyle.refs++
for (var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j](item.parts[j])
}
for (; j < item.parts.length; j++) {
domStyle.parts.push(addStyle(item.parts[j]))
}
if (domStyle.parts.length > item.parts.length) {
domStyle.parts.length = item.parts.length
}
} else {
var parts = []
for (var j = 0; j < item.parts.length; j++) {
parts.push(addStyle(item.parts[j]))
}
stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
}
}
}
function createStyleElement () {
var styleElement = document.createElement('style')
styleElement.type = 'text/css'
head.appendChild(styleElement)
return styleElement
}
function addStyle (obj /* StyleObjectPart */) {
var update, remove
var styleElement = document.querySelector('style[data-vue-ssr-id~="' + obj.id + '"]')
if (styleElement) {
if (isProduction) {
// has SSR styles and in production mode.
// simply do nothing.
return noop
} else {
// has SSR styles but in dev mode.
// for some reason Chrome can't handle source map in server-rendered
// style tags - source maps in <style> only works if the style tag is
// created and inserted dynamically. So we remove the server rendered
// styles and inject new ones.
styleElement.parentNode.removeChild(styleElement)
}
}
if (isOldIE) {
// use singleton mode for IE9.
var styleIndex = singletonCounter++
styleElement = singletonElement || (singletonElement = createStyleElement())
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
} else {
// use multi-style-tag mode in all other cases
styleElement = createStyleElement()
update = applyToTag.bind(null, styleElement)
remove = function () {
styleElement.parentNode.removeChild(styleElement)
}
}
update(obj)
return function updateStyle (newObj /* StyleObjectPart */) {
if (newObj) {
if (newObj.css === obj.css &&
newObj.media === obj.media &&
newObj.sourceMap === obj.sourceMap) {
return
}
update(obj = newObj)
} else {
remove()
}
}
}
var replaceText = (function () {
var textStore = []
return function (index, replacement) {
textStore[index] = replacement
return textStore.filter(Boolean).join('\n')
}
})()
function applyToSingletonTag (styleElement, index, remove, obj) {
var css = remove ? '' : obj.css
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = replaceText(index, css)
} else {
var cssNode = document.createTextNode(css)
var childNodes = styleElement.childNodes
if (childNodes[index]) styleElement.removeChild(childNodes[index])
if (childNodes.length) {
styleElement.insertBefore(cssNode, childNodes[index])
} else {
styleElement.appendChild(cssNode)
}
}
}
function applyToTag (styleElement, obj) {
var css = obj.css
var media = obj.media
var sourceMap = obj.sourceMap
if (media) {
styleElement.setAttribute('media', media)
}
if (sourceMap) {
// https://developer.chrome.com/devtools/docs/javascript-debugging
// this makes source maps inside style tags work properly in Chrome
css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
// http://stackoverflow.com/a/26603875
css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
}
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = css
} else {
while (styleElement.firstChild) {
styleElement.removeChild(styleElement.firstChild)
}
styleElement.appendChild(document.createTextNode(css))
}
}
/***/ }),
/* 124 */
/***/ (function(module, exports) {
/**
* Translates the list format produced by css-loader into something
* easier to manipulate.
*/
module.exports = function listToStyles (parentId, list) {
var styles = []
var newStyles = {}
for (var i = 0; i < list.length; i++) {
var item = list[i]
var id = item[0]
var css = item[1]
var media = item[2]
var sourceMap = item[3]
var part = {
id: parentId + ':' + i,
css: css,
media: media,
sourceMap: sourceMap
}
if (!newStyles[id]) {
styles.push(newStyles[id] = { id: id, parts: [part] })
} else {
newStyles[id].parts.push(part)
}
}
return styles
}
/***/ }),
/* 125 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
//
//
//
//
//
//
//
//
//
//
//
//
var inc = 0;
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'vue-ckeditor',
props: {
name: {
type: String,
default: function _default() {
return 'editor-' + ++inc;
}
},
value: {
type: String
},
id: {
type: String,
default: function _default() {
return 'editor-' + inc;
}
},
types: {
type: String,
default: function _default() {
return 'classic';
}
},
config: {
type: Object,
default: function _default() {}
}
},
data: function data() {
return { destroyed: false };
},
computed: {
instance: function instance() {
return CKEDITOR.instances[this.id];
}
},
watch: {
value: function value(val) {
var html = this.instance.getData();
if (val !== html) {
this.instance.setData(val, null, true);
}
}
},
mounted: function mounted() {
var _this = this;
if (typeof CKEDITOR === 'undefined') {
console.log('CKEDITOR is missing (http://ckeditor.com/)');
} else {
if (this.types === 'inline') {
CKEDITOR.inline(this.id, this.config);
} else {
CKEDITOR.replace(this.id, this.config);
}
this.instance.on('change', function () {
var html = _this.instance.getData();
if (html !== _this.value) {
_this.$emit('input', html);
_this.$emit('update:value', html);
}
});
this.instance.on('blur', function () {
_this.$emit('blur', _this.instance);
});
this.instance.on('focus', function () {
_this.$emit('focus', _this.instance);
});
}
},
beforeDestroy: function beforeDestroy() {
if (!this.destroyed) {
this.instance.focusManager.blur(true);
this.instance.removeAllListeners();
this.instance.destroy();
this.destroyed = true;
}
}
});
/***/ }),
/* 126 */
/***/ (function(module, exports, __webpack_require__) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _c('div', {
staticClass: "ckeditor"
}, [_c('textarea', {
attrs: {
"name": _vm.name,
"id": _vm.id,
"types": _vm.types,
"config": _vm.config
},
domProps: {
"value": _vm.value
}
})])
},staticRenderFns: []}
module.exports.render._withStripped = true
if (false) {
module.hot.accept()
if (module.hot.data) {
require("vue-hot-reload-api").rerender("data-v-2c0ddf4a", module.exports)
}
}
/***/ })
/******/ ]);
\ No newline at end of file
......@@ -23,6 +23,7 @@ Vue.use(DataTables, { locale });
*/
Vue.component('example', require('./components/Example.vue'));
Vue.component('ckeditor', require('../../../Modules/Core/Assets/js/components/CkEditor.vue'));
Vue.component('DeleteButton', require('../../../Modules/Core/Assets/js/components/DeleteComponent.vue'));
Vue.component('PageTable', require('../../../Modules/Page/Assets/js/components/PageTable.vue'));
Vue.component('PageForm', require('../../../Modules/Page/Assets/js/components/PageForm.vue'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment