1// Simple File List Script: ee-footer.js | Author: Mitchell Bennis | [email protected] 2 3// Used in front-side and back-side file list display 4 5// Upon page load completion... 6jQuery(document).ready(function($) { 7 8 console.log('eeSFL Document Ready'); 9 10 window.addEventListener('touchstart', function() { 11 eeSFL_isTouchscreen = true; 12 }); 13 14 15 jQuery('#eeSFL_Modal_Manage_Close').on('click', function() { 16 jQuery('#eeSFL_Modal_Manage').hide(); 17 }); 18 19 20}); // END Ready Function 21 22 23 24 25// SFL FUNCTIONS --------------------------- 26 27// Strip Slashes 28String.prototype.eeSFL_StripSlashes = function(){ 29 return this.replace(/\\(.)/mg, "$1"); 30} 31 32 33// Copy File URL to Clipboard 34function eeSFL_CopyLinkToClipboard(eeSFL_FileURL) { 35 36 var eeTemp = jQuery('<input name="eeTemp" value="' + eeSFL_FileURL + '" type="url" class="" id="eeTemp" />'); // Create a temporary input 37 jQuery("body").append(eeTemp); // Add it to the bottom of the page 38 39 var eeTempInput = jQuery('#eeTemp'); 40 eeTempInput.focus(); 41 eeTempInput.select(); // Select the temp input 42 // eeTempInput.setSelectionRange(0, 99999); /* For mobile devices <<<------------ TO DO */ 43 document.execCommand("copy"); // Copy to clipboard 44 eeTemp.remove(); // Remove the temp input 45 46 alert(eesfl_vars['eeCopyLinkText'] + "\r\n" + eeSFL_FileURL); // Alert the user 47} 48 49 50 51// Email Validation 52function eeSFL_ValidateEmail(eeSFL_CheckEmail) { 53 54 var eeSFL_EmailFormat = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 55 56 if (eeSFL_CheckEmail.match(eeSFL_EmailFormat)) { 57 return 'GOOD'; 58 } else { 59 return "BAD"; 60 } 61} 62 63 64// File Size Formatting 65function eeSFL_GetFileSize(bytes) { 66 67 var si = 1024; 68 69 var thresh = si ? 1000 : 1024; 70 71 if(Math.abs(bytes) < thresh) { 72 return bytes + ' B'; 73 } 74 75 var units = si 76 ? ['kB','MB','GB','TB','PB','EB','ZB','YB'] 77 : ['KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB']; 78 var u = -1; 79 80 do { 81 bytes /= thresh; 82 ++u; 83 } while(Math.abs(bytes) >= thresh && u < units.length - 1); 84 85 return bytes.toFixed(1)+' '+units[u]; 86} 87 88 89 90 91 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.