},
DnsNameText: gettext('This is not a valid DNS name'),
+ DnsNameOrWildcard: function(v) {
+ return Proxmox.Utils.DnsName_or_Wildcard_match.test(v);
+ },
+ DnsNameOrWildcardText: gettext('This is not a valid DNS name'),
+
// workaround for https://www.sencha.com/forum/showthread.php?302150
proxmoxMail: function(v) {
return (/^(\w+)([-+.][\w]+)*@(\w[-\w]*\.){1,5}([A-Za-z]){2,63}$/).test(v);
submitLocaleSeparator: false,
});
+// avois spamming the console and if we ever use this avoid a CORS block error too
+Ext.define('PVE.draw.Container', {
+ override: 'Ext.draw.Container',
+ defaultDownloadServerUrl: document.location.origin, // avoid that pointing to http://svg.sencha.io
+ applyDownloadServerUrl: function(url) { // avoid noisy warning, we don't really use that anyway
+ url = url || this.defaultDownloadServerUrl;
+ return url;
+ },
+});
+
// ExtJs 5-6 has an issue with caching
// see https://www.sencha.com/forum/showthread.php?308989
Ext.define('Proxmox.UnderlayPool', {
},
});
-// 'Enter' in Textareas and aria multiline fields should not activate the
-// defaultbutton, fixed in extjs 6.0.2
-Ext.define('PVE.panel.Panel', {
- override: 'Ext.panel.Panel',
-
- fireDefaultButton: function(e) {
- if (e.target.getAttribute('aria-multiline') === 'true' ||
- e.target.tagName === "TEXTAREA") {
- return true;
- }
- return this.callParent(arguments);
- },
-});
-
// if the order of the values are not the same in originalValue and value
// extjs will not overwrite value, but marks the field dirty and thus
// the reset button will be enabled (but clicking it changes nothing)
navModel.setPosition();
}
- // Do not leave the element in tht state in case refresh fails, and restoration
+ // Do not leave the element in that state in case refresh fails, and restoration
// closure not called.
activeElement.resumeFocusEvents();
},
});
-// should be fixed with ExtJS 6.0.2, see:
-// https://www.sencha.com/forum/showthread.php?307244-Bug-with-datefield-in-window-with-scroll
-Ext.define('Proxmox.Datepicker', {
- override: 'Ext.picker.Date',
- hideMode: 'visibility',
-});
-
// ExtJS 6.0.1 has no setSubmitValue() (although you find it in the docs).
// Note: this.submitValue is a boolean flag, whereas getSubmitValue() returns
// data to be submitted.
// extj 6.7 reversed mousewheel direction... (fixed in 7.3)
// https://forum.sencha.com/forum/showthread.php?472517-Mousewheel-scroll-direction-in-numberfield-with-spinners
-// alse use the 'wheel' event instead of 'mousewheel' (fixed in 7.3)
+// also use the 'wheel' event instead of 'mousewheel' (fixed in 7.3)
Ext.define('Proxmox.form.field.Spinner', {
override: 'Ext.form.field.Spinner',
},
});
-// override the download server url globally, for privacy reasons
-Ext.draw.Container.prototype.defaultDownloadServerUrl = "-";
-
// stop nulling of properties
Ext.define('Proxmox.Component', {
override: 'Ext.Component',
clearPropertiesOnDestroy: false,
});
+// Fix drag&drop for vms and desktops that detect 'pen' pointerType
+// NOTE: this part has been rewritten in ExtJS 7.4, so re-check once we can upgrade
+Ext.define('Proxmox.view.DragZone', {
+ override: 'Ext.view.DragZone',
+
+ onItemMouseDown: function(view, record, item, index, e) {
+ // Ignore touchstart.
+ // For touch events, we use longpress.
+ if (e.pointerType !== 'touch') {
+ this.onTriggerGesture(view, record, item, index, e);
+ }
+ },
+});
+
// force alert boxes to be rendered with an Error Icon
// since Ext.Msg is an object and not a prototype, we need to override it
// after the framework has been initiated