PairDrop/app/elements/text-sharing/linkify.html

5 lines
16 KiB
HTML
Raw Normal View History

<script>
'use strict';
!function(){"use strict";function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}function n(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function e(t,n,e,o){for(var r=0,i=t.length,a=[],s=void 0;i>r&&(s=n.next(t[r]));)n=s,r++;if(r>=i)return[];for(;i-1>r;)s=new h(o),a.push(s),n.on(t[r],s),n=s,r++;return s=new h(e),a.push(s),n.on(t[i-1],s),a}function o(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t){return t instanceof d||t instanceof P}function a(t){return t}function s(t,n){return"url"===n?"_blank":null}function u(t){return t=t||{},{attributes:t.linkAttributes||null,defaultProtocol:t.defaultProtocol||"http",events:t.events||null,format:t.format||a,formatHref:t.formatHref||a,newLine:t.newLine||!1,nl2br:!!t.newLine||t.nl2br||!1,tagName:t.tagName||"a",target:t.target||s,linkClass:t.linkClass||"linkified"}}function c(t){for(var n=arguments.length,e=Array(n>1?n-1:0),o=1;n>o;o++)e[o-1]=arguments[o];return"function"==typeof t?t.apply(void 0,e):t}function l(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n["default"]=t,n}var p={__esModule:!0},f=function(){function t(e){n(this,t),this.j=[],this.T=e||null}return t.prototype.on=function(t,n){if(t instanceof Array)for(var e=0;e<t.length;e++)this.j.push([t[e],n]);else this.j.push([t,n])},t.prototype.next=function(t){for(var n=0;n<this.j.length;n++){var e=this.j[n],o=e[1];if(this.test(t,e[0]))return o}return!1},t.prototype.accepts=function(){return!!this.T},t.prototype.test=function(t,n){return t===n},t.prototype.emit=function(){return this.T},t}(),h=function(e){function o(){n(this,o),e.apply(this,arguments)}return t(o,e),o.prototype.test=function(t,n){return t===n||n instanceof RegExp&&n.test(t)},o}(f),g=function(e){function o(){n(this,o),e.apply(this,arguments)}return t(o,e),o.prototype.test=function(t,n){return t instanceof n},o}(f);p.CharacterState=h,p.TokenState=g,p.stateify=e;var m={__esModule:!0},y=function(){function t(n){r(this,t),this.v=n}return t.prototype.toString=function(){return this.v+""},t}(),d=function(t){function n(){r(this,n),t.apply(this,arguments)}return o(n,t),n}(y),b=function(t){function n(){r(this,n),t.call(this,"@")}return o(n,t),n}(y),v=function(t){function n(){r(this,n),t.call(this,":")}return o(n,t),n}(y),x=function(t){function n(){r(this,n),t.call(this,".")}return o(n,t),n}(y),k=function(t){function n(){r(this,n),t.apply(this,arguments)}return o(n,t),n}(y),w=function(t){function n(){r(this,n),t.apply(this,arguments)}return o(n,t),n}(y),O=function(t){function n(){r(this,n),t.call(this,"\n")}return o(n,t),n}(y),E=function(t){function n(){r(this,n),t.apply(this,arguments)}return o(n,t),n}(y),L=function(t){function n(){r(this,n),t.call(this,"+")}return o(n,t),n}(y),S=function(t){function n(){r(this,n),t.call(this,"#")}return o(n,t),n}(y),A=function(t){function n(){r(this,n),t.apply(this,arguments)}return o(n,t),n}(y),C=function(t){function n(){r(this,n),t.call(this,"?")}return o(n,t),n}(y),T=function(t){function n(){r(this,n),t.call(this,"/")}return o(n,t),n}(y),N=function(t){function n(){r(this,n),t.apply(this,arguments)}return o(n,t),n}(y),P=function(t){function n(){r(this,n),t.apply(this,arguments)}return o(n,t),n}(y),j=function(t){function n(){r(this,n),t.apply(this,arguments)}return o(n,t),n}(y),z=function(t){function n(){r(this,n),t.call(this,"{")}return o(n,t),n}(y),R=function(t){function n(){r(this,n),t.call(this,"[")}return
!function(e){"use strict";function t(e,t,n){var r=n[n.length-1];e.replaceChild(r,t);for(var o=n.length-2;o>=0;o--)e.insertBefore(n[o],r),r=n[o]}function n(e,t,n){for(var r=[],o=0;o<e.length;o++){var i=e[o];if(i.isLink){var l=i.toHref(t.defaultProtocol),s=a.resolve(t.format,i.toString(),i.type),f=a.resolve(t.formatHref,l,i.type),u=a.resolve(t.attributes,l,i.type),d=a.resolve(t.tagName,l,i.type),v=a.resolve(t.linkClass,l,i.type),c=a.resolve(t.target,l,i.type),m=a.resolve(t.events,l,i.type),p=n.createElement(d);if(p.setAttribute("href",f),p.setAttribute("class",v),c&&p.setAttribute("target",c),u)for(var h in u)p.setAttribute(h,u[h]);if(m)for(var g in m)p.addEventListener?p.addEventListener(g,m[g]):p.attachEvent&&p.attachEvent("on"+g,m[g]);p.appendChild(n.createTextNode(s)),r.push(p)}else"nl"===i.type&&t.nl2br?r.push(n.createElement("br")):r.push(n.createTextNode(i.toString()))}return r}function r(e,o,a){if(!e||"object"!=typeof e||e.nodeType!==l)throw new Error("Cannot linkify "+e+" - Invalid DOM Node type");if("A"===e.tagName)return e;for(var f=e.firstChild;f;){switch(f.nodeType){case l:r(f,o,a);break;case s:var u=f.nodeValue,d=i(u),v=n(d,o,a);t(e,f,v),f=v[v.length-1]}f=f.nextSibling}return e}function o(e,t){var n=arguments.length<=2||void 0===arguments[2]?null:arguments[2];try{n=n||window&&window.document||global&&global.document}catch(o){}if(!n)throw new Error("Cannot find document implementation. If you are in a non-browser environment like Node.js, pass the document implementation as the third argument to linkifyElement.");return t=a.normalize(t),r(e,t,n)}var i=e.tokenize,a=e.options,l=1,s=3;o.helper=r,o.normalize=a.normalize,window.linkifyElement=o}(window.linkify);
</script>