/*! * jQuery.Rule - CSS Rules manipulation, the jQuery way. * Copyright (c) 2007 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com * Dual licensed under MIT and GPL. * Date: 28/08/2019 * * @author Ariel Flesler * @version 1.1.2 * * @id jQuery.rule * @param {Undefined|String|jQuery.Rule} The rules, can be a selector, or literal CSS rules. Many can be given, comma separated. * @param {Undefined|String|DOMElement|jQuery) The context stylesheets, all of them by default. * @return {jQuery.Rule} Returns a jQuery.Rule object. * * @example $.rule('p,div').filter(function(){ return this.style.display != 'block'; }).remove(); * * @example $.rule('div{ padding:20px;background:#CCC}, p{ border:1px red solid; }').appendTo('style'); * * @example $.rule('div{}').append('margin:40px').css('margin-left',0).appendTo('link:eq(1)'); * * @example $.rule().not('div, p.magic').fadeOut('slow'); * * @example var text = $.rule('#screen h2').add('h4').end().eq(4).text(); */ ;(function( $ ){ /** * Notes * Some styles and animations might fail, please report it. * The plugin needs a style node to stay in the DOM all along to temporarily hold rules. DON'T TOUCH IT. * Opera requires this style to have alternate in the rel to allow disabling it. * Rules in IE don't have .parentStylesheet. We need to find it each time(slow). * Animations need close attention. Programatically knowing which rule has precedence, would require a LOT of work. * This plugin adds $.rule and also 4 methods to $.fn: ownerNode, sheet, cssRules and cssText * Note that rules are not directly inside nodes, you need to do: $('style').sheet().cssRules(). */ var storageNode = $('