7 lines
40 KiB
JavaScript
7 lines
40 KiB
JavaScript
|
/*!
|
||
|
* tui-editor
|
||
|
* @version 1.3.3
|
||
|
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
|
||
|
* @license MIT
|
||
|
*/
|
||
|
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("jquery"),require("tui-code-snippet"),function(){try{return require("tui-editor")}catch(e){}}(),function(){try{return require("tui-editor/dist/tui-editor-Viewer")}catch(e){}}(),require("to-mark"));else if("function"==typeof define&&define.amd)define(["jquery","tui-code-snippet","tui-editor","tui-editor/dist/tui-editor-Viewer","to-mark"],t);else{var n="object"==typeof exports?t(require("jquery"),require("tui-code-snippet"),function(){try{return require("tui-editor")}catch(e){}}(),function(){try{return require("tui-editor/dist/tui-editor-Viewer")}catch(e){}}(),require("to-mark")):t(e.$,e.tui&&e.tui.util,e.tui&&e.tui.Editor,e.tui&&e.tui.Editor,e.toMark);for(var a in n)("object"==typeof exports?exports:e)[a]=n[a]}}("undefined"!=typeof self?self:this,function(e,t,n,a,r){return function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="dist/",t(t.s=49)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=void 0;try{a=n(4)}catch(e){}if(!a)try{a=n(5)}catch(e){}t.default=a},function(e,n){e.exports=t},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){var a=(0,w.default)(e),r=a.attr("colspan"),l=a.attr("rowspan"),o=e.nodeName;if("TH"!==o&&"TD"!==o)return null;var c={nodeName:e.nodeName,colspan:r?parseInt(r,10):1,rowspan:l?parseInt(l,10):1,content:a.html(),elementIndex:{rowIndex:t,colIndex:n}};return"TH"===e.nodeName&&e.align&&(c.align=e.align),c}function l(e,t,n,a){var r=t.colspan,l=t.rowspan,o=t.nodeName,c=r>1,i=l>1;if(c||i){var d=n+l,u=a+r;y.default.range(n,d).forEach(function(t){e[t]=e[t]||[],y.default.range(a,u).forEach(function(r){var l={nodeName:o};t===n&&r===a||(c&&(l.colMergeWith=a),i&&(l.rowMergeWith=n),e[t][r]=l)})})}}function o(e){var t=[];return e.find("tr").each(function(e,n){var a=0;t[e]=t[e]||[],(0,w.default)(n).children().each(function(n,o){var c=r(o,e,n);if(c){for(var i=n+a;t[e][i];)i+=1,a+=1;t[e][i]=c,l(t,c,e,i)}})}),e[0].className&&(t.className=e[0].className),t}function c(e){var t=[];return e.forEach(function(e,n){var a=[];e.forEach(function(e,t){y.default.isUndefined(e.colMergeWith)&&y.default.isUndefined(e.rowMergeWith)&&a.push({rowIndex:n,colIndex:t})}),t.push(a)}),t}function i(e){var t=e[0];return t.map(function(e){return y.default.isExisty(e.colMergeWith)?t[e.colMergeWith].align:e.align})}function d(e,t){var n=i(e),a=t.map(function(t){return t.map(function(t){var a=t.rowIndex,r=t.colIndex;return y.default.extend({align:n[r]},e[a][r])})});return e.className&&(a.className=e.className),a}function u(e,t,n){return{nodeName:n||"TD",colspan:1,rowspan:1,content:C,elementIndex:{rowIndex:e,colIndex:t}}}function f(e){var t=e.closest("tr"),n=t.prevAll().length;return"TBODY"===t.parent()[0].nodeName&&(n+=1),n}function s(e){return e.closest("td, th").prevAll().length}function g(e,t){var n=f(t),a=s(t);return e[n][a]}function p(e,t,n){var a=e[t][n],r=t;return a.rowspan>1&&(r+=a.rowspan-1),r}function h(e,t,n){var a=e[t][n],r=n;return a.colspan>1&&(r+=a.colspan-1),r}function m(e,t,n){var a=e[t][n];return t=y.default.isExisty(a.rowMergeWith)?a.rowMergeWith:t,n=y.default.isExisty(a.colMergeWith)?a.colMergeWith:n,e[t][n].elementIndex}function v(e,t){e.forEach(function(e,n){var a=e.length;if(a){var r=e[0].nodeName;y.default.range(a,t).forEach(function(t){e.push(u(n,t,r))})}})}function b(e){var t=e[0],n=t.length,a=!0;if(!n&&e[1])y.default.range(0,e[1].length).forEach(function(e){t.push(u(0,e,"TH"))});else if("TH"!==e[0][0].nodeName){var r,l=y.default.range(0,n).map(function(e){return u(0,e,"TH")});(r=[]).concat.apply(r,e).forEach(function(e){e.
|