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 var text = elem.tagName.toLowerCase() === "input" ? elem.value : elem.innerHTML; 27 28 text = text.replace(/Î/g, "Î") 29 .replace(/ά/g, "α") 30 .replace(/Î/g, "Î") 31 .replace(/Î/g, "ε") 32 .replace(/Î/g, "Î") 33 .replace(/ή/g, "η") 34 .replace(/Î/g, "Î") 35 .replace(/ί/g, "ι") 36 .replace(/Î/g, "Ï") 37 .replace(/Î/g, "Î") 38 .replace(/Ï/g, "ο") 39 .replace(/Î/g, "Î¥") 40 .replace(/Ï/g, "Ï ") 41 .replace(/ΰ/g, "Ï") 42 .replace(/Î/g, "Ω") 43 .replace(/Ï/g, "Ï") 44 .replace(/Ï/g, "Σ"); 45 46 if (elem.tagName.toLowerCase() === "input") { 47 elem.value = text; 48 } else { 49 elem.innerHTML = text; 50 } 51 } 52 }); 53 54 $.fn.extend({ 55 removeAcc: function() { 56 return this.each(function() { 57 $.removeAcc(this); 58 }); 59 } 60 }); 61 62 // Shorthand for `$(document).ready()` 63 $(function() { 64 65 $(":uppercase").not(".fieldset-legend").removeAcc(); 66 $(document).ajaxComplete(function() { 67 $(":uppercase").not(".fieldset-legend").removeAcc(); 68 }); 69 70 $(":smallcaps").not(".fieldset-legend").removeAcc(); 71 $(document).ajaxComplete(function() { 72 $(":smallcaps").not(".fieldset-legend").removeAcc(); 73 }); 74 75 }); 76 77})(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.