fill-available.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. (function() {
  2. var FillAvailable, OldValue, Value,
  3. __extends = 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. OldValue = require('../old-value');
  6. Value = require('../value');
  7. FillAvailable = (function(_super) {
  8. __extends(FillAvailable, _super);
  9. function FillAvailable() {
  10. return FillAvailable.__super__.constructor.apply(this, arguments);
  11. }
  12. FillAvailable.names = ['fill-available'];
  13. FillAvailable.prototype.replace = function(string, prefix) {
  14. if (prefix === '-moz-') {
  15. return string.replace(this.regexp(), '$1-moz-available$3');
  16. } else {
  17. return FillAvailable.__super__.replace.apply(this, arguments);
  18. }
  19. };
  20. FillAvailable.prototype.old = function(prefix) {
  21. if (prefix === '-moz-') {
  22. return new OldValue(this.name, '-moz-available');
  23. } else {
  24. return FillAvailable.__super__.old.apply(this, arguments);
  25. }
  26. };
  27. return FillAvailable;
  28. })(Value);
  29. module.exports = FillAvailable;
  30. }).call(this);