Welcome to mirror list, hosted at ThFree Co, Russian Federation.

application.min.js « js « assets - github.com/twbs/icons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 19c8a5523d6552f1b6d385d4765c848a089d7636 (plain)
1
2
3
4
5
6
/*!
 * clipboard.js v2.0.6
 * https://clipboardjs.com/
 * 
 * Licensed MIT © Zeno Rocha
 */!function(b,a){"object"==typeof exports&&"object"==typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?exports.ClipboardJS=a():b.ClipboardJS=a()}(this,function(){return b={},a.m=c=[function(a,b){a.exports=function(a){var b,d,c,e;return"SELECT"===a.nodeName?(a.focus(),b=a.value):"INPUT"===a.nodeName||"TEXTAREA"===a.nodeName?(d=a.hasAttribute("readonly"),d||a.setAttribute("readonly",""),a.select(),a.setSelectionRange(0,a.value.length),d||a.removeAttribute("readonly"),b=a.value):(a.hasAttribute("contenteditable")&&a.focus(),c=window.getSelection(),e=document.createRange(),e.selectNodeContents(a),c.removeAllRanges(),c.addRange(e),b=c.toString()),b}},function(b,c){function a(){}a.prototype={on:function(a,c,d){var b=this.e||(this.e={});return(b[a]||(b[a]=[])).push({fn:c,ctx:d}),this},once:function(b,c,d){var e=this;function a(){e.off(b,a),c.apply(d,arguments)}return a._=c,this.on(b,a,d)},emit:function(c){for(var d=[].slice.call(arguments,1),b=((this.e||(this.e={}))[c]||[]).slice(),a=0,e=b.length;a<e;a++)b[a].fn.apply(b[a].ctx,d);return this},off:function(c,d){var e=this.e||(this.e={}),a=e[c],f=[],b,g;if(a&&d)for(b=0,g=a.length;b<g;b++)a[b].fn!==d&&a[b].fn._!==d&&f.push(a[b]);return f.length?e[c]=f:delete e[c],this}},b.exports=a,b.exports.TinyEmitter=a},function(c,e,b){var a=b(3),d=b(4);c.exports=function(b,c,e){if(!b&&!c&&!e)throw new Error("Missing required arguments");if(!a.string(c))throw new TypeError("Second argument must be a String");if(!a.fn(e))throw new TypeError("Third argument must be a Function");if(a.node(b))return f=c,g=e,(l=b).addEventListener(f,g),{destroy:function(){l.removeEventListener(f,g)}};if(a.nodeList(b))return h=b,i=c,j=e,Array.prototype.forEach.call(h,function(a){a.addEventListener(i,j)}),{destroy:function(){Array.prototype.forEach.call(h,function(a){a.removeEventListener(i,j)})}};if(a.string(b))return k=b,m=c,n=e,d(document.body,k,m,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var k,m,n,h,i,j,l,f,g}},function(b,a){a.node=function(a){return void 0!==a&&a instanceof HTMLElement&&1===a.nodeType},a.nodeList=function(b){var c=Object.prototype.toString.call(b);return void 0!==b&&("[object NodeList]"===c||"[object HTMLCollection]"===c)&&"length"in b&&(0===b.length||a.node(b[0]))},a.string=function(a){return"string"==typeof a||a instanceof String},a.fn=function(a){return"[object Function]"===Object.prototype.toString.call(a)}},function(b,e,c){var d=c(5);function a(a,f,b,g,c){var e=function(a,b,e,c){return function(e){e.delegateTarget=d(e.target,b),e.delegateTarget&&c.call(a,e)}}.apply(this,arguments);return a.addEventListener(b,e,c),{destroy:function(){a.removeEventListener(b,e,c)}}}b.exports=function(b,d,c,e,f){return"function"==typeof b.addEventListener?a.apply(null,arguments):"function"==typeof c?a.bind(null,document).apply(null,arguments):("string"==typeof b&&(b=document.querySelectorAll(b)),Array.prototype.map.call(b,function(b){return a(b,d,c,e,f)}))}},function(b,c){if("undefined"!=typeof Element&&!Element.prototype.matches){var a=Element.prototype;a.matches=a.matchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.webkitMatchesSelector}b.exports=function(a,b){for(;a&&9!==a.nodeType;){if("function"==typeof a.matches&&a.matches(b))return a;a=a.parentNode}}},function(s,r,a){"use strict";var j,e,h,i,f,k,l,m,n,o,q;a.r(r),j=a(0),e=a.n(j),h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function g(d,c){for(var b=0,a;b<c.length;b++)a=c[b],a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(d,a.key,a)}function c(a){!function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}(this,c),this.resolveOptions(a),this.initSelection()}i=(function(a,b,c){return b&&g(a.prototype,b),c&&g(a,c),a}(c,[{key:"resolveOptions",value:function(b){var a=0<arguments.length&&void 0!==b?b:{};this.action=a.action,this.container=a.container,this.emitter=a.emitter,this.target=a.target,this.text=a.text,this.trigger=a.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var a=this,b="rtl"==document.documentElement.getAttribute("dir"),c;this.removeFake(),this.fakeHandlerCallback=function(){return a.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[b?"right":"left"]="-9999px",c=window.pageYOffset||document.documentElement.scrollTop,this.fakeElem.style.top=c+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=e()(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=e()(this.target),this.copyText()}},{key:"copyText",value:function(){var a=void 0;try{a=document.execCommand(this.action)}catch(b){a=!1}this.handleResult(a)}},{key:"handleResult",value:function(a){this.emitter.emit(a?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(a){var b=0<arguments.length&&void 0!==a?a:"copy";if(this._action=b,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(a){if(void 0!==a){if(!a||"object"!==(void 0===a?"undefined":h(a))||1!==a.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&a.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(a.hasAttribute("readonly")||a.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=a}},get:function(){return this._target}}]),c),f=a(1),k=a.n(f),l=a(2),m=a.n(l),n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},o=function(a,b,c){return b&&p(a.prototype,b),c&&p(a,c),a};function p(d,c){for(var b=0,a;b<c.length;b++)a=c[b],a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(d,a.key,a)}q=(function(b,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function, not "+typeof a);b.prototype=Object.create(a&&a.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),a&&(Object.setPrototypeOf?Object.setPrototypeOf(b,a):b.__proto__=a)}(b,k.a),o(b,[{key:"resolveOptions",value:function(b){var a=0<arguments.length&&void 0!==b?b:{};this.action="function"==typeof a.action?a.action:this.defaultAction,this.target="function"==typeof a.target?a.target:this.defaultTarget,this.text="function"==typeof a.text?a.text:this.defaultText,this.container="object"===n(a.container)?a.container:document.body}},{key:"listenClick",value:function(a){var b=this;this.listener=m()(a,"click",function(a){return b.onClick(a)})}},{key:"onClick",value:function(b){var a=b.delegateTarget||b.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new i({action:this.action(a),target:this.target(a),text:this.text(a),container:this.container,trigger:a,emitter:this})}},{key:"defaultAction",value:function(a){return d("action",a)}},{key:"defaultTarget",value:function(b){var a=d("target",b);if(a)return document.querySelector(a)}},{key:"defaultText",value:function(a){return d("text",a)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(c){var a=0<arguments.length&&void 0!==c?c:["copy","cut"],d="string"==typeof a?[a]:a,b=!!document.queryCommandSupported;return d.forEach(function(a){b=b&&!!document.queryCommandSupported(a)}),b}}]),b);function b(c,d){!function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}(this,b);var a=function(b,a){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!=typeof a&&"function"!=typeof a?b:a}(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));return a.resolveOptions(d),a.listenClick(c),a}function d(c,a){var b="data-clipboard-"+c;if(a.hasAttribute(b))return a.getAttribute(b)}r.default=q}],a.c=b,a.d=function(b,c,d){a.o(b,c)||Object.defineProperty(b,c,{enumerable:!0,get:d})},a.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},a.t=function(b,d){var c,e;if(1&d&&(b=a(b)),8&d)return b;if(4&d&&"object"==typeof b&&b&&b.__esModule)return b;if(c=Object.create(null),a.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:b}),2&d&&"string"!=typeof b)for(e in b)a.d(c,e,function(a){return b[a]}.bind(null,e));return c},a.n=function(b){var c=b&&b.__esModule?function(){return b.default}:function(){return b};return a.d(c,"a",c),c},a.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},a.p="",a(a.s=6).default;function a(d){if(b[d])return b[d].exports;var e=b[d]={i:d,l:!1,exports:{}};return c[d].call(e.exports,e,e.exports,a),e.l=!0,e.exports}var c,b}),function(){'use strict';var b='<div class="bd-clipboard"><button type="button" class="btn-clipboard" title="Copy to clipboard"><svg class="bi" width="1em" height="1em" fill="currentColor"><use xlink:href="/bootstrap-icons.svg#clipboard"/></svg></button></div>',a;[].slice.call(document.querySelectorAll('div.highlight')).forEach(function(a){a.insertAdjacentHTML('beforebegin',b)}),a=new ClipboardJS('.btn-clipboard',{target:function(a){return a.parentNode.nextElementSibling}}),a.on('success',function(a){var b=a.trigger.querySelector('.bi').firstChild,c='http://www.w3.org/1999/xlink',d=b.getAttributeNS(c,'href'),e=a.trigger.title;a.clearSelection(),b.setAttributeNS(c,'href',d.replace('clipboard','check2')),a.trigger.title="Copied!",setTimeout(function(){b.setAttributeNS(c,'href',d),a.trigger.title=e},2e3)}),a.on('error',function(){var b=/mac/i.test(navigator.userAgent)?'\u2318':'Ctrl-',c='Press '+b+'C to copy',a=document.getElementById('copy-error-callout');if(!a)return;a.classList.remove('d-none'),a.insertAdjacentHTML('afterbegin',c)}),[].slice.call(document.querySelectorAll('[href="#"]')).forEach(function(a){a.addEventListener('click',function(a){a.preventDefault()})})}()