123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390 |
- exports.ids = [49,51,52,53];
- exports.modules = {
- 142:
- (function(module, exports) {
- module.exports = {
- };
- }),
- 143:
- (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var render = function render() {
- var _vm = this,
- _c = _vm._self._c;
- return _c('div', {
- staticClass: "tinymce-container",
- class: {
- fullscreen: _vm.fullscreen
- },
- style: {
- width: _vm.containerWidth
- }
- }, [_vm._ssrNode("<textarea" + _vm._ssrAttr("id", _vm.tinymceId) + " class=\"tinymce-textarea\" data-v-64623c0e></textarea>")]);
- };
- var staticRenderFns = [];
- var plugins = __webpack_require__(150);
- var toolbar = __webpack_require__(151);
- var dynamicLoadScript = __webpack_require__(152);
- const tinymceCDN = '//cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js';
- var Tinymcevue_type_script_lang_js = ({
- name: 'Tinymce',
-
- props: {
- id: {
- type: String,
- default: function () {
- return 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '');
- }
- },
- value: {
- type: String,
- default: ''
- },
- toolbar: {
- type: Array,
- required: false,
- default() {
- return [];
- }
- },
- menubar: {
- type: String,
- default: 'file edit insert view format table'
- },
- height: {
- type: [Number, String],
- required: false,
- default: 360
- },
- width: {
- type: [Number, String],
- required: false,
- default: 'auto'
- }
- },
- data() {
- return {
- hasChange: false,
- hasInit: false,
- tinymceId: this.id,
- fullscreen: false,
- languageTypeList: {
- 'en': 'en',
- 'zh': 'zh_CN',
- 'es': 'es_MX',
- 'ja': 'ja'
- }
- };
- },
- computed: {
- language() {
- return this.languageTypeList[this.$store.getters.language];
- },
- containerWidth() {
- const width = this.width;
- if (/^[\d]+(\.[\d]+)?$/.test(width)) {
-
- return `${width}px`;
- }
- return width;
- }
- },
- watch: {
- value(val) {
- if (!this.hasChange && this.hasInit) {
- this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(val || ''));
- }
- },
- language() {
- this.destroyTinymce();
- this.$nextTick(() => this.initTinymce());
- }
- },
- mounted() {
- this.init();
- },
- activated() {
- if (window.tinymce) {
- this.initTinymce();
- }
- },
- deactivated() {
- this.destroyTinymce();
- },
- destroyed() {
- this.destroyTinymce();
- },
- methods: {
- init() {
-
- Object(dynamicLoadScript["default"])(tinymceCDN, err => {
- if (err) {
- this.$message.error(err.message);
- return;
- }
- this.initTinymce();
- });
- },
- initTinymce() {
- const _this = this;
- window.tinymce.init({
- language: this.language,
- selector: `#${this.tinymceId}`,
- height: this.height,
- body_class: 'panel-body ',
- object_resizing: false,
- toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar["default"],
- menubar: this.menubar,
- plugins: plugins["default"],
- end_container_on_empty_block: true,
- powerpaste_word_import: 'clean',
- code_dialog_height: 450,
- code_dialog_width: 1000,
- advlist_bullet_styles: 'square',
- advlist_number_styles: 'default',
- imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'],
- default_link_target: '_blank',
- link_title: false,
- nonbreaking_force_tab: true,
-
- init_instance_callback: editor => {
- if (_this.value) {
- editor.setContent(_this.value);
- }
- _this.hasInit = true;
- editor.on('NodeChange Change KeyUp SetContent', () => {
- this.hasChange = true;
- this.$emit('input', editor.getContent());
- });
- },
- setup(editor) {
- editor.on('FullscreenStateChanged', e => {
- _this.fullscreen = e.state;
- });
- },
-
-
-
- convert_urls: false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- });
- },
- destroyTinymce() {
- const tinymce = window.tinymce.get(this.tinymceId);
- if (this.fullscreen) {
- tinymce.execCommand('mceFullScreen');
- }
- if (tinymce) {
- tinymce.destroy();
- }
- },
- setContent(value) {
- window.tinymce.get(this.tinymceId).setContent(value);
- },
- getContent() {
- window.tinymce.get(this.tinymceId).getContent();
- },
- imageSuccessCBK(arr) {
- arr.forEach(v => window.tinymce.get(this.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" >`));
- }
- }
- });
- var components_Tinymcevue_type_script_lang_js = (Tinymcevue_type_script_lang_js);
- var componentNormalizer = __webpack_require__(2);
- function injectStyles (context) {
-
- var style0 = __webpack_require__(155)
- if (style0.__inject__) style0.__inject__(context)
- }
- var component = Object(componentNormalizer["a" ])(
- components_Tinymcevue_type_script_lang_js,
- render,
- staticRenderFns,
- false,
- injectStyles,
- "64623c0e",
- "c8124998"
-
- )
- var Tinymce = __webpack_exports__["default"] = (component.exports);
- }),
- 150:
- (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- const plugins = ['advlist autolink autosave code colorpicker colorpicker contextmenu directionality fullscreen hr insertdatetime link lists nonbreaking noneditable paste preview print save spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount'];
- __webpack_exports__["default"] = (plugins);
- }),
- 151:
- (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen'];
- __webpack_exports__["default"] = (toolbar);
- }),
- 152:
- (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- let callbacks = [];
- function loadedTinymce() {
-
-
- return window.tinymce;
- }
- const dynamicLoadScript = (src, callback) => {
- const existingScript = document.getElementById(src);
- const cb = callback || function () {};
- if (!existingScript) {
- const script = document.createElement('script');
- script.src = src;
- script.id = src;
- document.body.appendChild(script);
- callbacks.push(cb);
- const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd;
- onEnd(script);
- }
- if (existingScript && cb) {
- if (loadedTinymce()) {
- cb(null, existingScript);
- } else {
- callbacks.push(cb);
- }
- }
- function stdOnEnd(script) {
- script.onload = function () {
-
-
- this.onerror = this.onload = null;
- for (const cb of callbacks) {
- cb(null, script);
- }
- callbacks = null;
- };
- script.onerror = function () {
- this.onerror = this.onload = null;
- cb(new Error('Failed to load ' + src), script);
- };
- }
- function ieOnEnd(script) {
- script.onreadystatechange = function () {
- if (this.readyState !== 'complete' && this.readyState !== 'loaded') return;
- this.onreadystatechange = null;
- for (const cb of callbacks) {
- cb(null, script);
- }
- callbacks = null;
- };
- }
- };
- __webpack_exports__["default"] = (dynamicLoadScript);
- }),
- 155:
- (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_64623c0e_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(142);
- var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_64623c0e_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_64623c0e_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
- for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_64623c0e_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_64623c0e_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- })
- };;
|