agenda-libre-ruby/public/assets/tinymce/plugins/table/plugin-dbea734fa37f0c2143ea225ff48c358261941b6cf347292de89f6d503a16cd27.js

3 lines
47 KiB
JavaScript
Raw Normal View History

2017-10-08 11:38:34 +02:00
!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("c",tinymce.util.Tools.resolve),g("1",["c"],function(a){return a("tinymce.dom.TreeWalker")}),g("2",["c"],function(a){return a("tinymce.Env")}),g("3",["c"],function(a){return a("tinymce.PluginManager")}),g("4",["c"],function(a){return a("tinymce.util.Tools")}),g("5",["c"],function(a){return a("tinymce.util.VK")}),g("a",["2"],function(a){function b(b){(!a.ie||a.ie>9)&&(b.hasChildNodes()||(b.innerHTML='<br data-mce-bogus="1" />'))}var c=function(a){return function(b,c){b&&(c=parseInt(c,10),1===c||0===c?b.removeAttribute(a,1):b.setAttribute(a,c,1))}},d=function(a){return function(b){return parseInt(b.getAttribute(a)||1,10)}};return{setColSpan:c("colSpan"),setRowSpan:c("rowspan"),getColSpan:d("colSpan"),getRowSpan:d("rowSpan"),setSpanVal:function(a,b,d){c(b)(a,d)},getSpanVal:function(a,b){return d(b)(a)},paddCell:b}}),g("d",["4","a"],function(a,b){var c=function(a,b,c){return a[c]?a[c][b]:null},d=function(a,b,d){var e=c(a,b,d);return e?e.elm:null},e=function(a,b,e,f){var g,h,i=0,j=d(a,b,e);for(g=e;(f>0?g<a.length:g>=0)&&(h=c(a,b,g),j===h.elm);g+=f)i++;return i},f=function(a,b,c){for(var d,e=a[c],f=b;f<e.length;f++)if(d=e[f],d.real)return d.elm;return null},g=function(a,c){for(var d,f=[],g=a[c],h=0;h<g.length;h++)d=g[h],f.push({elm:d.elm,above:e(a,h,c,-1)-1,below:e(a,h,c,1)-1}),h+=b.getColSpan(d.elm)-1;return f},h=function(a,c){var d=a.elm.ownerDocument,e=d.createElement("td");return b.setColSpan(e,b.getColSpan(a.elm)),b.setRowSpan(e,c),b.paddCell(e),e},i=function(a,b,c,d){var e=f(a,c+1,d);e?e.parentNode.insertBefore(b,e):(e=f(a,0,d),e.parentNode.appendChild(b))},j=function(a,c,d,e){if(0!==c.above){b.setRowSpan(c.elm,c.above);var f=h(c,c.below+1);return i(a,f,d,e),f}return null},k=function(a,c,d,e){if(0!==c.below){b.setRowSpan(c.elm,c.above+1);var f=h(c,c.below);return i(a,f,d,e+1),f}return null},l=function(b,c,e,f){var h=g(b,e),i=d(b,c,e).parentNode,l=[];return a.each(h,function(a,c){var d=f?j(b,a,c,e):k(b,a,c,e);null!==d&&l.push(l)}),{cells:l,row:i}};return{splitAt:l}}),g("6",["4","2","a","d"],function(a,b,c,d){var e=a.each,f=c.getSpanVal,g=c.setSpanVal;return function(h,i,j){function k(){h.$("td[data-mce-selected],th[data-mce-selected]").removeAttr("data-mce-selected")}function l(a){return a===h.getBody()}function m(b,c){return b?(c=a.map(c.split(","),function(a){return a.toLowerCase()}),a.grep(b.childNodes,function(b){return a.inArray(c,b.nodeName.toLowerCase())!==-1})):[]}function n(){var a=0;Z=[],$=0,e(["thead","tbody","tfoot"],function(b){var c=m(i,b)[0],d=m(c,"tr");e(d,function(c,d){d+=a,e(m(c,"td,th"),function(a,c){var e,g,h,i;if(Z[d])for(;Z[d][c];)c++;for(h=f(a,"rowspan"),i=f(a,"colspan"),g=d;g<d+h;g++)for(Z[g]||(Z[g]=[]),e=c;e<c+i;e++)Z[g][e]={part:b,real:g==d&&e==c,elm:a,rowspan:h,colspan:i};$=Math.max($,c+1)})}),a+=d.length})}function o(a){return h.fire("newrow",{node:a}),a}function p(a){return h.fire("newcell",{node:a}),a}function q(a,b){return a=a.cloneNode(b),a.removeAttribute("id"),a}function r(a,b){var c;if(c=Z[b])return c[a]}function s(a,b){return a[b]?a[b]:null}function t(a,b){for(var c=[],d=0;d<a.length;d++)c.push(r(b,d));return c}function u(a){return a&&(!!ca.getAttrib(a.elm,"data-mce-selected")||a==j)}function v(){var a=[];return e(i.rows,function(b){e(b.cells,function(c){if(ca.getAttrib(c,"data-mce-selected")||j&&c==j.elm)return a.push(b),!1})}),a}function w(){var a=0;ret
return d.on("init",function(){d.dom.bind(k(),"mousedown",ea)}),d.on("ObjectResized",function(b){var c=b.target;if("TABLE"===c.nodeName){var e=[];a.each(c.rows,function(b){a.each(b.cells,function(a){var b=d.dom.getStyle(a,"width",!0);e.push({cell:a,width:b})})}),a.each(e,function(a){d.dom.setStyle(a.cell,"width",a.width),d.dom.setAttrib(a.cell,"width",null)})}}),d.on("mouseover",function(a){if(!ga){var b=d.dom.getParent(a.target,"table");("TABLE"===a.target.nodeName||b)&&(c=b,u(b))}}),d.on("keydown",function(a){switch(a.keyCode){case b.LEFT:case b.RIGHT:case b.UP:case b.DOWN:t()}}),d.on("remove",function(){t(),d.dom.unbind(k(),"mousedown",ea)}),{adjustWidth:S,adjustHeight:T,clearBars:t,drawBars:E,determineDeltas:L,getTableGrid:z,getTableDetails:y,getWidths:I,getPixelHeights:K,isPercentageBasedSize:Q,isPixelBasedSize:R,recalculateWidths:N,recalculateCellHeights:O,recalculateRowHeights:P}}}),g("e",["c"],function(a){return a("tinymce.util.Delay")}),g("b",["5","e","2","4","a"],function(a,b,c,d,e){var f=d.each,g=e.getSpanVal;return function(h){function i(){function c(c){function d(a,b){var d=a?"previousSibling":"nextSibling",f=h.dom.getParent(b,"tr"),g=f[d];if(g)return r(h,b,g,a),c.preventDefault(),!0;var i=h.dom.getParent(f,"table"),l=f.parentNode,m=l.nodeName.toLowerCase();if("tbody"===m||m===(a?"tfoot":"thead")){var n=e(a,i,l,"tbody");if(null!==n)return j(a,n,b)}return k(a,f,d,i)}function e(a,b,c,d){var e=h.dom.select(">"+d,b),f=e.indexOf(c);if(a&&0===f||!a&&f===e.length-1)return i(a,b);if(f===-1){var g="thead"===c.tagName.toLowerCase()?0:e.length-1;return e[g]}return e[f+(a?-1:1)]}function i(a,b){var c=a?"thead":"tfoot",d=h.dom.select(">"+c,b);return 0!==d.length?d[0]:null}function j(a,b,d){var e=l(b,a);return e&&r(h,d,e,a),c.preventDefault(),!0}function k(a,b,e,f){var g=f[e];if(g)return m(g),!0;var i=h.dom.getParent(f,"td,th");if(i)return d(a,i,c);var j=l(b,!a);return m(j),c.preventDefault(),!1}function l(a,b){var c=a&&a[b?"lastChild":"firstChild"];return c&&"BR"===c.nodeName?h.dom.getParent(c,"td,th"):c}function m(a){h.selection.select(a,!0),h.selection.collapse(!0)}function n(){return u==a.UP||u==a.DOWN}function o(a){var b=a.selection.getNode(),c=a.dom.getParent(b,"tr");return null!==c}function p(a){for(var b=0,c=a;c.previousSibling;)c=c.previousSibling,b+=g(c,"colspan");return b}function q(a,b){var c=0,d=0;return f(a.children,function(a,e){if(c+=g(a,"colspan"),d=e,c>b)return!1}),d}function r(a,b,c,d){var e=p(h.dom.getParent(b,"td,th")),f=q(c,e),g=c.childNodes[f],i=l(g,d);m(i||g)}function s(a){var b=h.selection.getNode(),c=h.dom.getParent(b,"td,th"),d=h.dom.getParent(a,"td,th");return c&&c!==d&&t(c,d)}function t(a,b){return h.dom.getParent(a,"TABLE")===h.dom.getParent(b,"TABLE")}var u=c.keyCode;if(n()&&o(h)){var v=h.selection.getNode();b.setEditorTimeout(h,function(){s(v)&&d(!c.shiftKey&&u===a.UP,v,c)},0)}}h.on("KeyDown",function(a){c(a)})}function j(){function a(a,b){var c,d=b.ownerDocument,e=d.createRange();return e.setStartBefore(b),e.setEnd(a.endContainer,a.endOffset),c=d.createElement("body"),c.appendChild(e.cloneContents()),0===c.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}h.on("KeyDown",function(b){var c,d,e=h.dom;37!=b.keyCode&&38!=b.keyCode||(c=h.selection.getRng(),d=e.getParent(c.startContainer,"table"),d&&h.getBody().firstChild==d&&a(c,d)&&(c=e.createRng(),c.setStartBefore(d),c.setEndBefore(d),h.selection.setRng(c),b.preventDefault()))})}function k(){h.on("KeyDown SetContent VisualAid",function(){var a;for(a=h.getBody().lastChild;a;a=a.previousSibling)if(3==a.nodeType){if(a.nodeValue.length>0)break}else if(1==a.nodeType&&("BR"==a.tagName||!a.getAttribute("data-mce-bogus")))break;a&&"TABLE"==a.nodeName&&(h.settings.forced_root_block?h.dom.add(h.getBody(),h.settings.forced_root_block,h.settings.forced_root_block_attrs,c.ie&&c.ie<10?"&nbsp;":'<br data-mce-bogus="1" />'):h.dom.add(h.getBody(),"br",{"data-mce-bogus":"1"}))}),h.on("PreProcess",function(a){var b=a.node.lastChild;b&&("BR"==b.nodeName||1==b.childNodes.length&&("BR"==b.firstChild.nodeName||"\xa0