Sha256: ed19cd87d25d52131cd36d442b19910b9a94946cfcc6bb0cfa9f0a6fa59616f6

Contents?: true

Size: 1.58 KB

Versions: 31

Compression:

Stored size: 1.58 KB

Contents

I"A(function() {
  var 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; },
    hasProp = {}.hasOwnProperty;

  App.Validators.Vulgarity = (function(superClass) {
    extend(Vulgarity, superClass);

    Vulgarity.identity = 'Vulgarity';

    function Vulgarity() {
      Vulgarity.__super__.constructor.apply(this, arguments);
    }

    Vulgarity.prototype.validate = function() {
      var vulgarWord;
      if (this.val == null) {
        return;
      }
      switch (typeof this.val) {
        case 'string':
          vulgarWord = this._getVulgarWord();
          if (RegExp("" + vulgarWord, "i").exec(this.val)) {
            return this._addErrorMessage();
          } else {

          }
          break;
        default:
          throw new TypeError("Vulgarity validator is applicable only for strings and " + this.attr + " isn't.");
      }
    };

    Vulgarity.prototype._addErrorMessage = function() {
      var message;
      message = App.I18n[App.Env.loco.getLocale()].errors.messages.vulgarity;
      return this.obj.addErrorMessage(message, {
        "for": this.attr
      });
    };

    Vulgarity.prototype._getVulgarWord = function() {
      switch (App.Env.loco.getLocale()) {
        case 'pl':
          return 'kurwa';
        case 'en':
          return 'fuck';
      }
    };

    return Vulgarity;

  })(App.Validators.Base);

}).call(this);
:ET

Version data entries

31 entries across 20 versions & 1 rubygems

Version Path
loco-rails-3.0.3 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache
loco-rails-2.5.3 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache
loco-rails-2.5.2 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache
loco-rails-3.0.2 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache
loco-rails-3.0.1 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache
loco-rails-2.5.1 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache
loco-rails-2.5.0 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache
loco-rails-2.4.0 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache
loco-rails-2.4.0 test/dummy/tmp/cache/assets/sprockets/v3.0/LP/LP1wXF7mdtp0aKqal-ClzY7NHD4b728fTz625_W21c4.cache
loco-rails-2.3.0 test/dummy/tmp/cache/assets/sprockets/v3.0/LP/LP1wXF7mdtp0aKqal-ClzY7NHD4b728fTz625_W21c4.cache
loco-rails-2.3.0 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache
loco-rails-3.0.0 test/dummy/tmp/cache/assets/sprockets/v3.0/LP/LP1wXF7mdtp0aKqal-ClzY7NHD4b728fTz625_W21c4.cache
loco-rails-3.0.0 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache
loco-rails-2.2.2 test/dummy/tmp/cache/assets/sprockets/v3.0/LP/LP1wXF7mdtp0aKqal-ClzY7NHD4b728fTz625_W21c4.cache
loco-rails-2.2.2 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache
loco-rails-2.2.1 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache
loco-rails-2.2.1 test/dummy/tmp/cache/assets/sprockets/v3.0/LP/LP1wXF7mdtp0aKqal-ClzY7NHD4b728fTz625_W21c4.cache
loco-rails-2.2.0 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache
loco-rails-2.2.0 test/dummy/tmp/cache/assets/sprockets/v3.0/LP/LP1wXF7mdtp0aKqal-ClzY7NHD4b728fTz625_W21c4.cache
loco-rails-2.1.0 test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmnjo86arBnTrMgIcfHRnzgUBY0OChg_h21zyZ9sCuA.cache