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:
97
modules/system/assets/ui/js/inspector.editor.text.js
Normal file
97
modules/system/assets/ui/js/inspector.editor.text.js
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Inspector text editor class.
|
||||
*/
|
||||
+function ($) { "use strict";
|
||||
|
||||
var Base = $.wn.inspector.propertyEditors.popupBase,
|
||||
BaseProto = Base.prototype
|
||||
|
||||
var TextEditor = function(inspector, propertyDefinition, containerCell, group) {
|
||||
Base.call(this, inspector, propertyDefinition, containerCell, group)
|
||||
}
|
||||
|
||||
TextEditor.prototype = Object.create(BaseProto)
|
||||
TextEditor.prototype.constructor = Base
|
||||
|
||||
TextEditor.prototype.setLinkText = function(link, value) {
|
||||
var value = value !== undefined ? value
|
||||
: this.inspector.getPropertyValue(this.propertyDefinition.property)
|
||||
|
||||
if (value === undefined) {
|
||||
value = this.propertyDefinition.default
|
||||
}
|
||||
|
||||
if (!value) {
|
||||
value = this.propertyDefinition.placeholder
|
||||
$.wn.foundation.element.addClass(link, 'placeholder')
|
||||
}
|
||||
else {
|
||||
$.wn.foundation.element.removeClass(link, 'placeholder')
|
||||
}
|
||||
|
||||
if (typeof value === 'string') {
|
||||
value = value.replace(/(?:\r\n|\r|\n)/g, ' ');
|
||||
value = $.trim(value)
|
||||
value = value.substring(0, 300);
|
||||
}
|
||||
|
||||
link.textContent = value
|
||||
}
|
||||
|
||||
TextEditor.prototype.getPopupContent = function() {
|
||||
return '<form> \
|
||||
<div class="modal-header"> \
|
||||
<button type="button" class="close" data-dismiss="popup">×</button> \
|
||||
<h4 class="modal-title">{{property}}</h4> \
|
||||
</div> \
|
||||
<div class="modal-body"> \
|
||||
<div class="form-group"> \
|
||||
<p class="inspector-field-comment"></p> \
|
||||
<textarea class="form-control size-small field-textarea" name="name"> \
|
||||
</textarea> \
|
||||
</div> \
|
||||
</div> \
|
||||
<div class="modal-footer"> \
|
||||
<button type="submit" class="btn btn-primary">OK</button> \
|
||||
<button type="button" class="btn btn-default" data-dismiss="popup">Cancel</button> \
|
||||
</div> \
|
||||
</form>'
|
||||
}
|
||||
|
||||
TextEditor.prototype.configureComment = function(popup) {
|
||||
if (!this.propertyDefinition.description) {
|
||||
return
|
||||
}
|
||||
|
||||
var descriptionElement = $(popup).find('p.inspector-field-comment')
|
||||
descriptionElement.text(this.propertyDefinition.description)
|
||||
}
|
||||
|
||||
TextEditor.prototype.configurePopup = function(popup) {
|
||||
var $textarea = $(popup).find('textarea'),
|
||||
value = this.inspector.getPropertyValue(this.propertyDefinition.property)
|
||||
|
||||
if (this.propertyDefinition.placeholder) {
|
||||
$textarea.attr('placeholder', this.propertyDefinition.placeholder)
|
||||
}
|
||||
|
||||
if (value === undefined) {
|
||||
value = this.propertyDefinition.default
|
||||
}
|
||||
|
||||
$textarea.val(value)
|
||||
$textarea.focus()
|
||||
|
||||
this.configureComment(popup)
|
||||
}
|
||||
|
||||
TextEditor.prototype.handleSubmit = function($form) {
|
||||
var $textarea = $form.find('textarea'),
|
||||
link = this.getLink(),
|
||||
value = $.trim($textarea.val())
|
||||
|
||||
this.inspector.setPropertyValue(this.propertyDefinition.property, value)
|
||||
}
|
||||
|
||||
$.wn.inspector.propertyEditors.text = TextEditor
|
||||
}(window.jQuery);
|
||||
Reference in New Issue
Block a user