BVB Source Codes

reactide Show old-selector.js Source code

Return Download reactide: download old-selector.js Source code - Download reactide Source code - Type:.js
  1. (function() {
  2.   var OldSelector;
  3.  
  4.   OldSelector = (function() {
  5.     function OldSelector(selector, prefix1) {
  6.       var i, len, prefix, ref;
  7.       this.prefix = prefix1;
  8.       this.prefixed = selector.prefixed(this.prefix);
  9.       this.regexp = selector.regexp(this.prefix);
  10.       this.prefixeds = [];
  11.       ref = selector.possible();
  12.       for (i = 0, len = ref.length; i < len; i++) {
  13.         prefix = ref[i];
  14.         this.prefixeds.push([selector.prefixed(prefix), selector.regexp(prefix)]);
  15.       }
  16.       this.unprefixed = selector.name;
  17.       this.nameRegexp = selector.regexp();
  18.     }
  19.  
  20.     OldSelector.prototype.isHack = function(rule) {
  21.       var before, i, index, len, ref, ref1, regexp, rules, some, string;
  22.       index = rule.parent.index(rule) + 1;
  23.       rules = rule.parent.nodes;
  24.       while (index < rules.length) {
  25.         before = rules[index].selector;
  26.         if (!before) {
  27.           return true;
  28.         }
  29.         if (before.indexOf(this.unprefixed) !== -1 && before.match(this.nameRegexp)) {
  30.           return false;
  31.         }
  32.         some = false;
  33.         ref = this.prefixeds;
  34.         for (i = 0, len = ref.length; i < len; i++) {
  35.           ref1 = ref[i], string = ref1[0], regexp = ref1[1];
  36.           if (before.indexOf(string) !== -1 && before.match(regexp)) {
  37.             some = true;
  38.             break;
  39.           }
  40.         }
  41.         if (!some) {
  42.           return true;
  43.         }
  44.         index += 1;
  45.       }
  46.       return true;
  47.     };
  48.  
  49.     OldSelector.prototype.check = function(rule) {
  50.       if (rule.selector.indexOf(this.prefixed) === -1) {
  51.         return false;
  52.       }
  53.       if (!rule.selector.match(this.regexp)) {
  54.         return false;
  55.       }
  56.       if (this.isHack(rule)) {
  57.         return false;
  58.       }
  59.       return true;
  60.     };
  61.  
  62.     return OldSelector;
  63.  
  64.   })();
  65.  
  66.   module.exports = OldSelector;
  67.  
  68. }).call(this);
  69.  
downloadold-selector.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top