Created
February 24, 2014 15:28
-
-
Save muhittin/9190425 to your computer and use it in GitHub Desktop.
jquery uppercase (Türkçe Karakterler için)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var mets = { | |
init : function(options){ | |
var settings = $.extend({ | |
"chars" : { | |
"i" : "Ä°", | |
"ÅŸ" : "Åž", | |
"ö" : "Ö", | |
"ü" : "Ü", | |
"ÄŸ" : "Äž", | |
"ç" : "Ç", | |
} | |
},options); | |
this.each(function(){ | |
var str = $(this).text(); | |
$.each(settings.chars,function(key,value){ | |
var regex = new RegExp(key, "g"); | |
str = str.replace(regex,value); | |
}); | |
$(this).text(str); | |
}); | |
} | |
} | |
$.fn.uppercase = function(method){ | |
if(mets[method]){ | |
return mets[method].apply(this,Array.prototype.slice.call(arguments,1)); | |
} | |
else if(typeof method === 'object'||!method){ | |
return mets.init.apply(this, arguments); | |
} | |
else{ | |
$.error('Alarma alarma'); | |
} | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment