2 lines
106 KiB
JavaScript
2 lines
106 KiB
JavaScript
|
!function(){var e={6964:function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}!function(e,t,i,n,s){"use strict";var o="SUICodeSnippet",r={copyText:"Copy",copiedText:"Copied!"};function a(t,i){this.element=t,this.$element=e(this.element),this.settings=e.extend({},r,i),this._defaults=r,this._name=o,this._clipboardJs=null,this._clipboardId="",this.init()}e.extend(a.prototype,{init:function(){var i=this,n="";0===this.$element.parent("sui-code-snippet-wrapper").length&&(this.$element.wrap('<div class="sui-code-snippet-wrapper"></div>'),this._clipboardId=this.generateUniqueId(),n='<button type="button" class="sui-button" id="sui-code-snippet-button-'+this._clipboardId+'" data-clipboard-target="#sui-code-snippet-'+this._clipboardId+'">'+this.settings.copyText+"</button>",this.$element.attr("id","sui-code-snippet-"+this._clipboardId).after(n),this._clipboardJs=new t("#sui-code-snippet-button-"+this._clipboardId),this._clipboardJs.on("success",(function(e){e.clearSelection(),i.showTooltip(e.trigger,i.settings.copiedText)})),e("#sui-code-snippet-button-"+this._clipboardId).on("mouseleave.SUICodeSnippet",(function(){e(this).removeClass("sui-tooltip"),e(this).removeAttr("aria-label"),e(this).removeAttr("data-tooltip")})))},getClipboardJs:function(){return this._clipboardJs},showTooltip:function(t,i){e(t).addClass("sui-tooltip"),e(t).attr("aria-label",i),e(t).attr("data-tooltip",i)},generateUniqueId:function(){return"_"+Math.random().toString(36).substr(2,9)},destroy:function(){null!==this._clipboardJs&&(this._clipboardJs.destroy(),this.$element.attr("id",""),this.$element.unwrap(".sui-code-snippet-wrapper"),e("#sui-code-snippet-button-"+this._clipboardId).remove())}}),e.fn[o]=function(t){return this.each((function(){e.data(this,o)||e.data(this,o,new a(this,t))}))}}(jQuery,ClipboardJS,window,document),function(t){"use strict";"object"!==e(window.SUI)&&(window.SUI={}),SUI.suiCodeSnippet=function(){t(".sui-2-12-10 .sui-code-snippet:not(.sui-no-copy)").each((function(){t(this).SUICodeSnippet({})}))},t(document).ready((function(){SUI.suiCodeSnippet()}))}(jQuery)},9150:function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}!function(){"use strict";"object"!==e(window.SUI)&&(window.SUI={});var t=t||{};t.KeyCode={BACKSPACE:8,TAB:9,RETURN:13,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},t.Utils=t.Utils||{},t.Utils.remove=function(e){return e.remove&&"function"==typeof e.remove?e.remove():!(!e.parentNode||!e.parentNode.removeChild||"function"!=typeof e.parentNode.removeChild)&&e.parentNode.removeChild(e)},t.Utils.isFocusable=function(e){if(0<e.tabIndex||0===e.tabIndex&&null!==e.getAttribute("tabIndex"))return!0;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!=e.rel;case"INPUT":return"hidden"!=e.type&&"file"!=e.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},t.Utils.simulateClick=function(e){var t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(t)},t.Utils.IgnoreUtilFocusChanges=!1,t.Utils.dialogOpenClass="sui-has-modal",t.Utils.focusFirstDescendant=function(e){for(var i=0;i<e.childNodes.length;i++){var n=e.childNodes[i];if(t.Utils.attemptFocus(n)||t.Utils.focusFirstDescendant(n))return!0}return!1},t.Utils.focusLastDescendant=function(e){for(var i=e.childNodes.length-1;0<=i;i--){var n=e.childNodes[i];if(t.Utils.attemptFocus(n)||t.Utils.focusLastDescendant(n))return!0}return!1},t.Utils.attemptFocus=function(e){if(!t.Utils.isFocusable(e))return!1;t.Utils.IgnoreUtilFocusChanges=!0;try{e.focus()}catch(e){}return t.Utils.IgnoreUtilFocusChanges=!1,document.activeElement===e},t.OpenDialogList=t.OpenDialogList||new Array(0),t.getCurrentDialog=function(
|
||
|
//# sourceMappingURL=smush-sui.min.js.map
|