BVB Source Codes

reactide Show info.js Source code

Return Download reactide: download info.js Source code - Download reactide Source code - Type:.js
  1. (function() {
  2.   var browserslist, capitalize, names, prefix;
  3.  
  4.   browserslist = require('browserslist');
  5.  
  6.   capitalize = function(str) {
  7.     return str.slice(0, 1).toUpperCase() + str.slice(1);
  8.   };
  9.  
  10.   names = {
  11.     ie: 'IE',
  12.     ie_mob: 'IE Mobile',
  13.     ios_saf: 'iOS',
  14.     op_mini: 'Opera Mini',
  15.     op_mob: 'Opera Mobile',
  16.     and_chr: 'Chrome for Android',
  17.     and_ff: 'Firefox for Android',
  18.     and_uc: 'UC for Android'
  19.   };
  20.  
  21.   prefix = function(name, prefixes) {
  22.     var out;
  23.     out = '  ' + name + ': ';
  24.     out += prefixes.map(function(i) {
  25.       return i.replace(/^-(.*)-$/g, '$1');
  26.     }).join(', ');
  27.     out += "\n";
  28.     return out;
  29.   };
  30.  
  31.   module.exports = function(prefixes) {
  32.     var atrules, browser, coverage, data, j, k, l, len, len1, len2, list, name, out, props, ref, ref1, ref2, ref3, ref4, ref5, round, selector, selectors, string, value, values, version, versions;
  33.     if (prefixes.browsers.selected.length === 0) {
  34.       return "No browsers selected";
  35.     }
  36.     versions = [];
  37.     ref = prefixes.browsers.selected;
  38.     for (j = 0, len = ref.length; j < len; j++) {
  39.       browser = ref[j];
  40.       ref1 = browser.split(' '), name = ref1[0], version = ref1[1];
  41.       name = names[name] || capitalize(name);
  42.       if (versions[name]) {
  43.         versions[name].push(version);
  44.       } else {
  45.         versions[name] = [version];
  46.       }
  47.     }
  48.     out = "Browsers:\n";
  49.     for (browser in versions) {
  50.       list = versions[browser];
  51.       list = list.sort(function(a, b) {
  52.         return parseFloat(b) - parseFloat(a);
  53.       });
  54.       out += '  ' + browser + ': ' + list.join(', ') + "\n";
  55.     }
  56.     coverage = browserslist.coverage(prefixes.browsers.selected);
  57.     round = Math.round(coverage * 100) / 100.0;
  58.     out += "\nThese browsers account for " + round + "% of all users globally\n";
  59.     atrules = '';
  60.     ref2 = prefixes.add;
  61.     for (name in ref2) {
  62.       data = ref2[name];
  63.       if (name[0] === '@' && data.prefixes) {
  64.         atrules += prefix(name, data.prefixes);
  65.       }
  66.     }
  67.     if (atrules !== '') {
  68.       out += "\nAt-Rules:\n" + atrules;
  69.     }
  70.     selectors = '';
  71.     ref3 = prefixes.add.selectors;
  72.     for (k = 0, len1 = ref3.length; k < len1; k++) {
  73.       selector = ref3[k];
  74.       if (selector.prefixes) {
  75.         selectors += prefix(selector.name, selector.prefixes);
  76.       }
  77.     }
  78.     if (selectors !== '') {
  79.       out += "\nSelectors:\n" + selectors;
  80.     }
  81.     values = '';
  82.     props = '';
  83.     ref4 = prefixes.add;
  84.     for (name in ref4) {
  85.       data = ref4[name];
  86.       if (name[0] !== '@' && data.prefixes) {
  87.         props += prefix(name, data.prefixes);
  88.       }
  89.       if (!data.values) {
  90.         continue;
  91.       }
  92.       ref5 = data.values;
  93.       for (l = 0, len2 = ref5.length; l < len2; l++) {
  94.         value = ref5[l];
  95.         string = prefix(value.name, value.prefixes);
  96.         if (values.indexOf(string) === -1) {
  97.           values += string;
  98.         }
  99.       }
  100.     }
  101.     if (props !== '') {
  102.       out += "\nProperties:\n" + props;
  103.     }
  104.     if (values !== '') {
  105.       out += "\nValues:\n" + values;
  106.     }
  107.     if (atrules === '' && selectors === '' && props === '' && values === '') {
  108.       out += '\nAwesome! Your browsers don\'t require any vendor prefixes.' + '\nNow you can remove Autoprefixer from build steps.';
  109.     }
  110.     return out;
  111.   };
  112.  
  113. }).call(this);
  114.  
downloadinfo.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