--- /dev/null
+Ext.ns("EntSavoie.CasManager");
+EntSavoie.CasManager.TestUrlWindow = function (config) {
+
+ Ext.apply(this, config);
+
+ // Ajoute le texte des erreurs
+ Ext.QuickTips.init();
+ // turn on validation errors beside the field globally
+ Ext.form.Field.prototype.msgTarget = 'side';
+
+ this.urlField = this.urlField || new Ext.form.TextField({
+ name: "Url à tester",
+ emptyText: "Url à tester",
+ style: 'margin-left: 5px; margin-right:5px; margin-top:5px; margin-bottom:5px;',
+ width: 350,
+ allowBlank: false,
+ border: false
+ });
+
+ this.testUrlButton = this.testUrlButton || new Ext.Button({
+ tooltip: "Tester l'URL",
+ text: "Tester l'URL",
+ style: 'margin-left: 5px; margin-right:5px; margin-top:5px; margin-bottom:5px;',
+ handler: this.onTestUrl,
+ scope: this
+ });
+
+ this.deleteAttributButton = this.deleteAttributButton || new Ext.Button({
+ tooltip: "Supprimer un attribut",
+ width: 16,
+ iconCls: 'delete',
+ handler: this.onDeleteAttribut,
+ scope: this
+ });
+
+ this.responseUrlLabel = this.responseUrlLabel || new Ext.form.Label({
+ style: 'margin-left: 5px; margin-right:5px; margin-top:5px; margin-bottom:5px;',
+ });
+
+ EntSavoie.CasManager.TestUrlWindow.superclass.constructor.call(this, {
+ cls: "casManager-portlet",
+ title: "Tester l'URL pour l'expression régulière : " + this.regEx,
+ border: true,
+ layout: 'table',
+ modal: true,
+ resizable: false,
+ layoutConfig: {
+ columns: 4
+ },
+ items: [
+ this.urlField,
+ this.testUrlButton,
+ this.responseUrlLabel
+ ]
+ });
+
+};
+
+
+Ext.extend(EntSavoie.CasManager.TestUrlWindow, Ext.Window, {
+
+ initComponent: function () {
+ EntSavoie.CasManager.TestUrlWindow.superclass.initComponent.call(this);
+ },
+
+ onTestUrl: function(response, options) {
+ var reg = new RegExp(this.regEx);
+ if (reg.test(this.urlField.getValue())) {
+ this.responseUrlLabel.setText("Correct");
+ } else {
+ this.responseUrlLabel.setText("Incorrect");
+ }
+ }
+
+});
\ No newline at end of file