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:
137
modules/system/assets/ui/js/inspector.editor.popupbase.js
Normal file
137
modules/system/assets/ui/js/inspector.editor.popupbase.js
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Base class for Inspector editors that create popups.
|
||||
*/
|
||||
+function ($) { "use strict";
|
||||
|
||||
var Base = $.wn.inspector.propertyEditors.base,
|
||||
BaseProto = Base.prototype
|
||||
|
||||
var PopupBase = function(inspector, propertyDefinition, containerCell, group) {
|
||||
this.popup = null
|
||||
|
||||
Base.call(this, inspector, propertyDefinition, containerCell, group)
|
||||
}
|
||||
|
||||
PopupBase.prototype = Object.create(BaseProto)
|
||||
PopupBase.prototype.constructor = Base
|
||||
|
||||
PopupBase.prototype.dispose = function() {
|
||||
this.unregisterHandlers()
|
||||
this.popup = null
|
||||
|
||||
BaseProto.dispose.call(this)
|
||||
}
|
||||
|
||||
PopupBase.prototype.build = function() {
|
||||
var link = document.createElement('a')
|
||||
|
||||
$.wn.foundation.element.addClass(link, 'trigger')
|
||||
link.setAttribute('href', '#')
|
||||
this.setLinkText(link)
|
||||
|
||||
$.wn.foundation.element.addClass(this.containerCell, 'trigger-cell')
|
||||
|
||||
this.containerCell.appendChild(link)
|
||||
}
|
||||
|
||||
PopupBase.prototype.setLinkText = function(link, value) {
|
||||
}
|
||||
|
||||
PopupBase.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"> \
|
||||
</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>'
|
||||
}
|
||||
|
||||
PopupBase.prototype.updateDisplayedValue = function(value) {
|
||||
this.setLinkText(this.getLink(), value)
|
||||
}
|
||||
|
||||
PopupBase.prototype.registerHandlers = function() {
|
||||
var link = this.getLink(),
|
||||
$link = $(link)
|
||||
|
||||
link.addEventListener('click', this.proxy(this.onTriggerClick))
|
||||
$link.on('shown.oc.popup', this.proxy(this.onPopupShown))
|
||||
$link.on('hidden.oc.popup', this.proxy(this.onPopupHidden))
|
||||
}
|
||||
|
||||
PopupBase.prototype.unregisterHandlers = function() {
|
||||
var link = this.getLink(),
|
||||
$link = $(link)
|
||||
|
||||
link.removeEventListener('click', this.proxy(this.onTriggerClick))
|
||||
$link.off('shown.oc.popup', this.proxy(this.onPopupShown))
|
||||
$link.off('hidden.oc.popup', this.proxy(this.onPopupHidden))
|
||||
}
|
||||
|
||||
PopupBase.prototype.getLink = function() {
|
||||
return this.containerCell.querySelector('a.trigger')
|
||||
}
|
||||
|
||||
PopupBase.prototype.configurePopup = function(popup) {
|
||||
}
|
||||
|
||||
PopupBase.prototype.handleSubmit = function($form) {
|
||||
}
|
||||
|
||||
PopupBase.prototype.hidePopup = function() {
|
||||
$(this.getLink()).popup('hide')
|
||||
}
|
||||
|
||||
PopupBase.prototype.onTriggerClick = function(ev) {
|
||||
$.wn.foundation.event.stop(ev)
|
||||
|
||||
var content = this.getPopupContent()
|
||||
|
||||
content = content.replace('{{property}}', this.propertyDefinition.title)
|
||||
|
||||
$(ev.target).popup({
|
||||
content: content
|
||||
})
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
PopupBase.prototype.onPopupShown = function(ev, link, popup) {
|
||||
$(popup).on('submit.inspector', 'form', this.proxy(this.onSubmit))
|
||||
|
||||
this.popup = popup.get(0)
|
||||
|
||||
this.configurePopup(popup)
|
||||
|
||||
this.getRootSurface().popupDisplayed()
|
||||
}
|
||||
|
||||
PopupBase.prototype.onPopupHidden = function(ev, link, popup) {
|
||||
$(popup).off('.inspector', 'form', this.proxy(this.onSubmit))
|
||||
this.popup = null
|
||||
|
||||
this.getRootSurface().popupHidden()
|
||||
}
|
||||
|
||||
PopupBase.prototype.onSubmit = function(ev) {
|
||||
ev.preventDefault()
|
||||
|
||||
if (this.handleSubmit($(ev.target)) === false) {
|
||||
return false
|
||||
}
|
||||
|
||||
this.setLinkText(this.getLink())
|
||||
this.hidePopup()
|
||||
return false
|
||||
}
|
||||
|
||||
$.wn.inspector.propertyEditors.popupBase = PopupBase
|
||||
}(window.jQuery);
|
||||
Reference in New Issue
Block a user