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($){ | |
$.fn._removeClass = $.fn.removeClass | |
$.fn.removeClass = function(arg) { | |
return this.each(function(){ | |
if(typeof(arg.test) == 'function'){ | |
var classes = $(this).attr('class').split(/\s/); | |
$.each(classes,function(i){if(arg.test(this)){classes.splice(i,1)}}); | |
$(this).attr('class',classes.join(' ')); | |
}else{ | |
$(this)._removeClass(arg); |
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($){ | |
$.fn.replaceClass = function(RE,STR) { | |
return this.each(function(){ | |
var classes = $(this).attr('class').split(/\s/); | |
$.each(classes,function(i){classes[i] = this.replace(RE,STR)}) | |
$(this).attr('class',classes.join(' ')); | |
}) | |
}; | |
})(jQuery) |
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
/** | |
* @param query {RegExp} required | |
* @param wrapElement {jQuery} required | |
**/ | |
$.fn.markTextByRegExp = function(query,wrapElement){ | |
var REtag = '<\\/?[^>]+?\\/?>'; | |
var REtagDivider = new RegExp(REtag+'|[^<>]*','gi'); | |
return this.each(function(){ | |
var elem = $(this); |
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
/** | |
* @param langid {String} optional | |
* @return {jQuery} when langid is given. | |
* @return langid {String} when langid is not given. | |
**/ | |
$.fn.lang = function(langid) { | |
var elem = $(this); | |
var lang; |
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
/** | |
* $.require('foo.js'); | |
* $.require(['foo.js','baa.js','moo/muu.js]); | |
*/ | |
jQuery.require= (function(){ | |
var jspath = $('script[src]:last').attr('src'); | |
var dirpath = /.+\//.exec(jspath)[0] | |
return function(jsfiles){ |
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
.clearfix { | |
*zoom: 1; | |
} | |
.clearfix:after { | |
content: ''; | |
display: block; | |
clear : both; | |
height: 0; | |
} |
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
.someClass{ | |
behavior: expression(this.style.behavior || ((function(a,b,c){ | |
c=a.parentNode.getElementsByTagName('!'); | |
try{for(var i=0,l=c.length;i<l;i++){c[i].parentNode.removeChild(c[i])}}catch(e){}; | |
if(a.parentNode.firstChild==a){a.className+=' '+b} | |
})(this,"lu.first-child"),1)); | |
} |
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
.whatever slector { | |
/*run behaviour only one time*/ | |
behavior: expression(this.behavior || (function(that){try{ | |
/*do something here*/ | |
}catch(e){};})(this),1); | |
} |
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
html { | |
/*to remove all comment nodes on IE*/ | |
behavior: expression(this.behavior || ((function(a){ | |
a=document.getElementsByTagName('!'); | |
try{for(var i=0,l=a.length;i<l;i++){a[i].parentNode.removeChild(a[i])}}catch(e){}; | |
})(),1)); | |
} |
OlderNewer