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:
88
modules/system/assets/ui/js/inspector.editor.string.js
Normal file
88
modules/system/assets/ui/js/inspector.editor.string.js
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Inspector string editor class.
|
||||
*/
|
||||
+function ($) { "use strict";
|
||||
|
||||
var Base = $.wn.inspector.propertyEditors.base,
|
||||
BaseProto = Base.prototype
|
||||
|
||||
var StringEditor = function(inspector, propertyDefinition, containerCell, group) {
|
||||
Base.call(this, inspector, propertyDefinition, containerCell, group)
|
||||
}
|
||||
|
||||
StringEditor.prototype = Object.create(BaseProto)
|
||||
StringEditor.prototype.constructor = Base
|
||||
|
||||
StringEditor.prototype.dispose = function() {
|
||||
this.unregisterHandlers()
|
||||
|
||||
BaseProto.dispose.call(this)
|
||||
}
|
||||
|
||||
StringEditor.prototype.build = function() {
|
||||
var editor = document.createElement('input'),
|
||||
placeholder = this.propertyDefinition.placeholder !== undefined ? this.propertyDefinition.placeholder : '',
|
||||
value = this.inspector.getPropertyValue(this.propertyDefinition.property)
|
||||
|
||||
editor.setAttribute('type', 'text')
|
||||
editor.setAttribute('class', 'string-editor')
|
||||
editor.setAttribute('placeholder', placeholder)
|
||||
|
||||
if (value === undefined) {
|
||||
value = this.propertyDefinition.default
|
||||
}
|
||||
|
||||
if (value === undefined) {
|
||||
value = ''
|
||||
}
|
||||
|
||||
editor.value = value
|
||||
|
||||
$.wn.foundation.element.addClass(this.containerCell, 'text')
|
||||
|
||||
this.containerCell.appendChild(editor)
|
||||
}
|
||||
|
||||
StringEditor.prototype.updateDisplayedValue = function(value) {
|
||||
this.getInput().value = value
|
||||
}
|
||||
|
||||
StringEditor.prototype.getInput = function() {
|
||||
return this.containerCell.querySelector('input')
|
||||
}
|
||||
|
||||
StringEditor.prototype.focus = function() {
|
||||
this.getInput().focus()
|
||||
this.onInputFocus()
|
||||
}
|
||||
|
||||
StringEditor.prototype.registerHandlers = function() {
|
||||
var input = this.getInput()
|
||||
|
||||
input.addEventListener('focus', this.proxy(this.onInputFocus))
|
||||
input.addEventListener('keyup', this.proxy(this.onInputKeyUp))
|
||||
}
|
||||
|
||||
StringEditor.prototype.unregisterHandlers = function() {
|
||||
var input = this.getInput()
|
||||
|
||||
input.removeEventListener('focus', this.proxy(this.onInputFocus))
|
||||
input.removeEventListener('keyup', this.proxy(this.onInputKeyUp))
|
||||
}
|
||||
|
||||
StringEditor.prototype.onInputFocus = function(ev) {
|
||||
this.inspector.makeCellActive(this.containerCell)
|
||||
}
|
||||
|
||||
StringEditor.prototype.onInputKeyUp = function() {
|
||||
var value = $.trim(this.getInput().value)
|
||||
|
||||
this.inspector.setPropertyValue(this.propertyDefinition.property, value)
|
||||
}
|
||||
|
||||
StringEditor.prototype.onExternalPropertyEditorHidden = function() {
|
||||
this.focus()
|
||||
}
|
||||
|
||||
$.wn.inspector.propertyEditors.string = StringEditor
|
||||
}(window.jQuery);
|
||||
Reference in New Issue
Block a user