feat: VivesPOS landing on Winter CMS 1.2 — theme + plugin + Dockerfile
Some checks are pending
Module sub-split / Sub-split (push) Waiting to run
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
This commit is contained in:
119
modules/system/assets/ui/js/inspector.validationset.js
Normal file
119
modules/system/assets/ui/js/inspector.validationset.js
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Inspector validation set class.
|
||||
*/
|
||||
+function ($) { "use strict";
|
||||
|
||||
// NAMESPACES
|
||||
// ============================
|
||||
|
||||
if ($.wn.inspector.validators === undefined)
|
||||
$.wn.inspector.validators = {}
|
||||
|
||||
// CLASS DEFINITION
|
||||
// ============================
|
||||
|
||||
var Base = $.wn.foundation.base,
|
||||
BaseProto = Base.prototype
|
||||
|
||||
var ValidationSet = function(options, propertyName) {
|
||||
this.validators = []
|
||||
|
||||
this.options = options
|
||||
this.propertyName = propertyName
|
||||
Base.call(this)
|
||||
|
||||
this.createValidators()
|
||||
}
|
||||
|
||||
ValidationSet.prototype = Object.create(BaseProto)
|
||||
ValidationSet.prototype.constructor = Base
|
||||
|
||||
ValidationSet.prototype.dispose = function() {
|
||||
this.disposeValidators()
|
||||
this.validators = null
|
||||
|
||||
BaseProto.dispose.call(this)
|
||||
}
|
||||
|
||||
ValidationSet.prototype.disposeValidators = function() {
|
||||
for (var i = 0, len = this.validators.length; i < len; i++) {
|
||||
this.validators[i].dispose()
|
||||
}
|
||||
}
|
||||
|
||||
ValidationSet.prototype.throwError = function(errorMessage) {
|
||||
throw new Error(errorMessage + ' Property: ' + this.propertyName)
|
||||
}
|
||||
|
||||
ValidationSet.prototype.createValidators = function() {
|
||||
// Handle legacy validation syntax properties:
|
||||
//
|
||||
// - required
|
||||
// - validationPattern
|
||||
// - validationMessage
|
||||
|
||||
if ((this.options.required !== undefined ||
|
||||
this.options.validationPattern !== undefined ||
|
||||
this.options.validationMessage !== undefined) &&
|
||||
this.options.validation !== undefined) {
|
||||
this.throwError('Legacy and new validation syntax should not be mixed.')
|
||||
}
|
||||
|
||||
if (this.options.required !== undefined && this.options.required) {
|
||||
var validator = new $.wn.inspector.validators.required({
|
||||
message: this.options.validationMessage
|
||||
})
|
||||
|
||||
this.validators.push(validator)
|
||||
}
|
||||
|
||||
if (this.options.validationPattern !== undefined) {
|
||||
var validator = new $.wn.inspector.validators.regex({
|
||||
message: this.options.validationMessage,
|
||||
pattern: this.options.validationPattern
|
||||
})
|
||||
|
||||
this.validators.push(validator)
|
||||
}
|
||||
|
||||
//
|
||||
// Handle new validation syntax
|
||||
//
|
||||
|
||||
if (this.options.validation === undefined) {
|
||||
return
|
||||
}
|
||||
|
||||
for (var validatorName in this.options.validation) {
|
||||
if ($.wn.inspector.validators[validatorName] == undefined) {
|
||||
this.throwError('Inspector validator "' + validatorName + '" is not found in the $.wn.inspector.validators namespace.')
|
||||
}
|
||||
|
||||
var validator = new $.wn.inspector.validators[validatorName](
|
||||
this.options.validation[validatorName]
|
||||
)
|
||||
|
||||
this.validators.push(validator)
|
||||
}
|
||||
}
|
||||
|
||||
ValidationSet.prototype.validate = function(value) {
|
||||
try {
|
||||
for (var i = 0, len = this.validators.length; i < len; i++) {
|
||||
var validator = this.validators[i],
|
||||
errorMessage = validator.isValid(value)
|
||||
|
||||
if (typeof errorMessage === 'string') {
|
||||
return errorMessage
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
catch (err) {
|
||||
this.throwError(err)
|
||||
}
|
||||
}
|
||||
|
||||
$.wn.inspector.validationSet = ValidationSet
|
||||
}(window.jQuery);
|
||||
Reference in New Issue
Block a user