PageSourceSearch

https://ponkichi.blog/wp-content/cache/min/1/wp-content/themes/affinger/js/st-copy-text.js?ver=1790973777

js ponkichi.blog collected 2026-10-05 21:28:19 UTC 1,251 bytes, 11 lines download raw bytes

1(function(window,document,$,undefined){'use strict';function create_$fake(text){var $fake=$('<textarea />');$fake.css({fontSize:'12pt',position:'fixed',top:'100%'});$fake.prop('readonly',!0);$fake.val(text);return $fake}
2function select($element){var element=$element.get(0);var isReadOnly=$element.prop('readonly');if(!isReadOnly){$element.prop('readonly',!0)}
3element.select();element.setSelectionRange(0,$element.val().length);if(!isReadOnly){$element.prop('readonly',!1)}
4return $element.val()}
5function exec_copy(){var succeeded;try{succeeded=document.execCommand('copy')}catch(err){succeeded=!1}
6return succeeded}
7function copy(text){var $container=$('body');var $fake=create_$fake(text);$container.append($fake);select($fake);if(!exec_copy()){return!1}
8window.getSelection().removeAllRanges();$fake.remove();return!0}
9function onClick(event){var $element=$(this);var text=$element.attr('data-st-copy-text');event.preventDefault();if(copy(text)){$element.focus();alert('記事タイトルとURLをコピーしました')}else{alert('ご利用の環境はコピーに対応していません')}}
10function onReady(){$('[data-st-copy-text]').each(function(index,element){$(element).on('click',onClick)})}
11$(onReady)}(window,window.document,jQuery))

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.