1/*! 2 * jQuery Remove Uppercase Accents for Drupal 7 3 * https://www.drupal.org/project/rua 4 * 5 * Automatically removes accented characters (currently Greek) from elements 6 * having their text content uppercase transformed through CSS. 7 * 8 * It WILL NOT target fieldset and elements capitalized inside fieldsets! 9 */ 10 11(function($) { 12 13 $.extend($.expr[":"], { 14 uppercase: function(elem) { 15 var attr = $(elem).css("text-transform"); 16 return typeof attr !== "undefined" && attr === "uppercase"; 17 }, 18 smallcaps: function(elem) { 19 var attr = $(elem).css("font-variant"); 20 return typeof attr !== "undefined" && attr === "small-caps"; 21 } 22 }); 23 24 $.extend({ 25 removeAcc: function(elem) { 26 if (elem.tagName.toLowerCase() === "input") { 27 var text = elem.value; 28 text = removeAcc(text); 29 elem.value = text; 30 } 31 else { 32 var childNodes = elem.childNodes; 33 for (var child in childNodes){ 34 var nodeType = childNodes[child].nodeType; 35 // Only replace text nodes 36 // @see https://www.w3schools.com/jsref/prop_node_nodetype.asp 37 if (nodeType === 3) { 38 var nodeValue = childNodes[child].nodeValue; 39 nodeValue = removeAcc(nodeValue); 40 childNodes[child].nodeValue = nodeValue; 41 } 42 } 43 } 44 } 45 }); 46 47 $.fn.extend({ 48 removeAcc: function() { 49 return this.each(function() { 50 $.removeAcc(this); 51 }); 52 } 53 }); 54 55 // Shorthand for `$(document).ready()` 56 $(function() { 57 58 $(":uppercase").removeAcc(); 59 $(document).ajaxComplete(function() { 60 $(":uppercase").removeAcc(); 61 }); 62 63 $(":smallcaps").removeAcc(); 64 $(document).ajaxComplete(function() { 65 $(":smallcaps").removeAcc(); 66 }); 67 68 }); 69 70 function removeAcc(text) { 71 return text.replace(/Î/g, "Î") 72 .replace(/ά/g, "α") 73 .replace(/Î/g, "Î") 74 .replace(/Î/g, "ε") 75 .replace(/Î/g, "Î") 76 .replace(/ή/g, "η") 77 .replace(/Î/g, "Î") 78 .replace(/ί/g, "ι") 79 .replace(/Î/g, "Ï") 80 .replace(/Î/g, "Î") 81 .replace(/Ï/g, "ο") 82 .replace(/Î/g, "Î¥") 83 .replace(/Ï/g, "Ï ") 84 .replace(/ΰ/g, "Ï") 85 .replace(/Î/g, "Ω") 86 .replace(/Ï/g, "Ï") 87 .replace(/Ï/g, "Σ"); 88 } 89 90})(jQuery); 91;
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.