1'use strict'; 2function copyToClipboard(elem) { 3 // create hidden text element, if it doesn't already exist 4 var targetId = "_hiddenCopyText_"; 5 var isInput = elem.tagName === "INPUT" || elem.tagName === "TEXTAREA"; 6 var origSelectionStart, origSelectionEnd; 7 if (isInput) { 8 // can just use the original source element for the selection and copy 9 target = elem; 10 origSelectionStart = elem.selectionStart; 11 origSelectionEnd = elem.selectionEnd; 12 } else { 13 // must use a temporary form element for the selection and copy 14 target = document.getElementById(targetId); 15 if (!target) { 16 var target = document.createElement("textarea"); 17 target.style.position = "absolute"; 18 target.style.left = "-9999px"; 19 target.style.top = "0"; 20 target.id = targetId; 21 document.body.appendChild(target); 22 } 23 target.textContent = elem.textContent; 24 } 25 // select the content 26 var currentFocus = document.activeElement; 27 target.focus(); 28 target.setSelectionRange(0, target.value.length); 29 30 // copy the selection 31 var succeed; 32 try { 33 succeed = document.execCommand("copy"); 34 } catch (e) { 35 succeed = false; 36 } 37 // restore original focus 38 if (currentFocus && typeof currentFocus.focus === "function") { 39 currentFocus.focus(); 40 } 41 42 if (isInput) { 43 // restore prior selection 44 elem.setSelectionRange(origSelectionStart, origSelectionEnd); 45 } else { 46 // clear temporary content 47 target.textContent = ""; 48 } 49 return succeed; 50} 51 52 53jQuery(document).ready(function ($) { 54 var appendthis = ("<div class='modal-overlay js-modal-close'></div>"); 55 56 57 /** 58 * 59 * @type {jQuery} 60 * Get shortcode data from custom attribute 61 */ 62 63 64 $('a[data-modal-id]').on('click', function (e) { 65 66 e.preventDefault(); 67 var chart_id = $(this).data('chart_id'); 68 $("body").append(appendthis); 69 $(".modal-overlay").fadeTo(500, 0.7); 70 //$(".js-modalbox").fadeIn(500); 71 var modalBox = $(this).attr('data-modal-id'); 72 $('#' + modalBox).fadeIn($(this).data()); 73 74 $('body').addClass('modalOn'); 75 76 $('.qcld_ichart_embed_popup').attr('data-chart_id',chart_id); 77 78 }); 79 80 81 jQuery(document).on('click', ".js-modal-close, .modal-overlay", function(event){ 82 83 84 // $(".js-modal-close, .modal-overlay").on('click',function () { 85 $(".modal-box, .modal-overlay").fadeOut(500, function () { 86 $(".modal-overlay").remove(); 87 $('.qcld_ichart_embed_popup').attr('data-chart_id',''); 88 }); 89 $('body').removeClass('modalOn'); 90 }); 91 92 $(window).resize(function () { 93 $(".modal-box").css({ 94 //top: ($(window).height() - $(".modal-box").outerHeight()) / 2, 95 //left: ($(window).width() - $(".modal-box").outerWidth()) / 2 96 }); 97 }); 98 99 $(window).resize(); 100 101 102 $("#generate-igcode").on("click", function () { 103 var chart_id = $('.qcld_ichart_embed_popup').data('chart_id'); 104 var url = $('.qcld_ichart_embed_popup').attr('data-url'); 105 var credit_text = $('.qcld_ichart_embed_popup').data('credit_text'); 106 var credit_url = $('.qcld_ichart_embed_popup').data('credit_url'); 107 var i_height = $("#igheight").val(); 108 var i_width = $("#igwidth").val(); 109 var selected_value = $(".iframe-main-select option:selected").text(); 110 var iframe_template = '<iframe src="' + url + '?chart_id=' + chart_id + '" ' 111 + ' scrolling="yes" ' + 'height="' + i_height + 'px' + '" width="' + i_width + selected_value + '" frameborder="0"></iframe>'; 112 113 if( (typeof credit_url != 'undefined' && credit_url != '') && (typeof credit_text != 'undefined' && credit_text != '') ){ 114 iframe_template += '<span style="float:right; margin:10px;">List Created by <a href="'+credit_url+'" target="_blank">'+credit_text+'</a></span>'; 115 } 116 var ext = ''; 117 118 119 iframe_template += ext; 120 121 $(".igcode_textarea").html(iframe_template); 122 copyToClipboard(document.getElementById("igcode_textarea")); 123 $("#igcode_textarea").select(); 124 125 });
126 127 128});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.