Changeset 1188234
- Timestamp:
- 06/26/2015 03:05:57 PM (11 years ago)
- Location:
- militant-moderates-css-parent-selector-mmps
- Files:
-
- 8 added
- 5 edited
-
tags/1.1.3 (added)
-
tags/1.1.3/css (added)
-
tags/1.1.3/css/mmParentSelector.css (added)
-
tags/1.1.3/js (added)
-
tags/1.1.3/js/mmParentSelector.js (added)
-
tags/1.1.3/js/mmParentSelector.min.js (added)
-
tags/1.1.3/mmParentSelector.php (added)
-
tags/1.1.3/readme.txt (added)
-
trunk/css/mmParentSelector.css (modified) (2 diffs)
-
trunk/js/mmParentSelector.js (modified) (5 diffs)
-
trunk/js/mmParentSelector.min.js (modified) (1 diff)
-
trunk/mmParentSelector.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
militant-moderates-css-parent-selector-mmps/trunk/css/mmParentSelector.css
r1187616 r1188234 1 1 /** 2 2 * @package militant-moderates-css-parent-selector-mmps 3 * @version 1.1. 23 * @version 1.1.3 4 4 */ 5 5 /* … … 7 7 Plugin URI: http://www.militantmoderates.org/mmps-quick-start/ 8 8 Description: Adds CSS "Parent Selector" support to your Theme. Apply your CSS Style to Parent/Sibling elements not just the Selected element. 9 Version: 1.1. 29 Version: 1.1.3 10 10 Author: MM Techmaster 11 11 Author URI: https://profiles.wordpress.org/mmtechmaster -
militant-moderates-css-parent-selector-mmps/trunk/js/mmParentSelector.js
r1187993 r1188234 1 1 /** 2 2 * @package militant-moderates-css-parent-selector-mmps 3 * @version 1.1. 23 * @version 1.1.3 4 4 */ 5 5 /* … … 7 7 Plugin URI: http://www.militantmoderates.org/mmps-quick-start/ 8 8 Description: Adds CSS "Parent Selector" support to your Theme. Apply your CSS Style to Parent/Sibling elements not just the Selected element. 9 Version: 1.1. 29 Version: 1.1.3 10 10 Author: MM Techmaster 11 11 Author URI: https://profiles.wordpress.org/mmtechmaster … … 37 37 active: 'focusin', 38 38 focus: 'focusin', 39 hover: 'mouse enter',39 hover: 'mouseover', 40 40 }, 41 41 … … 45 45 keydown: 'keyup', 46 46 mouseenter: 'mouseleave', 47 mouseover: 'mouse leave',47 mouseover: 'mouseout', 48 48 }, 49 49 … … 238 238 // if this is a paired event then build a reverse handler 239 239 if ( pairedEventMap[e.type] ) { 240 $(e.currentTarget).one( mmpsAddNamespace( pairedEventMap[e.type] ), function(oe) {240 $(e.currentTarget).one( mmpsAddNamespace( pairedEventMap[e.type] ), { id: e.data.id, subject: $(e.data.subject) }, function(oe) { 241 241 // Make sure all paired event handlers are turned off, not just the one that fired 242 242 $(oe.currentTarget).off( mmpsAddNamespace( pairedEventMap[e.type] ) ); 243 243 // Then toggle the Class on the Subject element 244 $( e.data.subject).toggleClass(e.data.id);244 $(oe.data.subject).toggleClass(oe.data.id); 245 245 }); 246 246 } -
militant-moderates-css-parent-selector-mmps/trunk/js/mmParentSelector.min.js
r1187993 r1188234 1 1 2 jQuery(document).ready(function($){var evidx=0,k=0,i,j,CLASS='mmPpSsPrEfIx',eventMap={active:'focusin',focus:'focusin',hover:'mouse enter',},pairedEventMap={mousedown:'mouseup mouseout mouseleave',focusin:'focusout',keydown:'keyup',mouseenter:'mouseleave',mouseover:'mouseleave',},stateMap={active:':active',disabled:':disabled',empty:':empty',enabled:':enabled',first_child:':first-child',first_of_type:':first-of-type',in_range:':in-range',invalid:':invalid',lang:':lang',last_child:':last-child',last_of_type:':last-of-type',link:':link',not:':not',nth_child:':nth-child',nth_last_child:':nth-last-child',nth_last_of_type:':nth-last-of-type',nth_of_type:':nth-of-type',only_of_type:':only-of-type',only_child:':only-child',optional:':optional',out_of_range:':out-of-range',read_only:':read-only',read_write:':read-write',required:':required',target:':target',valid:':valid',visited:':visited'},pseudoElements={after:'::after',before:'::before',first_letter:'::first-letter',first_line:'::first-line',selection:'::selection'},parsed,parsedSelectors,matches,selectors,selector,parent,target,child,pseudoTargets,declarations,pseudoParent,pseudoParents,childSelector,childElements,REGEX=new RegExp((function(aryRegExp){var ret='';for(var i=0;i<aryRegExp.length;i++)2 jQuery(document).ready(function($){var evidx=0,k=0,i,j,CLASS='mmPpSsPrEfIx',eventMap={active:'focusin',focus:'focusin',hover:'mouseover',},pairedEventMap={mousedown:'mouseup mouseout mouseleave',focusin:'focusout',keydown:'keyup',mouseenter:'mouseleave',mouseover:'mouseout',},stateMap={active:':active',disabled:':disabled',empty:':empty',enabled:':enabled',first_child:':first-child',first_of_type:':first-of-type',in_range:':in-range',invalid:':invalid',lang:':lang',last_child:':last-child',last_of_type:':last-of-type',link:':link',not:':not',nth_child:':nth-child',nth_last_child:':nth-last-child',nth_last_of_type:':nth-last-of-type',nth_of_type:':nth-of-type',only_of_type:':only-of-type',only_child:':only-child',optional:':optional',out_of_range:':out-of-range',read_only:':read-only',read_write:':read-write',required:':required',target:':target',valid:':valid',visited:':visited'},pseudoElements={after:'::after',before:'::before',first_letter:'::first-letter',first_line:'::first-line',selection:'::selection'},parsed,parsedSelectors,matches,selectors,selector,parent,target,child,pseudoTargets,declarations,pseudoParent,pseudoParents,childSelector,childElements,REGEX=new RegExp((function(aryRegExp){var ret='';for(var i=0;i<aryRegExp.length;i++) 3 3 ret+=aryRegExp[i].source;return ret;})([/[\w\s\/\.\-\:\=\[\]\(\)\~\+\|\,\*\'\"\^$#>]*(?=!)/,/[\w\s\/\.\-\:\=\[\]\(\)\~\+\|\,\*\'\"\^$#>!]*\{{1}/,/[^\}]+\}{1}/]),"gi");parse=function(sRawCSS){sRawCSS=sRawCSS.replace(/(\/\*([\s\S]*?)\*\/)/gm,'');if(matches=sRawCSS.match(REGEX)){parsed='';for(i=-1;++i<matches.length;){style=$.trim(matches[i]);selectors=$.trim(style.split('{')[0]).split(',');declarations='{'+style.split(/\{|\}/)[1].replace(/^\s+|\s+$[\t\n\r]*/g,'')+'}';if(declarations==='{}'){continue;} 4 4 if(!/;}$/.test(declarations)) 5 5 declarations=declarations.replace(/}/g,';}');declarations=declarations.replace(/;/g,' !important;');parsedSelectors='';for(j=-1;++j<selectors.length;){selector=$.trim(selectors[j]);(parsedSelectors.length)&&(parsedSelectors+=",");if(/!/.test(selector)){var splitsel=selector.split('!');var splitp=splitsel[0].split(/[>~+\s]+/).reverse()[0].split(/[\:]+/);parent=$.trim(splitp[0]);pseudoParents=splitp.slice(1);var splitt=splitsel[1].split(/[>~+\s]+/).reverse()[0].split(/[\:]+/);target=$.trim(splitt[0])||[]._;pseudoTargets=splitt.slice(1);childSelector=selector.replace(/!/g,'').replace('::',':');$(pseudoParents).each(function(x){childSelector=childSelector.replace(':'+this,'');});$(pseudoTargets).each(function(x){if(eventMap[this])childSelector=childSelector.replace(':'+this,'');});childElements=childSelector.match(/([\>\+\~]|(\:not\()?((\w[\-\w]*|\*)|[\.\#]\w[\-\w]*|\:{1,2}\w[\-\w\(\)]*|\[[^\]]*\])+\)?\!?)/gi);if(childElements.length>1){var qDOM;do{qDOM=false;try{child=$(childSelector);} 6 6 catch(err){var ep=':'+$.trim(err.toString().match(/[\w\-]+$/i));if(childSelector.lastIndexOf(ep)>=0){childSelector=childSelector.replace(new RegExp(ep,'g'),'');qDOM=true;}}}while(qDOM);child.each(function(idx){var subject=$(this);var tmpNodes=childElements.slice(0,-1);;var n=$.trim(tmpNodes.pop());do{switch(n){case'>':n=$.trim(tmpNodes.pop());case'*':subject=subject.parent(n);break;case'+':n=$.trim(tmpNodes.pop());subject=subject.prev(n);break;case'~':n=$.trim(tmpNodes.pop());subject=subject.prev();while(subject&&!subject.is(n)){subject=subject.prev();} 7 break;default:subject=subject.closest(n);break;}}while(subject&&n!=parent&&(n=$.trim(tmpNodes.pop())));if(subject){var id=CLASS+k++,mmpsAddNamespace=function(eType){return eType.split(/[ ]+/).join('.e'+id+' ')+'.e'+id;},toggleFn=function(e){var eid='E#'+evidx++;if(e){if(pairedEventMap[e.type]){$(e.currentTarget).one(mmpsAddNamespace(pairedEventMap[e.type]), function(oe){$(oe.currentTarget).off(mmpsAddNamespace(pairedEventMap[e.type]));$(e.data.subject).toggleClass(e.data.id);});}}7 break;default:subject=subject.closest(n);break;}}while(subject&&n!=parent&&(n=$.trim(tmpNodes.pop())));if(subject){var id=CLASS+k++,mmpsAddNamespace=function(eType){return eType.split(/[ ]+/).join('.e'+id+' ')+'.e'+id;},toggleFn=function(e){var eid='E#'+evidx++;if(e){if(pairedEventMap[e.type]){$(e.currentTarget).one(mmpsAddNamespace(pairedEventMap[e.type]),{id:e.data.id,subject:$(e.data.subject)},function(oe){$(oe.currentTarget).off(mmpsAddNamespace(pairedEventMap[e.type]));$(oe.data.subject).toggleClass(oe.data.id);});}} 8 8 $(e.data.subject).toggleClass(e.data.id);};idx&&(parsedSelectors.length)&&(parsedSelectors+=",");parsedSelectors+='.'+id;var qClass=false;$(pseudoParents).each(function(){var ppNorm=this.replace(/\-/g,'_');if(pseudoElements[ppNorm]){parsedSelectors+=pseudoElements[ppNorm];qClass=true;}else{$(subject).on(mmpsAddNamespace(eventMap[this]||this),{id:id,subject:$(subject)},toggleFn);}});if(pseudoTargets.length){var orgChild=$(this);$(pseudoTargets).each(function(){var pt=this.split(/(?:\(|\))/g);var ptNorm=pt[0].replace(/\-/g,'_');var ptParam=stateMap[ptNorm]+(pt[1]?'('+pt[1]+')':'');if(pseudoElements[ptNorm]){}else if(eventMap[this]){$(orgChild).on(mmpsAddNamespace(eventMap[this]),{id:id,subject:$(subject)},toggleFn);qClass=false;}else if(stateMap[ptNorm]){qClass=true;}else{$(orgChild).on(mmpsAddNamespace(this.toString()),{id:id,subject:$(subject)},toggleFn);qClass=false;}});}else if(!pseudoParents.length){qClass=true;} 9 9 if(qClass){$(subject).toggleClass(id);}}});}}else{child=$(selector);if(child.length)parsedSelectors+=selector;}} -
militant-moderates-css-parent-selector-mmps/trunk/mmParentSelector.php
r1187993 r1188234 2 2 /** 3 3 * @package militant-moderates-css-parent-selector-mmps 4 * @version 1.1. 24 * @version 1.1.3 5 5 */ 6 6 /* … … 8 8 Plugin URI: http://www.militantmoderates.org/mmps-quick-start/ 9 9 Description: Adds CSS "Parent Selector" support to your Theme. Apply your CSS Style to Parent/Sibling elements not just the Selected element. 10 Version: 1.1. 210 Version: 1.1.3 11 11 Author: MM Techmaster 12 12 Author URI: https://profiles.wordpress.org/mmtechmaster -
militant-moderates-css-parent-selector-mmps/trunk/readme.txt
r1187993 r1188234 5 5 Requires at least: 4.0.0 6 6 Tested up to: 4.2.2 7 Stable tag: 1.1. 27 Stable tag: 1.1.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 34 34 35 35 == Changelog == 36 = 1.1.3 = 37 * Fixed issue that caused wrong Class to be removed at the end of a Paired Event: mouseover/mouseout for example 38 36 39 = 1.1.2 = 37 40 * Protected development version JavaScript against execution by anyone other than a site Admin - This is only an issue on the development platform where visitors to the main site might encounter errors from code in development.
Note: See TracChangeset
for help on using the changeset viewer.