diff --git a/build/base.js b/build/base.js index db32cc6..1a0e3c7 100644 --- a/build/base.js +++ b/build/base.js @@ -35,5 +35,5 @@ module.exports = { performance: { hints: false }, - devtool: '#eval-source-map' + devtool: 'source-map' } \ No newline at end of file diff --git a/build/index.js b/build/index.js index 2184b07..7a753f4 100644 --- a/build/index.js +++ b/build/index.js @@ -29,7 +29,7 @@ options.plugins = [ } }), new webpack.optimize.UglifyJsPlugin({ - sourceMap: true, + sourceMap: false, compress: { warnings: false } diff --git a/dist/vue-tinymce.js b/dist/vue-tinymce.js index 2b29e4a..18b5eb2 100644 --- a/dist/vue-tinymce.js +++ b/dist/vue-tinymce.js @@ -1 +1 @@ -!function(I,g){"object"==typeof exports&&"object"==typeof module?module.exports=g():"function"==typeof define&&define.amd?define([],g):"object"==typeof exports?exports.VueTinymce=g():I.VueTinymce=g()}(this,function(){return function(I){function g(t){if(n[t])return n[t].exports;var c=n[t]={i:t,l:!1,exports:{}};return I[t].call(c.exports,c,c.exports,g),c.l=!0,c.exports}var n={};return g.m=I,g.c=n,g.i=function(I){return I},g.d=function(I,n,t){g.o(I,n)||Object.defineProperty(I,n,{configurable:!1,enumerable:!0,get:t})},g.n=function(I){var n=I&&I.__esModule?function(){return I.default}:function(){return I};return g.d(n,"a",n),n},g.o=function(I,g){return Object.prototype.hasOwnProperty.call(I,g)},g.p="/dist/",g(g.s=2)}([function(module,exports,__webpack_require__){eval("var Component = __webpack_require__(3)(\n /* script */\n __webpack_require__(1),\n /* template */\n null,\n /* scopeId */\n null,\n /* cssModules */\n null\n)\n\nmodule.exports = Component.exports\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvdnVlLXRpbnltY2UudnVlP2FiYzMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiMC5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBDb21wb25lbnQgPSByZXF1aXJlKFwiIS4uL25vZGVfbW9kdWxlcy92dWUtbG9hZGVyL2xpYi9jb21wb25lbnQtbm9ybWFsaXplclwiKShcbiAgLyogc2NyaXB0ICovXG4gIHJlcXVpcmUoXCIhIWJhYmVsLWxvYWRlciEuLi9ub2RlX21vZHVsZXMvdnVlLWxvYWRlci9saWIvc2VsZWN0b3I/dHlwZT1zY3JpcHQmaW5kZXg9MCEuL3Z1ZS10aW55bWNlLnZ1ZVwiKSxcbiAgLyogdGVtcGxhdGUgKi9cbiAgbnVsbCxcbiAgLyogc2NvcGVJZCAqL1xuICBudWxsLFxuICAvKiBjc3NNb2R1bGVzICovXG4gIG51bGxcbilcblxubW9kdWxlLmV4cG9ydHMgPSBDb21wb25lbnQuZXhwb3J0c1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9zcmMvdnVlLXRpbnltY2UudnVlXG4vLyBtb2R1bGUgaWQgPSAwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0=")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval('Object.defineProperty(__webpack_exports__, "__esModule", { value: true });\n\n\nvar INIT = 0;\nvar INPUT = 1;\nvar CHANGED = 2;\n\nvar tinymceSetting = {\n "menubar": false,\n "height": 500,\n "toolbar_items_size": "small",\n "style_formats": [{ "title": "Bold", "icon": "bold", "format": "bold" }, { "title": "Italic", "icon": "italic", "format": "italic" }, { "title": "Underline", "icon": "underline", "format": "underline" }, { "title": "Strikethrough", "icon": "strikethrough", "format": "strikethrough" }, { "title": "Superscript", "icon": "superscript", "format": "superscript" }, { "title": "Subscript", "icon": "subscript", "format": "subscript" }, { "title": "Code", "icon": "code", "format": "code" }],\n "block_formats": "Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;",\n "toolbar1": "insertfile undo redo | formatselect | bullist numlist | link unlink | uploadimg image media | fullscreen",\n "toolbar2": "styleselect fontsizeselect | forecolor backcolor | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | outdent indent | removeformat"\n};\n\n/* harmony default export */ __webpack_exports__["default"] = ({\n props: {\n value: {\n type: String,\n default: \'\'\n },\n setup: {\n type: Function,\n default: function _default() {}\n },\n plugins: {\n type: Array,\n default: function _default() {\n return ["advlist autolink link image lists charmap print hr anchor pagebreak spellchecker", "searchreplace visualblocks visualchars code fullscreen media nonbreaking", "table directionality emoticons template textcolor paste textcolor colorpicker textpattern"];\n }\n },\n setting: {\n type: Object,\n default: function _default() {\n return tinymceSetting;\n }\n }\n },\n render: function render(createElement) {\n return createElement(\'textarea\', {\n attrs: {\n id: this.id\n }\n });\n },\n data: function data() {\n return {\n id: \'vue-tinymce-\' + Date.now(),\n editor: null,\n status: INIT\n };\n },\n\n watchs: {\n value: function value(val) {\n if (this.status === CHANGED || selt.status === INIT) return this.status = INPUT;\n tinymce.get(this.id).setContent(val);\n }\n },\n created: function created() {\n if (typeof tinymce === "undefined") throw new Error(\'tinymce undefined\');\n },\n mounted: function mounted() {\n var _this = this;\n\n var setting = Object.assign({\n plugins: this.plugins\n }, tinymceSetting, this.setting, {\n selector: \'#\' + this.id,\n theme: \'modern\',\n setup: function setup(editor) {\n _this.setup(editor);\n _this.editor = editor;\n editor.on(\'init\', function () {\n editor.setContent(_this.value);\n editor.on(\'input change undo redo\', function () {\n if (_this.status === INPUT || _this.status === INIT) return _this.status = CHANGED;\n _this.$emit(\'input\', editor.getContent());\n });\n });\n }\n });\n\n tinymce.init(setting);\n },\n\n beforeDestroy: function beforeDestroy() {\n tinymce.remove(this.id);\n }\n});\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vdnVlLXRpbnltY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G9yIGNvbG9ycGlja2VyIHRleHRwYXR0ZXJuXCJcbiAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBzZXR0aW5nOiB7XG4gICAgICAgICAgICB0eXBlOiBPYmplY3QsXG4gICAgICAgICAgICBkZWZhdWx0OiBmdW5jdGlvbigpeyBcbiAgICAgICAgICAgICAgICByZXR1cm4gdGlueW1jZVNldHRpbmc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9LFxuICAgIHJlbmRlcihjcmVhdGVFbGVtZW50KXtcbiAgICAgICAgcmV0dXJuIGNyZWF0ZUVsZW1lbnQoJ3RleHRhcmVhJywge1xuICAgICAgICAgICAgYXR0cnM6IHtcbiAgICAgICAgICAgICAgICBpZDogdGhpcy5pZFxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9LFxuICAgIGRhdGEoKXtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIGlkOiAndnVlLXRpbnltY2UtJytEYXRlLm5vdygpLFxuICAgICAgICAgICAgZWRpdG9yOiBudWxsLFxuICAgICAgICAgICAgc3RhdHVzOiBJTklUXG4gICAgICAgIH1cbiAgICB9LFxuICAgIHdhdGNoczp7XG4gICAgICAgIHZhbHVlKHZhbCl7XG4gICAgICAgICAgICBpZih0aGlzLnN0YXR1cyA9PT0gQ0hBTkdFRCB8fCBzZWx0LnN0YXR1cyA9PT0gSU5JVCkgcmV0dXJuIHRoaXMuc3RhdHVzID0gSU5QVVQ7XG4gICAgICAgICAgICB0aW55bWNlLmdldCh0aGlzLmlkKS5zZXRDb250ZW50KHZhbCk7XG4gICAgICAgIH1cbiAgICB9LFxuICAgIGNyZWF0ZWQoKXtcbiAgICAgICAgaWYodHlwZW9mIHRpbnltY2UgPT09IFwidW5kZWZpbmVkXCIpIHRocm93IG5ldyBFcnJvcigndGlueW1jZSB1bmRlZmluZWQnKTtcbiAgICB9LFxuICAgIG1vdW50ZWQoKXtcbiAgICAgICAgY29uc3Qgc2V0dGluZyA9IE9iamVjdC5hc3NpZ24oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgcGx1Z2luczogdGhpcy5wbHVnaW5zXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdGlueW1jZVNldHRpbmcsXG4gICAgICAgICAgICB0aGlzLnNldHRpbmcsXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgc2VsZWN0b3I6ICcjJyt0aGlzLmlkLFxuICAgICAgICAgICAgICAgIHRoZW1lOiAnbW9kZXJuJyxcbiAgICAgICAgICAgICAgICBzZXR1cDogKGVkaXRvcik9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0dXAoZWRpdG9yKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5lZGl0b3IgPSBlZGl0b3I7XG4gICAgICAgICAgICAgICAgICAgIGVkaXRvci5vbignaW5pdCcsICgpPT57XG4gICAgICAgICAgICAgICAgICAgICAgICBlZGl0b3Iuc2V0Q29udGVudCh0aGlzLnZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVkaXRvci5vbignaW5wdXQgY2hhbmdlIHVuZG8gcmVkbycsICgpPT57XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodGhpcy5zdGF0dXMgPT09IElOUFVUIHx8IHRoaXMuc3RhdHVzID09PSBJTklUKSByZXR1cm4gdGhpcy5zdGF0dXMgPSBDSEFOR0VEO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuJGVtaXQoJ2lucHV0JywgZWRpdG9yLmdldENvbnRlbnQoKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICApO1xuXG4gICAgICAgIHRpbnltY2UuaW5pdChzZXR0aW5nKTtcbiAgICB9LFxuICAgIGJlZm9yZURlc3Ryb3k6IGZ1bmN0aW9uKCl7XG4gICAgICAgIHRpbnltY2UucmVtb3ZlKHRoaXMuaWQpO1xuICAgIH1cbn1cbjwvc2NyaXB0PlxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyB2dWUtdGlueW1jZS52dWU/ZWM2MTc5MjIiXSwic291cmNlUm9vdCI6IiJ9')},function(module,__webpack_exports__,__webpack_require__){"use strict";eval('Object.defineProperty(__webpack_exports__, "__esModule", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__vue_tinymce__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__vue_tinymce___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__vue_tinymce__);\n\n/* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__vue_tinymce___default.a);\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvaW5kZXguanM/OTU1MiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQTtBQUNBLCtEQUFlLG9EQUFmIiwiZmlsZSI6IjIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgVnVlVGlueW1jZSBmcm9tICcuL3Z1ZS10aW55bWNlJztcbmV4cG9ydCBkZWZhdWx0IFZ1ZVRpbnltY2U7XG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vc3JjL2luZGV4LmpzIl0sInNvdXJjZVJvb3QiOiIifQ==')},function(module,exports){eval("// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n rawScriptExports,\n compiledTemplate,\n scopeId,\n cssModules\n) {\n var esModule\n var scriptExports = rawScriptExports = rawScriptExports || {}\n\n // ES6 modules interop\n var type = typeof rawScriptExports.default\n if (type === 'object' || type === 'function') {\n esModule = rawScriptExports\n scriptExports = rawScriptExports.default\n }\n\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (compiledTemplate) {\n options.render = compiledTemplate.render\n options.staticRenderFns = compiledTemplate.staticRenderFns\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = scopeId\n }\n\n // inject cssModules\n if (cssModules) {\n var computed = Object.create(options.computed || null)\n Object.keys(cssModules).forEach(function (key) {\n var module = cssModules[key]\n computed[key] = function () { return module }\n })\n options.computed = computed\n }\n\n return {\n esModule: esModule,\n exports: scriptExports,\n options: options\n }\n}\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9+L3Z1ZS1sb2FkZXIvbGliL2NvbXBvbmVudC1ub3JtYWxpemVyLmpzP2Q0ZjMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxtQ0FBbUM7QUFDbkMsS0FBSztBQUNMO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6IjMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyB0aGlzIG1vZHVsZSBpcyBhIHJ1bnRpbWUgdXRpbGl0eSBmb3IgY2xlYW5lciBjb21wb25lbnQgbW9kdWxlIG91dHB1dCBhbmQgd2lsbFxuLy8gYmUgaW5jbHVkZWQgaW4gdGhlIGZpbmFsIHdlYnBhY2sgdXNlciBidW5k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blxuICAvLyBpbmplY3QgY3NzTW9kdWxlc1xuICBpZiAoY3NzTW9kdWxlcykge1xuICAgIHZhciBjb21wdXRlZCA9IE9iamVjdC5jcmVhdGUob3B0aW9ucy5jb21wdXRlZCB8fCBudWxsKVxuICAgIE9iamVjdC5rZXlzKGNzc01vZHVsZXMpLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgdmFyIG1vZHVsZSA9IGNzc01vZHVsZXNba2V5XVxuICAgICAgY29tcHV0ZWRba2V5XSA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuIG1vZHVsZSB9XG4gICAgfSlcbiAgICBvcHRpb25zLmNvbXB1dGVkID0gY29tcHV0ZWRcbiAgfVxuXG4gIHJldHVybiB7XG4gICAgZXNNb2R1bGU6IGVzTW9kdWxlLFxuICAgIGV4cG9ydHM6IHNjcmlwdEV4cG9ydHMsXG4gICAgb3B0aW9uczogb3B0aW9uc1xuICB9XG59XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL34vdnVlLWxvYWRlci9saWIvY29tcG9uZW50LW5vcm1hbGl6ZXIuanNcbi8vIG1vZHVsZSBpZCA9IDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sInNvdXJjZVJvb3QiOiIifQ==")}])}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueTinymce=e():t.VueTinymce=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=3)}([function(t,e,n){"use strict";e.a={menubar:!1,height:500,theme:"modern",toolbar_items_size:"small",plugins:["advlist autolink link image lists charmap print hr anchor pagebreak spellchecker","searchreplace visualblocks visualchars code fullscreen media nonbreaking","table directionality emoticons template textcolor paste textcolor colorpicker textpattern"],style_formats:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}],block_formats:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;",toolbar1:"insertfile undo redo | formatselect | bullist numlist | link unlink | uploadimg image media | fullscreen",toolbar2:"styleselect fontsizeselect | forecolor backcolor | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | outdent indent | removeformat"}},function(t,e,n){var i=n(4)(n(2),null,null,null);t.exports=i.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={props:{value:{type:String,default:""},setup:{type:Function,default:function(){}},setting:{type:Object,default:function(){return tinymceSetting}}},render:function(t){return t("div",{attrs:{id:this.id}})},data:function(){return{id:"vue-tinymce-"+Date.now(),editor:null,status:0}},watchs:{value:function(t){if(2===this.status||0===selt.status)return this.status=1;tinymce.get(this.id).setContent(t)}},created:function(){if("undefined"==typeof tinymce)throw new Error("tinymce undefined")},mounted:function(){var t=this,e=Object.assign({},this.setting,{selector:"#"+this.id,setup:function(e){t.setup(e),t.editor=e,e.on("init",function(){e.setContent(t.value),e.on("input change undo redo",function(){if(1===t.status||0===t.status)return t.status=2;t.$emit("input",e.getContent())})})}});tinymce.init(e)},beforeDestroy:function(){tinymce.remove(this.id)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n.n(i),o=n(0);n.d(e,"VueTinymce",function(){return r.a}),n.d(e,"TinymceSetting",function(){return o.a}),e.default=r.a},function(t,e){t.exports=function(t,e,n,i){var r,o=t=t||{},u=typeof t.default;"object"!==u&&"function"!==u||(r=t,o=t.default);var c="function"==typeof o?o.options:o;if(e&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns),n&&(c._scopeId=n),i){var s=Object.create(c.computed||null);Object.keys(i).forEach(function(t){var e=i[t];s[t]=function(){return e}}),c.computed=s}return{esModule:r,exports:o,options:c}}}])}); \ No newline at end of file diff --git a/example/main.js b/example/main.js index 6445fdb..a35d0fc 100644 --- a/example/main.js +++ b/example/main.js @@ -1,5 +1,6 @@ import Vue from 'vue'; -import { VueTinymce , TinymceSetting } from '../src/'; +import { VueTinymce , TinymceSetting } from '../dist/vue-tinymce'; +// import { VueTinymce , TinymceSetting } from '../src/'; Vue.component('vue-tinymce', VueTinymce);