1// PUT RANDOM UTILS HERE. 2 3;(function ( $, window, document, undefined ) { 4 5 if(typeof(String.prototype.strip) === "undefined") 6 { 7 String.prototype.strip = function() 8 { 9 return String(this).replace(/^\s+|\s+$/g, ''); 10 }; 11 } 12 var Utils = function(){}; 13 Utils.prototype = { 14 none: function(obj){ 15 return (obj === null || obj === undefined); 16 } 17 }; 18 19 window.utils = new Utils(); 20 21 //Used For Turkish Translations issue in Chrome, Safari. 22 //https://code.google.com/p/chromium/issues/detail?id=304911 23 function getStyle(element, style) { 24 var result; 25 26 if (document.defaultView && document.defaultView.getComputedStyle) { 27 result = document.defaultView.getComputedStyle(element, '').getPropertyValue(style); 28 } else if(element.currentStyle) { 29 style = style.replace(/\-(\w)/g, function (strMatch, p1) { 30 return p1.toUpperCase(); 31 }); 32 result = element.currentStyle[style]; 33 } 34 return result; 35 } 36 37 function replaceRecursive(element, lang) { 38 if(element.lang) { 39 lang = element.lang; // Maintain language context 40 } 41 42 if (element && element.style && getStyle(element, 'text-transform') === 'uppercase') { 43 if (lang === 'tr' && element.value) { 44 element.value = element.value.replace(/ı/g, 'I'); 45 element.value = element.value.replace(/i/g, 'İ'); 46 } 47 48 for (var i = 0; i < element.childNodes.length; ++i) { 49 if (lang === 'tr' && element.childNodes[i].nodeType === Node.TEXT_NODE) { 50 element.childNodes[i].textContent = element.childNodes[i].textContent.replace(/ı/g, 'I'); 51 element.childNodes[i].textContent = element.childNodes[i].textContent.replace(/i/g, 'İ'); 52 } else { 53 replaceRecursive(element.childNodes[i], lang); 54 } 55 } 56 } else { 57 if (!element.childNodes || element.childNodes.length === 0) { return; } 58 59 for (var n = 0; n < element.childNodes.length; ++n) { 60 replaceRecursive(element.childNodes[n], lang); 61 } 62 } 63 } 64 65 // Deal with the hover nav 66 $(document).ready(function(){ 67 replaceRecursive(document.getElementsByTagName('html')[0], ''); 68 69 // ALWAYS SELECT ALL FOR READONLY TEXT AREAS. 70 $('textarea[readonly]').on('focus, click', function(){ 71 var $this = $(this); 72 $this.select(); 73 $this.on("mouseup", function() { 74 $this.off("mouseup"); 75 return false; 76 }); 77 }); 78 }); 79 80})( jQuery, window, document );
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.