Nav apraksta

pixelated.js 1.0KB

123456789101112131415161718192021222324252627282930313233
  1. (function() {
  2. var Pixelated, Value,
  3. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  4. hasProp = {}.hasOwnProperty;
  5. Value = require('../value');
  6. Pixelated = (function(superClass) {
  7. extend(Pixelated, superClass);
  8. function Pixelated() {
  9. return Pixelated.__super__.constructor.apply(this, arguments);
  10. }
  11. Pixelated.names = ['pixelated'];
  12. Pixelated.prototype.replace = function(string, prefix) {
  13. if (prefix === '-webkit-') {
  14. return string.replace(this.regexp(), '$1-webkit-optimize-contrast');
  15. } else if (prefix === '-moz-') {
  16. return string.replace(this.regexp(), '$1-moz-crisp-edges');
  17. } else {
  18. return Pixelated.__super__.replace.apply(this, arguments);
  19. }
  20. };
  21. return Pixelated;
  22. })(Value);
  23. module.exports = Pixelated;
  24. }).call(this);