ComunicWeb/assets/3rdparty/sceditor/jquery.sceditor.bbcode.min.js

3 lines
67 KiB
JavaScript
Raw Normal View History

2018-12-27 13:02:01 +00:00
/* 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 be=e.bind(null,"string"),xe=e.bind(null,"undefined"),we=e.bind(null,"function"),r=e.bind(null,"number");function t(e){return!Object.keys(e).length}function ke(e,t){for(var n=e===!!e,o=n?2:1,r=n?t:e,i=!!n&&e;o<arguments.length;o++){var l=arguments[o];for(var a in l){var s=l[a];if(!xe(s)){var c=null!==s&&"object"==typeof s&&Object.getPrototypeOf(s)===Object.prototype,u=Array.isArray(s);r[a]=i&&(c||u)?ke(!0,r[a]||(u?[]:{}),s):s}}}return r}function Ce(e,t){var n=e.indexOf(t);-1<n&&e.splice(n,1)}function Ee(t,n){if(Array.isArray(t)||"length"in t&&r(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 i={},Se=1,Te=3;function l(e){return e=parseFloat(e),isFinite(e)?e:0}function De(e,t,n){var o=(n||document).createElement(e);return Ee(t||{},function(e,t){"style"===e?o.style.cssText=t:e in o?o[e]=t:o.setAttribute(e,t)}),o}function Me(e,t){for(var n=e||{};(n=n.parentNode)&&!/(9|11)/.test(n.nodeType);)if(!t||qe(n,t))return n}function Ne(e,t){return qe(e,t)?e:Me(e,t)}function Be(e){e.parentNode&&e.parentNode.removeChild(e)}function Re(e,t){e.appendChild(t)}function He(e,t){return e.querySelectorAll(t)}var Ie=!0;function Fe(n,e,o,r,i){e.split(" ").forEach(function(e){var t;be(o)?(t=r["_sce-event-"+e+o]||function(e){for(var t=e.target;t&&t!==n;){if(qe(t,o))return void r.call(t,e);t=t.parentNode}},r["_sce-event-"+e+o]=t):(t=o,i=r),n.addEventListener(e,t,i||!1)})}function ze(n,e,o,r,i){e.split(" ").forEach(function(e){var t;be(o)?t=r["_sce-event-"+e+o]:(t=o,i=r),n.removeEventListener(e,t,i||!1)})}function Ae(e,t,n){if(arguments.length<3)return e.getAttribute(t);null==n?a(e,t):e.setAttribute(t,n)}function a(e,t){e.removeAttribute(t)}function Oe(e){je(e,"display","none")}function _e(e){je(e,"display","")}function Le(e){Ge(e)?Oe(e):_e(e)}function je(n,e,t){if(arguments.length<3){if(be(e))return 1===n.nodeType?getComputedStyle(n)[e]:null;Ee(e,function(e,t){je(n,e,t)})}else{var o=(t||0===t)&&!isNaN(t);n.style[e]=o?t+"px":t}}function Pe(e,t,n){var o=arguments.length,r={};if(e.nodeType===Se){if(1===o)return Ee(e.attributes,function(e,t){/^data\-/i.test(t.name)&&(r[t.name.substr(5)]=t.value)}),r;if(2===o)return Ae(e,"data-"+t);Ae(e,"data-"+t,String(n))}}function qe(e,t){var n=!1;return e&&e.nodeType===Se&&(n=(e.matches||e.msMatchesSelector||e.webkitMatchesSelector).call(e,t)),n}function Ve(e,t){return t.parentNode.insertBefore(e,t)}function s(e){return e.className.trim().split(/\s+/)}function We(e,t){return qe(e,"."+t)}function $e(e,t){var n=s(e);n.indexOf(t)<0&&n.push(t),e.className=n.join(" ")}function Ue(e,t){var n=s(e);Ce(n,t),e.className=n.join(" ")}function Ye(e,t,n){(n=xe(n)?!We(e,t):n)?$e(e,t):Ue(e,t)}function Ke(e,t){if(xe(t)){var n=getComputedStyle(e),o=l(n.paddingLeft)+l(n.paddingRight),r=l(n.borderLeftWidth)+l(n.borderRightWidth);return e.offsetWidth-o-r}je(e,"width",t)}function Xe(e,t){if(xe(t)){var n=getComputedStyle(e),o=l(n.paddingTop)+l(n.paddingBottom),r=l(n.borderTopWidth)+l(n.borderBottomWidth);return e.offsetHeight-o-r}je(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,r){for(e=r?e.lastChild:e.firstChild;e;){var i=r?e.previousSibling:e.nextSibling;if(!n&&!1===t(e)||!o&&!1===Je(e,t,n,o,r)||n&&!1===t(e))return!1;e=i}}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;)Re(n,o.firstChild);return n}function tt(e){return e&&(!qe(e,"p,div")||e.className||Ae(e,"style")||!t(Pe(e)))}function nt(e,t){var n=De(t,{},e.ownerDocument);for(Ee(e.attributes,function(e,t){try{Ae(n,t.name,t.value)}catch(e){}});e.firstChild;)Re(n,e.firstChild);return e.parentNode.replaceChild(n,e),n}var c="|body|hr|p|div|h1|h2|h3|h4|h5|h6|address|pre|form|table|tbody|thead|tfoot