暫無描述

fill-available.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. (function() {
  2. var FillAvailable, OldValue, 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. OldValue = require('../old-value');
  6. Value = require('../value');
  7. FillAvailable = (function(superClass) {
  8. extend(FillAvailable, superClass);
  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);