Some checks are pending
Module sub-split / Sub-split (push) Waiting to run
- Base: wintercms/winter branch 1.2 (full framework) - Theme vivespos: Canvas 7 + Bootstrap 5 CDN, custom CSS - Layout: deferred GTM/GA4 tracking, JSON-LD SoftwareApplication - Partials: hero (offline-first), features, modes (offline/nube toggle), screenshots, pricing (3 planes), comparison, FAQ, CTA - Plugin VivesPOS.Site with ContactForm - Dockerfile: PHP 8.2 Apache, port 80, healthcheck - Added winter/wn-pages, blog, sitemap, seo plugins - Active theme set to vivespos
59 lines
1.4 KiB
JavaScript
59 lines
1.4 KiB
JavaScript
/*
|
|
* Inspector validator base class.
|
|
*/
|
|
+function ($) { "use strict";
|
|
|
|
// NAMESPACES
|
|
// ============================
|
|
|
|
if ($.wn.inspector.validators === undefined)
|
|
$.wn.inspector.validators = {}
|
|
|
|
// CLASS DEFINITION
|
|
// ============================
|
|
|
|
var Base = $.wn.foundation.base,
|
|
BaseProto = Base.prototype
|
|
|
|
var BaseValidator = function(options) {
|
|
this.options = options
|
|
this.defaultMessage = 'Invalid property value.'
|
|
|
|
Base.call(this)
|
|
}
|
|
|
|
BaseValidator.prototype = Object.create(BaseProto)
|
|
BaseValidator.prototype.constructor = Base
|
|
|
|
BaseValidator.prototype.dispose = function() {
|
|
this.defaultMessage = null
|
|
|
|
BaseProto.dispose.call(this)
|
|
}
|
|
|
|
BaseValidator.prototype.getMessage = function(defaultMessage) {
|
|
if (this.options.message !== undefined) {
|
|
return this.options.message
|
|
}
|
|
|
|
if (defaultMessage !== undefined) {
|
|
return defaultMessage
|
|
}
|
|
|
|
return this.defaultMessage
|
|
}
|
|
|
|
BaseValidator.prototype.isScalar = function(value) {
|
|
if (value === undefined || value === null) {
|
|
return true
|
|
}
|
|
|
|
return !!(typeof value === 'string' || typeof value == 'number' || typeof value == 'boolean');
|
|
}
|
|
|
|
BaseValidator.prototype.isValid = function(value) {
|
|
return null
|
|
}
|
|
|
|
$.wn.inspector.validators.base = BaseValidator
|
|
}(window.jQuery); |