Skip to content

Instantly share code, notes, and snippets.

@muhittin
Created February 24, 2014 15:28
Show Gist options
  • Save muhittin/9190425 to your computer and use it in GitHub Desktop.
Save muhittin/9190425 to your computer and use it in GitHub Desktop.
jquery uppercase (Türkçe Karakterler için)
(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