1let account = {}; 2 3account.cpToClipboard = function (id,successText) { 4 toastbox(successText || 'Äã sao chép link Shop thà nh công', true, 10000); 5 let text = document.getElementById(id); 6 text = text.textContent; 7 navigator.clipboard.writeText(text); 8}; 9account.popUp = function (url, modal_name) { 10 try { 11 $(`#${modal_name}`).modal('show'); 12 $(`#${modal_name}Content`) 13 // .addClass('text-center') 14 .html('<div style="margin: 10px auto;" class="spinner-border text-success"></div>') 15 .load(url, {limit: 10}, (responseText, textStatus, req) => { 16 var isHTML = RegExp.prototype.test.bind(/(<([^>]+)>)/i); 17 if (!isHTML(responseText)) { 18 var data = $.parseJSON(responseText); 19 if (data.error == true) { 20 toastbox(data.message,false,6000) 21 $(`#${modal_name}`).modal('hide'); 22 } 23 } 24 if (textStatus == "error") { 25 toastbox('Có lá»i trong quá trình xá» lý. Vui lòng thá» lại sau',false,6000) 26 $(`#${modal_name}`).modal('hide'); 27 } 28 $(`#${modal_name}Content`).removeClass('text-center'); 29 setTimeout(() => $("form input").not('input[type=hidden],input[type=button],input[type=submit],input[type=reset],input[type=image],button').first().focus(), 400) 30 }); 31 } catch (e) { 32 setTimeout(() => { 33 $(`#${modal_name}`).modal('hide') 34 }, 1000) 35 } 36}; 37account.formAjax = function (url, e) { 38 if (e !== undefined && $(e).hasClass('active')) { 39 return true; 40 } 41 try { 42 $('#formAjax') 43 .addClass('text-center') 44 .html('<div style="margin: 290px auto;" class="spinner-border text-success"></div>') 45 .load(url, () => { 46 $('#formAjax').removeClass('text-center'); 47 }); 48 } catch (e) { 49 } 50}; 51account.selectHelper = function (id, url, id_elm) { 52 $.ajax({ 53 type: "GET", 54 contentType: "application/json; charset=utf-8", 55 url: url, 56 data: 'id=' + id, 57 dataType: "json", 58 success: function (msg) { 59 data = ''; 60 msg.forEach((value) => { 61 data += '<option value="' + value.id + '" >' + value.name + '</option>'; 62 $(`#${id_elm}`).html(data); 63 }) 64 }, 65 error: function (xhr, ajaxOptions, thrownError) { 66 } 67 }); 68}; 69account.shareLink = async function (url) { 70 let shareData = { 71 url: url 72 }; 73 try { 74 await navigator.share(shareData) 75 } catch (err) { 76 console.log('Error: ' + err); 77 } 78}; 79account.shareImage = async function (base64url, url) { 80 try { 81 const blob = await fetch(base64url).then(r => r.blob()) 82 const data = { 83 files: [ 84 new File([blob], 'image.png', { 85 type: blob.type, 86 }), 87 ], 88 url: url 89 }; 90 await navigator.share(data) 91 } catch (err) { 92 } 93}
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.