]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - src/Toolkit.js
edit: fix comment typos
[proxmox-widget-toolkit.git] / src / Toolkit.js
index 30dffc22191a81d3d2f1864c52eea6ad8938756e..3d0eefcfbf6512eda18364a59668721f1a8cb6b1 100644 (file)
@@ -126,6 +126,11 @@ Ext.apply(Ext.form.field.VTypes, {
     },
     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);
@@ -190,6 +195,16 @@ Ext.define('PVE.form.field.Number', {
     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', {
@@ -393,13 +408,6 @@ Ext.define(null, {
     },
 });
 
-// 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.
@@ -671,9 +679,6 @@ Ext.define('Proxmox.selection.CheckboxModel', {
     },
 });
 
-// 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',