quill-html-edit-button
Advanced tools
Comparing version 1.0.12 to 1.0.13
@@ -1,1 +0,1 @@ | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("Quill"));else if("function"==typeof define&&define.amd)define(["Quill"],e);else{var n="object"==typeof exports?e(require("Quill")):e(t.Quill);for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=7)}([function(t,e,n){"use strict";n.r(e),n.d(e,"htmlEditButton",(function(){return l}));n(1);function r(t){return document.createElement(t)}function o(t,e,n){return t.setAttribute(e,n)}var i=!1,a={prefixString:function(){return"</> quill-html-edit-button: "},get log(){return i?console.log.bind(console,this.prefixString()):function(){}}},l=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i=n&&n.debug,a.log("logging enabled");var l=e.getModule("toolbar");if(!l)throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');var u=l.container,s=r("span");o(s,"class","ql-formats");var c=r("button");c.innerHTML="<>",c.title="Show HTML source",c.onclick=function(t){t.preventDefault(),function(t,e){var n=t.container.querySelector(".ql-editor").innerHTML,i=r("div"),l=r("div"),u=e.msg||'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced',s=e.cancelText||"Cancel",c=e.okText||"Ok";o(l,"class","ql-html-overlayContainer"),o(i,"class","ql-html-popupContainer");var f=r("i");o(f,"class","ql-html-popupTitle"),f.innerText=u;var p=r("div");p.appendChild(f),o(p,"class","ql-html-textContainer");var d=r("textarea");o(d,"class","ql-html-textArea"),d.value=function(t){for(var e=" ".repeat(2),n=0,r=null,o=null,i="",l=0;l<=t.length;l++){r=t.substr(l,1),o=t.substr(l+1,1);var u="<br>"===t.substr(l,4),s="<"===r&&"/"===o&&!u;u&&(i+="\n",n--,l+=4),"<"===r&&"/"!==o&&!u?(i+="\n"+e.repeat(n),n++):s?(--n<0&&(n=0),i+="\n"+e.repeat(n)):(" "===r&&" "===o||"\n"===r&&""===t.substr(l,t.substr(l).indexOf("<")).trim())&&(r=""),i+=r}return a.log("formatHTML",{before:t,after:i}),i}(n);var h=r("button");h.innerHTML=s,o(h,"class","ql-html-buttonCancel");var b=r("button");b.innerHTML=c;var m=r("div");o(m,"class","ql-html-buttonGroup"),m.appendChild(h),m.appendChild(b),p.appendChild(d),p.appendChild(m),i.appendChild(p),l.appendChild(i),document.body.appendChild(l),h.onclick=function(){document.body.removeChild(l)},l.onclick=h.onclick,i.onclick=function(t){t.preventDefault(),t.stopPropagation()},b.onclick=function(){var e=d.value.split(/\r?\n/g).map((function(t){return t.trim()})).join("");t.container.querySelector(".ql-editor").innerHTML=e,document.body.removeChild(l)}}(e,n)},s.appendChild(c),u.appendChild(s)};window.htmlEditButton=l,e.default=l},function(t,e,n){var r=n(2);"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0};n(4)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(3)(!1)).push([t.i,".ql-html-overlayContainer {\n background: #0000007d;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 9999;\n}\n\n.ql-html-popupContainer {\n background: #ddd;\n position: absolute;\n top: 5%;\n left: 5%;\n right: 5%;\n bottom: 5%;\n border-radius: 10px;\n}\n\n.ql-html-textContainer {\n position: relative;\n width: calc(100% - 40px);\n height: calc(100% - 40px);\n padding: 20px;\n}\n\n.ql-html-textArea {\n position: absolute;\n left: 15px;\n width: calc(100% - 45px);\n height: calc(100% - 116px);\n}\n\n.ql-html-buttonCancel {\n margin-right: 20px;\n}\n\n.ql-html-popupTitle {\n margin: 0;\n display: block;\n}\n\n.ql-html-buttonGroup {\n position: absolute;\n bottom: 20px;\n transform: scale(1.5);\n left: calc(50% - 60px);\n}\n",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=r.sources.map((function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"}));return[n].concat(i).concat([o]).join("\n")}var a;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var a=t[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},function(t,e,n){var r,o,i={},a=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),l=function(t){var e={};return function(n){if(void 0===e[n]){var r=t.call(this,n);if(r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[n]=r}return e[n]}}((function(t){return document.querySelector(t)})),u=null,s=0,c=[],f=n(5);function p(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=i[r.id];if(o){o.refs++;for(var a=0;a<o.parts.length;a++)o.parts[a](r.parts[a]);for(;a<r.parts.length;a++)o.parts.push(g(r.parts[a],e))}else{var l=[];for(a=0;a<r.parts.length;a++)l.push(g(r.parts[a],e));i[r.id]={id:r.id,refs:1,parts:l}}}}function d(t,e){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],a=e.base?i[0]+e.base:i[0],l={css:i[1],media:i[2],sourceMap:i[3]};r[a]?r[a].parts.push(l):n.push(r[a]={id:a,parts:[l]})}return n}function h(t,e){var n=l(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=c[c.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),c.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=l(t.insertInto+" "+t.insertAt.before);n.insertBefore(e,o)}}function b(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function m(t){var e=document.createElement("style");return t.attrs.type="text/css",v(e,t.attrs),h(t,e),e}function v(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function g(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var a=s++;n=u||(u=m(e)),r=w.bind(null,n,a,!1),o=w.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",v(e,t.attrs),h(t,e),e}(e),r=j.bind(null,n,e),o=function(){b(n),n.href&&URL.revokeObjectURL(n.href)}):(n=m(e),r=C.bind(null,n),o=function(){b(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return p(n,e),function(t){for(var r=[],o=0;o<n.length;o++){var a=n[o];(l=i[a.id]).refs--,r.push(l)}t&&p(d(t,e),e);for(o=0;o<r.length;o++){var l;if(0===(l=r[o]).refs){for(var u=0;u<l.parts.length;u++)l.parts[u]();delete i[l.id]}}}};var y,x=(y=[],function(t,e){return y[t]=e,y.filter(Boolean).join("\n")});function w(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=x(e,o);else{var i=document.createTextNode(o),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}function C(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function j(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=f(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),l=t.href;t.href=URL.createObjectURL(a),l&&URL.revokeObjectURL(l)}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var o,i=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}},function(e,n){e.exports=t},function(t,e,n){"use strict";n.r(e);var r=n(6),o=n.n(r),i=n(0);o.a.register("modules/htmlEditButton",i.htmlEditButton);console.log("Demo loaded...");new o.a("#editor",{theme:"snow",modules:{toolbar:{container:[[{header:[1,2,3,!1]}],["bold","italic"],["clean"],["image"]]},htmlEditButton:{debug:!0}}})}])})); | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("Quill"));else if("function"==typeof define&&define.amd)define(["Quill"],e);else{var n="object"==typeof exports?e(require("Quill")):e(t.Quill);for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=7)}([function(e,n){e.exports=t},function(t,e,n){"use strict";n.r(e),n.d(e,"htmlEditButton",(function(){return d}));n(2);var r=n(0),o=n.n(r);function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var a=o.a.import("blots/block"),u=function(t){function e(){return i(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(a);function s(t){return document.createElement(t)}function c(t,e,n){return t.setAttribute(e,n)}u.tagName="div",u.blotName="div",u.allowedChildren=a.allowedChildren,u.allowedChildren.push(a),o.a.register(u);var f=!1,p={prefixString:function(){return"</> quill-html-edit-button: "},get log(){return f?console.log.bind(console,this.prefixString()):function(){}}},d=function t(e,n){i(this,t),f=n&&n.debug,p.log("logging enabled");var r=e.getModule("toolbar");if(!r)throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');var o=r.container,l=s("span");c(l,"class","ql-formats");var a=s("button");a.innerHTML="<>",a.title="Show HTML source",a.onclick=function(t){t.preventDefault(),function(t,e){var n=t.container.querySelector(".ql-editor").innerHTML,r=s("div"),o=s("div"),i=e.msg||'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced',l=e.cancelText||"Cancel",a=e.okText||"Ok";c(o,"class","ql-html-overlayContainer"),c(r,"class","ql-html-popupContainer");var u=s("i");c(u,"class","ql-html-popupTitle"),u.innerText=i;var f=s("div");f.appendChild(u),c(f,"class","ql-html-textContainer");var d=s("textarea");c(d,"class","ql-html-textArea"),d.value=function(t){for(var e=" ".repeat(2),n=0,r=null,o=null,i="",l=0;l<=t.length;l++){r=t.substr(l,1),o=t.substr(l+1,1);var a="<br>"===t.substr(l,4),u="<"===r&&"/"===o&&!a;a&&(i+="\n",n--,l+=4),"<"===r&&"/"!==o&&!a?(i+="\n"+e.repeat(n),n++):u?(--n<0&&(n=0),i+="\n"+e.repeat(n)):(" "===r&&" "===o||"\n"===r&&""===t.substr(l,t.substr(l).indexOf("<")).trim())&&(r=""),i+=r}return p.log("formatHTML",{before:t,after:i}),i}(n);var h=s("button");h.innerHTML=l,c(h,"class","ql-html-buttonCancel");var b=s("button");b.innerHTML=a;var m=s("div");c(m,"class","ql-html-buttonGroup"),m.appendChild(h),m.appendChild(b),f.appendChild(d),f.appendChild(m),r.appendChild(f),o.appendChild(r),document.body.appendChild(o),h.onclick=function(){document.body.removeChild(o)},o.onclick=h.onclick,r.onclick=function(t){t.preventDefault(),t.stopPropagation()},b.onclick=function(){var e=d.value.split(/\r?\n/g).map((function(t){return t.trim()})).join("");t.container.querySelector(".ql-editor").innerHTML=e,document.body.removeChild(o)}}(e,n)},l.appendChild(a),o.appendChild(l)};window.htmlEditButton=d,e.default=d},function(t,e,n){var r=n(3);"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0};n(5)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(4)(!1)).push([t.i,".ql-html-overlayContainer {\n background: #0000007d;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 9999;\n}\n\n.ql-html-popupContainer {\n background: #ddd;\n position: absolute;\n top: 5%;\n left: 5%;\n right: 5%;\n bottom: 5%;\n border-radius: 10px;\n}\n\n.ql-html-textContainer {\n position: relative;\n width: calc(100% - 40px);\n height: calc(100% - 40px);\n padding: 20px;\n}\n\n.ql-html-textArea {\n position: absolute;\n left: 15px;\n width: calc(100% - 45px);\n height: calc(100% - 116px);\n}\n\n.ql-html-buttonCancel {\n margin-right: 20px;\n}\n\n.ql-html-popupTitle {\n margin: 0;\n display: block;\n}\n\n.ql-html-buttonGroup {\n position: absolute;\n bottom: 20px;\n transform: scale(1.5);\n left: calc(50% - 60px);\n}\n",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=(l=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(l))))+" */"),i=r.sources.map((function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"}));return[n].concat(i).concat([o]).join("\n")}var l;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var l=t[o];"number"==typeof l[0]&&r[l[0]]||(n&&!l[2]?l[2]=n:n&&(l[2]="("+l[2]+") and ("+n+")"),e.push(l))}},e}},function(t,e,n){var r,o,i={},l=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),a=function(t){var e={};return function(n){if(void 0===e[n]){var r=t.call(this,n);if(r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[n]=r}return e[n]}}((function(t){return document.querySelector(t)})),u=null,s=0,c=[],f=n(6);function p(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=i[r.id];if(o){o.refs++;for(var l=0;l<o.parts.length;l++)o.parts[l](r.parts[l]);for(;l<r.parts.length;l++)o.parts.push(y(r.parts[l],e))}else{var a=[];for(l=0;l<r.parts.length;l++)a.push(y(r.parts[l],e));i[r.id]={id:r.id,refs:1,parts:a}}}}function d(t,e){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],l=e.base?i[0]+e.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};r[l]?r[l].parts.push(a):n.push(r[l]={id:l,parts:[a]})}return n}function h(t,e){var n=a(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=c[c.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),c.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=a(t.insertInto+" "+t.insertAt.before);n.insertBefore(e,o)}}function b(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function m(t){var e=document.createElement("style");return t.attrs.type="text/css",v(e,t.attrs),h(t,e),e}function v(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function y(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var l=s++;n=u||(u=m(e)),r=w.bind(null,n,l,!1),o=w.bind(null,n,l,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",v(e,t.attrs),h(t,e),e}(e),r=j.bind(null,n,e),o=function(){b(n),n.href&&URL.revokeObjectURL(n.href)}):(n=m(e),r=C.bind(null,n),o=function(){b(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=l()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return p(n,e),function(t){for(var r=[],o=0;o<n.length;o++){var l=n[o];(a=i[l.id]).refs--,r.push(a)}t&&p(d(t,e),e);for(o=0;o<r.length;o++){var a;if(0===(a=r[o]).refs){for(var u=0;u<a.parts.length;u++)a.parts[u]();delete i[a.id]}}}};var g,x=(g=[],function(t,e){return g[t]=e,g.filter(Boolean).join("\n")});function w(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=x(e,o);else{var i=document.createTextNode(o),l=t.childNodes;l[e]&&t.removeChild(l[e]),l.length?t.insertBefore(i,l[e]):t.appendChild(i)}}function C(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function j(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=f(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var l=new Blob([r],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(l),a&&URL.revokeObjectURL(a)}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var o,i=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}},function(t,e,n){"use strict";n.r(e);var r=n(0),o=n.n(r),i=n(1);o.a.register("modules/htmlEditButton",i.htmlEditButton);console.log("Demo loaded...");new o.a("#editor",{theme:"snow",modules:{toolbar:{container:[[{header:[1,2,3,!1]}],["bold","italic"],["clean"],["image"]]},htmlEditButton:{debug:!0}}})}])})); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"htmlEditButton",(function(){return l}));n(1);function r(t){return document.createElement(t)}function o(t,e,n){return t.setAttribute(e,n)}var i=!1,a={prefixString:function(){return"</> quill-html-edit-button: "},get log(){return i?console.log.bind(console,this.prefixString()):function(){}}},l=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i=n&&n.debug,a.log("logging enabled");var l=e.getModule("toolbar");if(!l)throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');var s=l.container,u=r("span");o(u,"class","ql-formats");var c=r("button");c.innerHTML="<>",c.title="Show HTML source",c.onclick=function(t){t.preventDefault(),function(t,e){var n=t.container.querySelector(".ql-editor").innerHTML,i=r("div"),l=r("div"),s=e.msg||'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced',u=e.cancelText||"Cancel",c=e.okText||"Ok";o(l,"class","ql-html-overlayContainer"),o(i,"class","ql-html-popupContainer");var f=r("i");o(f,"class","ql-html-popupTitle"),f.innerText=s;var p=r("div");p.appendChild(f),o(p,"class","ql-html-textContainer");var d=r("textarea");o(d,"class","ql-html-textArea"),d.value=function(t){for(var e=" ".repeat(2),n=0,r=null,o=null,i="",l=0;l<=t.length;l++){r=t.substr(l,1),o=t.substr(l+1,1);var s="<br>"===t.substr(l,4),u="<"===r&&"/"===o&&!s;s&&(i+="\n",n--,l+=4),"<"===r&&"/"!==o&&!s?(i+="\n"+e.repeat(n),n++):u?(--n<0&&(n=0),i+="\n"+e.repeat(n)):(" "===r&&" "===o||"\n"===r&&""===t.substr(l,t.substr(l).indexOf("<")).trim())&&(r=""),i+=r}return a.log("formatHTML",{before:t,after:i}),i}(n);var h=r("button");h.innerHTML=u,o(h,"class","ql-html-buttonCancel");var b=r("button");b.innerHTML=c;var v=r("div");o(v,"class","ql-html-buttonGroup"),v.appendChild(h),v.appendChild(b),p.appendChild(d),p.appendChild(v),i.appendChild(p),l.appendChild(i),document.body.appendChild(l),h.onclick=function(){document.body.removeChild(l)},l.onclick=h.onclick,i.onclick=function(t){t.preventDefault(),t.stopPropagation()},b.onclick=function(){var e=d.value.split(/\r?\n/g).map((function(t){return t.trim()})).join("");t.container.querySelector(".ql-editor").innerHTML=e,document.body.removeChild(l)}}(e,n)},u.appendChild(c),s.appendChild(u)};window.htmlEditButton=l,e.default=l},function(t,e,n){var r=n(2);"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0};n(4)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(3)(!1)).push([t.i,".ql-html-overlayContainer {\n background: #0000007d;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 9999;\n}\n\n.ql-html-popupContainer {\n background: #ddd;\n position: absolute;\n top: 5%;\n left: 5%;\n right: 5%;\n bottom: 5%;\n border-radius: 10px;\n}\n\n.ql-html-textContainer {\n position: relative;\n width: calc(100% - 40px);\n height: calc(100% - 40px);\n padding: 20px;\n}\n\n.ql-html-textArea {\n position: absolute;\n left: 15px;\n width: calc(100% - 45px);\n height: calc(100% - 116px);\n}\n\n.ql-html-buttonCancel {\n margin-right: 20px;\n}\n\n.ql-html-popupTitle {\n margin: 0;\n display: block;\n}\n\n.ql-html-buttonGroup {\n position: absolute;\n bottom: 20px;\n transform: scale(1.5);\n left: calc(50% - 60px);\n}\n",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=r.sources.map((function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"}));return[n].concat(i).concat([o]).join("\n")}var a;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var a=t[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},function(t,e,n){var r,o,i={},a=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),l=function(t){var e={};return function(n){if(void 0===e[n]){var r=t.call(this,n);if(r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[n]=r}return e[n]}}((function(t){return document.querySelector(t)})),s=null,u=0,c=[],f=n(5);function p(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=i[r.id];if(o){o.refs++;for(var a=0;a<o.parts.length;a++)o.parts[a](r.parts[a]);for(;a<r.parts.length;a++)o.parts.push(y(r.parts[a],e))}else{var l=[];for(a=0;a<r.parts.length;a++)l.push(y(r.parts[a],e));i[r.id]={id:r.id,refs:1,parts:l}}}}function d(t,e){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],a=e.base?i[0]+e.base:i[0],l={css:i[1],media:i[2],sourceMap:i[3]};r[a]?r[a].parts.push(l):n.push(r[a]={id:a,parts:[l]})}return n}function h(t,e){var n=l(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=c[c.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),c.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=l(t.insertInto+" "+t.insertAt.before);n.insertBefore(e,o)}}function b(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function v(t){var e=document.createElement("style");return t.attrs.type="text/css",m(e,t.attrs),h(t,e),e}function m(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function y(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var a=u++;n=s||(s=v(e)),r=w.bind(null,n,a,!1),o=w.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",m(e,t.attrs),h(t,e),e}(e),r=j.bind(null,n,e),o=function(){b(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),r=C.bind(null,n),o=function(){b(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return p(n,e),function(t){for(var r=[],o=0;o<n.length;o++){var a=n[o];(l=i[a.id]).refs--,r.push(l)}t&&p(d(t,e),e);for(o=0;o<r.length;o++){var l;if(0===(l=r[o]).refs){for(var s=0;s<l.parts.length;s++)l.parts[s]();delete i[l.id]}}}};var g,x=(g=[],function(t,e){return g[t]=e,g.filter(Boolean).join("\n")});function w(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=x(e,o);else{var i=document.createTextNode(o),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}function C(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function j(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=f(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),l=t.href;t.href=URL.createObjectURL(a),l&&URL.revokeObjectURL(l)}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var o,i=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}}])})); | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("Quill"));else if("function"==typeof define&&define.amd)define(["Quill"],e);else{var n="object"==typeof exports?e(require("Quill")):e(t.Quill);for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=1)}([function(e,n){e.exports=t},function(t,e,n){"use strict";n.r(e),n.d(e,"htmlEditButton",(function(){return d}));n(2);var r=n(0),o=n.n(r);function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var l=o.a.import("blots/block"),u=function(t){function e(){return i(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(l);function s(t){return document.createElement(t)}function c(t,e,n){return t.setAttribute(e,n)}u.tagName="div",u.blotName="div",u.allowedChildren=l.allowedChildren,u.allowedChildren.push(l),o.a.register(u);var f=!1,p={prefixString:function(){return"</> quill-html-edit-button: "},get log(){return f?console.log.bind(console,this.prefixString()):function(){}}},d=function t(e,n){i(this,t),f=n&&n.debug,p.log("logging enabled");var r=e.getModule("toolbar");if(!r)throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');var o=r.container,a=s("span");c(a,"class","ql-formats");var l=s("button");l.innerHTML="<>",l.title="Show HTML source",l.onclick=function(t){t.preventDefault(),function(t,e){var n=t.container.querySelector(".ql-editor").innerHTML,r=s("div"),o=s("div"),i=e.msg||'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced',a=e.cancelText||"Cancel",l=e.okText||"Ok";c(o,"class","ql-html-overlayContainer"),c(r,"class","ql-html-popupContainer");var u=s("i");c(u,"class","ql-html-popupTitle"),u.innerText=i;var f=s("div");f.appendChild(u),c(f,"class","ql-html-textContainer");var d=s("textarea");c(d,"class","ql-html-textArea"),d.value=function(t){for(var e=" ".repeat(2),n=0,r=null,o=null,i="",a=0;a<=t.length;a++){r=t.substr(a,1),o=t.substr(a+1,1);var l="<br>"===t.substr(a,4),u="<"===r&&"/"===o&&!l;l&&(i+="\n",n--,a+=4),"<"===r&&"/"!==o&&!l?(i+="\n"+e.repeat(n),n++):u?(--n<0&&(n=0),i+="\n"+e.repeat(n)):(" "===r&&" "===o||"\n"===r&&""===t.substr(a,t.substr(a).indexOf("<")).trim())&&(r=""),i+=r}return p.log("formatHTML",{before:t,after:i}),i}(n);var h=s("button");h.innerHTML=a,c(h,"class","ql-html-buttonCancel");var b=s("button");b.innerHTML=l;var v=s("div");c(v,"class","ql-html-buttonGroup"),v.appendChild(h),v.appendChild(b),f.appendChild(d),f.appendChild(v),r.appendChild(f),o.appendChild(r),document.body.appendChild(o),h.onclick=function(){document.body.removeChild(o)},o.onclick=h.onclick,r.onclick=function(t){t.preventDefault(),t.stopPropagation()},b.onclick=function(){var e=d.value.split(/\r?\n/g).map((function(t){return t.trim()})).join("");t.container.querySelector(".ql-editor").innerHTML=e,document.body.removeChild(o)}}(e,n)},a.appendChild(l),o.appendChild(a)};window.htmlEditButton=d,e.default=d},function(t,e,n){var r=n(3);"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0};n(5)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(4)(!1)).push([t.i,".ql-html-overlayContainer {\n background: #0000007d;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 9999;\n}\n\n.ql-html-popupContainer {\n background: #ddd;\n position: absolute;\n top: 5%;\n left: 5%;\n right: 5%;\n bottom: 5%;\n border-radius: 10px;\n}\n\n.ql-html-textContainer {\n position: relative;\n width: calc(100% - 40px);\n height: calc(100% - 40px);\n padding: 20px;\n}\n\n.ql-html-textArea {\n position: absolute;\n left: 15px;\n width: calc(100% - 45px);\n height: calc(100% - 116px);\n}\n\n.ql-html-buttonCancel {\n margin-right: 20px;\n}\n\n.ql-html-popupTitle {\n margin: 0;\n display: block;\n}\n\n.ql-html-buttonGroup {\n position: absolute;\n bottom: 20px;\n transform: scale(1.5);\n left: calc(50% - 60px);\n}\n",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=r.sources.map((function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"}));return[n].concat(i).concat([o]).join("\n")}var a;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var a=t[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},function(t,e,n){var r,o,i={},a=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),l=function(t){var e={};return function(n){if(void 0===e[n]){var r=t.call(this,n);if(r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[n]=r}return e[n]}}((function(t){return document.querySelector(t)})),u=null,s=0,c=[],f=n(6);function p(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=i[r.id];if(o){o.refs++;for(var a=0;a<o.parts.length;a++)o.parts[a](r.parts[a]);for(;a<r.parts.length;a++)o.parts.push(y(r.parts[a],e))}else{var l=[];for(a=0;a<r.parts.length;a++)l.push(y(r.parts[a],e));i[r.id]={id:r.id,refs:1,parts:l}}}}function d(t,e){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],a=e.base?i[0]+e.base:i[0],l={css:i[1],media:i[2],sourceMap:i[3]};r[a]?r[a].parts.push(l):n.push(r[a]={id:a,parts:[l]})}return n}function h(t,e){var n=l(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=c[c.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),c.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=l(t.insertInto+" "+t.insertAt.before);n.insertBefore(e,o)}}function b(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function v(t){var e=document.createElement("style");return t.attrs.type="text/css",m(e,t.attrs),h(t,e),e}function m(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function y(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var a=s++;n=u||(u=v(e)),r=w.bind(null,n,a,!1),o=w.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",m(e,t.attrs),h(t,e),e}(e),r=j.bind(null,n,e),o=function(){b(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),r=C.bind(null,n),o=function(){b(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return p(n,e),function(t){for(var r=[],o=0;o<n.length;o++){var a=n[o];(l=i[a.id]).refs--,r.push(l)}t&&p(d(t,e),e);for(o=0;o<r.length;o++){var l;if(0===(l=r[o]).refs){for(var u=0;u<l.parts.length;u++)l.parts[u]();delete i[l.id]}}}};var g,x=(g=[],function(t,e){return g[t]=e,g.filter(Boolean).join("\n")});function w(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=x(e,o);else{var i=document.createTextNode(o),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}function C(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function j(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=f(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),l=t.href;t.href=URL.createObjectURL(a),l&&URL.revokeObjectURL(l)}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var o,i=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}}])})); |
{ | ||
"name": "quill-html-edit-button", | ||
"description": "A Quill rich text editor Module which adds an html edit button to the quill editor", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"main": "dist/quill.htmlEditButton.min.js", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/benwinding/quill-html-edit-button", |
import './styles.css'; | ||
// To allow divs to be inserted into html editor | ||
// obtained from issue: https://github.com/quilljs/quill/issues/2040 | ||
import Quill from "quill"; | ||
var Block = Quill.import('blots/block'); | ||
class Div extends Block {} | ||
Div.tagName = "div"; | ||
Div.blotName = "div"; | ||
Div.allowedChildren = Block.allowedChildren; | ||
Div.allowedChildren.push(Block) | ||
Quill.register(Div); | ||
function $create(elName) { | ||
@@ -4,0 +15,0 @@ return document.createElement(elName); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62800
257
3