mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-23 04:29:21 +00:00
3 lines
58 KiB
JavaScript
3 lines
58 KiB
JavaScript
|
/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
|
||
|
|
||
|
!function(o){"use strict";function e(e,t){return typeof t===e}o=o&&o.hasOwnProperty("default")?o.default:o;var ye=e.bind(null,"string"),xe=e.bind(null,"undefined"),we=e.bind(null,"function"),i=e.bind(null,"number");function t(e){return!Object.keys(e).length}function Ce(e,t){for(var n=e===!!e,o=n?2:1,i=n?t:e,r=!!n&&e;o<arguments.length;o++){var a=arguments[o];for(var l in a){var c=a[l];if(!xe(c)){var s=null!==c&&"object"==typeof c&&Object.getPrototypeOf(c)===Object.prototype,u=Array.isArray(c);i[l]=r&&(s||u)?Ce(!0,i[l]||(u?[]:{}),c):c}}}return i}function Ee(e,t){var n=e.indexOf(t);-1<n&&e.splice(n,1)}function Se(t,n){if(Array.isArray(t)||"length"in t&&i(t.length))for(var e=0;e<t.length;e++)n(e,t[e]);else Object.keys(t).forEach(function(e){n(e,t[e])})}var r={},ke=1,Te=3;function a(e){return e=parseFloat(e),isFinite(e)?e:0}function De(e,t,n){var o=(n||document).createElement(e);return Se(t||{},function(e,t){"style"===e?o.style.cssText=t:e in o?o[e]=t:o.setAttribute(e,t)}),o}function Ne(e,t){for(var n=e||{};(n=n.parentNode)&&!/(9|11)/.test(n.nodeType);)if(!t||je(n,t))return n}function Me(e,t){return je(e,t)?e:Ne(e,t)}function Re(e){e.parentNode&&e.parentNode.removeChild(e)}function He(e,t){e.appendChild(t)}function Fe(e,t){return e.querySelectorAll(t)}var _e=!0;function ze(n,e,o,i,r){e.split(" ").forEach(function(e){var t;ye(o)?(t=i["_sce-event-"+e+o]||function(e){for(var t=e.target;t&&t!==n;){if(je(t,o))return void i.call(t,e);t=t.parentNode}},i["_sce-event-"+e+o]=t):(t=o,r=i),n.addEventListener(e,t,r||!1)})}function Ae(n,e,o,i,r){e.split(" ").forEach(function(e){var t;ye(o)?t=i["_sce-event-"+e+o]:(t=o,r=i),n.removeEventListener(e,t,r||!1)})}function Oe(e,t,n){if(arguments.length<3)return e.getAttribute(t);null==n?l(e,t):e.setAttribute(t,n)}function l(e,t){e.removeAttribute(t)}function Be(e){Pe(e,"display","none")}function Le(e){Pe(e,"display","")}function Ie(e){Ge(e)?Be(e):Le(e)}function Pe(n,e,t){if(arguments.length<3){if(ye(e))return 1===n.nodeType?getComputedStyle(n)[e]:null;Se(e,function(e,t){Pe(n,e,t)})}else{var o=(t||0===t)&&!isNaN(t);n.style[e]=o?t+"px":t}}function Ve(e,t,n){var o=arguments.length,i={};if(e.nodeType===ke){if(1===o)return Se(e.attributes,function(e,t){/^data\-/i.test(t.name)&&(i[t.name.substr(5)]=t.value)}),i;if(2===o)return Oe(e,"data-"+t);Oe(e,"data-"+t,String(n))}}function je(e,t){var n=!1;return e&&e.nodeType===ke&&(n=(e.matches||e.msMatchesSelector||e.webkitMatchesSelector).call(e,t)),n}function We(e,t){return t.parentNode.insertBefore(e,t)}function c(e){return e.className.trim().split(/\s+/)}function qe(e,t){return je(e,"."+t)}function Ue(e,t){var n=c(e);n.indexOf(t)<0&&n.push(t),e.className=n.join(" ")}function $e(e,t){var n=c(e);Ee(n,t),e.className=n.join(" ")}function Ye(e,t,n){(n=xe(n)?!qe(e,t):n)?Ue(e,t):$e(e,t)}function Ke(e,t){if(xe(t)){var n=getComputedStyle(e),o=a(n.paddingLeft)+a(n.paddingRight),i=a(n.borderLeftWidth)+a(n.borderRightWidth);return e.offsetWidth-o-i}Pe(e,"width",t)}function Xe(e,t){if(xe(t)){var n=getComputedStyle(e),o=a(n.paddingTop)+a(n.paddingBottom),i=a(n.borderTopWidth)+a(n.borderBottomWidth);return e.offsetHeight-o-i}Pe(e,"height",t)}function Qe(e,t,n){var o;we(window.CustomEvent)?o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n}):(o=e.ownerDocument.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(o)}function Ge(e){return!!e.getClientRects().length}function Je(e,t,n,o,i){for(e=i?e.lastChild:e.firstChild;e;){var r=i?e.previousSibling:e.nextSibling;if(!n&&!1===t(e)||!o&&!1===Je(e,t,n,o,i)||n&&!1===t(e))return!1;e=r}}function Ze(e,t,n,o){Je(e,t,n,o,!0)}function et(e,t){var n=(t=t||document).createDocumentFragment(),o=De("div",{},t);for(o.innerHTML=e;o.firstChild;)He(n,o.firstChild);return n}function tt(e){return e&&(!je(e,"p,div")||e.className||Oe(e,"style")||!t(Ve(e)))}function nt(e,t){var n=De(t,{},e.ownerDocument);for(Se(e.attributes,function(e,t){try{Oe(n,t.name,t.value)}catch(e){}});e.firstChild;)He(n,e.firstChild);return e.parentNode.replaceChild(n,e),n}var s="|body|hr|p|div|h1|h2|h3|h4|h5|h6|address|pre|form|table|tbody|thead|tfoot
|