From 2b770b2f58487aa8646b1008af7102e4c980d433 Mon Sep 17 00:00:00 2001 From: Emmanuel Papin Date: Sat, 16 May 2015 06:12:38 +0200 Subject: [PATCH] Add an error message if plugin option is not valid --- web/lang/big5_big5.php | 2 + web/lang/cn_zh.php | 2 + web/lang/cs_cz.php | 2 + web/lang/de_de.php | 2 + web/lang/dk_dk.php | 2 + web/lang/en_gb.php | 2 + web/lang/es_ar.php | 2 + web/lang/es_es.php | 2 + web/lang/et_ee.php | 2 + web/lang/fr_fr.php | 2 + web/lang/he_il.php | 2 + web/lang/hu_hu.php | 2 + web/lang/it_it.php | 2 + web/lang/ja_jp.php | 2 + web/lang/nl_nl.php | 2 + web/lang/pl_pl.php | 2 + web/lang/pt_br.php | 2 + web/lang/ro_ro.php | 2 + web/lang/ru_ru.php | 2 + web/lang/se_se.php | 2 + web/skins/classic/views/js/plugin.js | 56 ++++++++++++++---------- web/skins/classic/views/js/plugin.js.php | 2 + 22 files changed, 76 insertions(+), 22 deletions(-) diff --git a/web/lang/big5_big5.php b/web/lang/big5_big5.php index 8c7d51aa6..94bf7a851 100644 --- a/web/lang/big5_big5.php +++ b/web/lang/big5_big5.php @@ -227,6 +227,7 @@ $SLANG = array( 'Command' => 'Command', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'Config', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => '配置為', 'ConfirmDeleteEvents' => 'Are you sure you wish to delete the selected events?', 'ConfirmPassword' => '確認密碼', @@ -390,6 +391,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => '反轉', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Key String', 'Label' => 'Label', 'Language' => '語言', diff --git a/web/lang/cn_zh.php b/web/lang/cn_zh.php index 3ce2bb9e7..73a8669d0 100644 --- a/web/lang/cn_zh.php +++ b/web/lang/cn_zh.php @@ -223,6 +223,7 @@ $SLANG = array( 'Command' => '命令', 'Component' => 'Component', // Added - 2011-06-16 'Config' => '配置', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => '配置标的', 'ConfirmDeleteEvents' => '确认希望删除所选事件?', 'ConfirmPassword' => '密码确认', @@ -386,6 +387,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => '反向', 'Iris' => '光圈', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => '密钥字符', 'Label' => '标签', 'Language' => '语言', diff --git a/web/lang/cs_cz.php b/web/lang/cs_cz.php index 2488aba53..8022c5639 100644 --- a/web/lang/cs_cz.php +++ b/web/lang/cs_cz.php @@ -223,6 +223,7 @@ $SLANG = array( 'Command' => 'Pkaz', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'Nastaven', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'Nastaveno pro', 'ConfirmDeleteEvents' => 'Are you sure you wish to delete the selected events?', 'ConfirmPassword' => 'Potvrdit heslo', @@ -386,6 +387,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => 'Pevrcen', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Key String', 'Label' => 'Label', 'Language' => 'Jazyk', diff --git a/web/lang/de_de.php b/web/lang/de_de.php index 7841aea6c..994c5adf7 100644 --- a/web/lang/de_de.php +++ b/web/lang/de_de.php @@ -223,6 +223,7 @@ $SLANG = array( 'Command' => 'Kommando', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'Konfig.', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'Konfiguriert für', 'ConfirmDeleteEvents' => 'Sind Sie sicher, dass Sie die ausgewählten Ereignisse löschen wollen?', 'ConfirmPassword' => 'Passwortbestätigung', @@ -386,6 +387,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => 'Invertiert', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Schlüsselwort', 'Label' => 'Bezeichnung', 'Language' => 'Sprache', diff --git a/web/lang/dk_dk.php b/web/lang/dk_dk.php index aaa89f80d..d08ad0d72 100644 --- a/web/lang/dk_dk.php +++ b/web/lang/dk_dk.php @@ -224,6 +224,7 @@ $SLANG = array( 'Command' => 'Kommando', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'konfig', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'Konfigureret for', 'ConfirmDeleteEvents' => 'Are you sure you wish to delete the selected events?', 'ConfirmPassword' => 'Verifiser Password', @@ -387,6 +388,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => 'Inverteret', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Key String', 'Label' => 'Label', 'Language' => 'Sprog', diff --git a/web/lang/en_gb.php b/web/lang/en_gb.php index f74d36450..9078c3f17 100644 --- a/web/lang/en_gb.php +++ b/web/lang/en_gb.php @@ -230,6 +230,7 @@ $SLANG = array( 'Colour' => 'Colour', 'Command' => 'Command', 'Config' => 'Config', + 'ConfigError' => 'Config Error', 'ConfiguredFor' => 'Configured for', 'ConfirmDeleteEvents' => 'Are you sure you wish to delete the selected events?', 'ConfirmPassword' => 'Confirm Password', @@ -393,6 +394,7 @@ $SLANG = array( 'In' => 'In', 'Inverted' => 'Inverted', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', 'KeyString' => 'Key String', 'Label' => 'Label', 'Language' => 'Language', diff --git a/web/lang/es_ar.php b/web/lang/es_ar.php index 68a593f45..e0c8a2642 100644 --- a/web/lang/es_ar.php +++ b/web/lang/es_ar.php @@ -174,6 +174,7 @@ $SLANG = array( 'Command' => 'Command', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'Config.', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'Configurado Para', 'ConfirmDeleteEvents' => 'Are you sure you wish to delete the selected events?', 'ConfirmPassword' => 'Confirmar Contrasea', @@ -337,6 +338,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => 'Invertido', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Key String', 'Label' => 'Label', 'Language' => 'Lenguaje', diff --git a/web/lang/es_es.php b/web/lang/es_es.php index ed8c5935f..8a689bd8f 100644 --- a/web/lang/es_es.php +++ b/web/lang/es_es.php @@ -223,6 +223,7 @@ $SLANG = array( 'Command' => 'Comando', 'Component' => 'Componente', 'Config' => 'Config', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'Configurado para', 'ConfirmDeleteEvents' => '¿Seguro que desea borrar los eventos seleccionados?', 'ConfirmPassword' => 'Confirmar contraseña', @@ -386,6 +387,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => 'Invertido', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Cadena clave', 'Label' => 'Etiqueta', 'Language' => 'Idioma', diff --git a/web/lang/et_ee.php b/web/lang/et_ee.php index aa89ab260..00dfd4565 100644 --- a/web/lang/et_ee.php +++ b/web/lang/et_ee.php @@ -224,6 +224,7 @@ $SLANG = array( 'Command' => 'Käsk', 'Component' => 'Komponent', // Added - 2011-06-16 'Config' => 'Seadistus', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'Seadistatud', 'ConfirmDeleteEvents' => 'Oled sa kindel kustamaks valitud sündmused?', 'ConfirmPassword' => 'Kinnita salasõna', @@ -387,6 +388,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => 'Inverted', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Key String', 'Label' => 'Label', 'Language' => 'Keel', diff --git a/web/lang/fr_fr.php b/web/lang/fr_fr.php index 7b243e963..b844157aa 100644 --- a/web/lang/fr_fr.php +++ b/web/lang/fr_fr.php @@ -229,6 +229,7 @@ $SLANG = array( 'Command' => 'Commande', 'Component' => 'Composant', // Added - 2011-06-16 'Config' => 'Config', + 'ConfigError' => 'Erreur de configuration', // Added - 2015-05-16 'ConfiguredFor' => 'Configuré pour', 'ConfirmDeleteEvents' => 'Etes-vous sûr de vouloir effacer le(s) événement(s) sélectionné(s)?', 'ConfirmPassword' => 'Répéter mot de passe', @@ -392,6 +393,7 @@ $SLANG = array( 'IncludeNatDet' => 'Inclure détection native', // Added - 2015-05-06 'Inverted' => 'Inversé', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'n\'est pas une option valide', // Added - 2015-05-16 'KeyString' => 'Chaîne clé', 'Label' => 'Etiquette', 'Language' => 'Langue', diff --git a/web/lang/he_il.php b/web/lang/he_il.php index 4595be865..9daa9cce3 100644 --- a/web/lang/he_il.php +++ b/web/lang/he_il.php @@ -223,6 +223,7 @@ $SLANG = array( 'Command' => '', 'Component' => 'Component', // Added - 2011-06-16 'Config' => '', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => ' ', 'ConfirmDeleteEvents' => 'Are you sure you wish to delete the selected events?', 'ConfirmPassword' => ' ', @@ -386,6 +387,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => '', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => ' ', 'Label' => '', 'Language' => '', diff --git a/web/lang/hu_hu.php b/web/lang/hu_hu.php index f6be9e319..d340061f8 100644 --- a/web/lang/hu_hu.php +++ b/web/lang/hu_hu.php @@ -266,6 +266,7 @@ $SLANG = array( 'Command' => 'Parancs', 'Component' => 'Komponens', 'Config' => 'Beállítás', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'Beállítva', 'ConfirmDeleteEvents' => 'Biztos benne, hogy törli a kiválasztott eseményeket?', 'ConfirmPassword' => 'Jelszó megerősítés', @@ -429,6 +430,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => 'Invertálva', 'Iris' => 'Írisz', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Kulcs karaktersor', 'Label' => 'Cimke', 'Language' => 'Nyelv', diff --git a/web/lang/it_it.php b/web/lang/it_it.php index a64c5ee29..10b86ee3d 100644 --- a/web/lang/it_it.php +++ b/web/lang/it_it.php @@ -228,6 +228,7 @@ $SLANG = array( 'Command' => 'Comando', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'Configura', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'Configurato per', 'ConfirmDeleteEvents' => 'Sei sicuro di voler cancellare gli eventi selezionati', 'ConfirmPassword' => 'Conferma Password', @@ -391,6 +392,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => 'Invertito', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Stringa Chiave', 'Label' => 'Etichetta', 'Language' => 'Linguaggio', diff --git a/web/lang/ja_jp.php b/web/lang/ja_jp.php index 9f2320f16..97f27ef8e 100644 --- a/web/lang/ja_jp.php +++ b/web/lang/ja_jp.php @@ -223,6 +223,7 @@ $SLANG = array( 'Command' => 'Command', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'Config', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'ݒ:', 'ConfirmDeleteEvents' => 'Are you sure you wish to delete the selected events?', 'ConfirmPassword' => '߽ܰނ̊mF', @@ -386,6 +387,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => ']', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Key String', 'Label' => 'Label', 'Language' => '', diff --git a/web/lang/nl_nl.php b/web/lang/nl_nl.php index ec3c1169f..5e91c43db 100644 --- a/web/lang/nl_nl.php +++ b/web/lang/nl_nl.php @@ -223,6 +223,7 @@ $SLANG = array( 'Command' => 'Commando', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'Configuratie', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'Geconfigureerd voor', 'ConfirmDeleteEvents' => 'Weet uw zeker dat uw deze gebeurtenissen wil verwijderen?', 'ConfirmPassword' => 'Bevestig wachtwoord', @@ -386,6 +387,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => 'Omgedraaid', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Sleutel waarde', 'Label' => 'Label', 'Language' => 'Taal', diff --git a/web/lang/pl_pl.php b/web/lang/pl_pl.php index 8a04b8288..d3991531e 100644 --- a/web/lang/pl_pl.php +++ b/web/lang/pl_pl.php @@ -223,6 +223,7 @@ $SLANG = array( 'Command' => 'Command', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'Konfiguracja', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'Ustawiona', 'ConfirmDeleteEvents' => 'Are you sure you wish to delete the selected events?', 'ConfirmPassword' => 'Potwierd haso', @@ -386,6 +387,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => 'Odwrcony', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Key String', 'Label' => 'Label', 'Language' => 'Jzyk', diff --git a/web/lang/pt_br.php b/web/lang/pt_br.php index 00a8ad499..7d7506831 100644 --- a/web/lang/pt_br.php +++ b/web/lang/pt_br.php @@ -163,6 +163,7 @@ $SLANG = array( 'Command' => 'Command', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'Config', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'Configurado para', 'ConfirmDeleteEvents' => 'Are you sure you wish to delete the selected events?', 'ConfirmPassword' => 'Confirmar Senha', @@ -326,6 +327,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => 'Invertido', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Key String', 'Label' => 'Label', 'Language' => 'Linguagem', diff --git a/web/lang/ro_ro.php b/web/lang/ro_ro.php index 1d8e7a237..8a047554b 100644 --- a/web/lang/ro_ro.php +++ b/web/lang/ro_ro.php @@ -194,6 +194,7 @@ $SLANG = array( 'Command' => 'Comanda', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'Config', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'Configurat pentru', 'ConfirmDeleteEvents' => 'Are you sure you wish to delete the selected events?', 'ConfirmPassword' => 'Confirm parola', @@ -357,6 +358,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => 'Inversă', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Key String', 'Label' => 'Label', 'Language' => 'Limbă', diff --git a/web/lang/ru_ru.php b/web/lang/ru_ru.php index aca9c4b82..6e233c573 100644 --- a/web/lang/ru_ru.php +++ b/web/lang/ru_ru.php @@ -223,6 +223,7 @@ $SLANG = array( 'Command' => 'Command', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'Config', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => ' ', 'ConfirmDeleteEvents' => 'Are you sure you wish to delete the selected events?', 'ConfirmPassword' => ' ', @@ -386,6 +387,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => '', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Key String', 'Label' => 'Label', 'Language' => '', diff --git a/web/lang/se_se.php b/web/lang/se_se.php index d95b251f3..ab3417a7f 100644 --- a/web/lang/se_se.php +++ b/web/lang/se_se.php @@ -224,6 +224,7 @@ $SLANG = array( 'Command' => 'Kommando', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'Konfigurera', + 'ConfigError' => 'Config Error', // Added - 2015-05-16 'ConfiguredFor' => 'Konfigurerad fr', 'ConfirmDeleteEvents' => 'r du sker p att du vill ta bort dom valda hndelserna?', 'ConfirmPassword' => 'Bekrfta lsenord', @@ -387,6 +388,7 @@ $SLANG = array( 'IncludeNatDet' => 'Include Native Detection', // Added - 2015-05-06 'Inverted' => 'Inverterad', 'Iris' => 'Iris', + 'IsNotAValidOption' => 'is not a valid option', // Added - 2015-05-16 'KeyString' => 'Nyckelstrng', 'Label' => 'Etikett', 'Language' => 'Sprk', diff --git a/web/skins/classic/views/js/plugin.js b/web/skins/classic/views/js/plugin.js index a3bccfa97..af0d7b007 100644 --- a/web/skins/classic/views/js/plugin.js +++ b/web/skins/classic/views/js/plugin.js @@ -9,9 +9,9 @@ function addOption( name ) return; } // Raise an error and exit of non alphanumeric characters in string - if ( !str.match(/^[0-9a-zA-Z]+$/) ) + if ( !str.match( /^[0-9a-zA-Z]+$/ ) ) { - alert(onlyAlphaCharString); + alert( onlyAlphaCharString ); return; } var hidden = form.elements['pluginOpt[' + name + ']']; @@ -19,11 +19,11 @@ function addOption( name ) var list = hidden.value.split( "," ); if ( list.indexOf( str ) != -1 ) { - alert(alreadyInList); + alert( alreadyInList ); return; } // Add option to the list - select.options[select.options.length] = new Option(str, str); + select.options[select.options.length] = new Option( str, str ); // Synchronize hidden field if ( hidden.value.length > 0 ) { @@ -43,7 +43,7 @@ function removeOptionSelected( name ) { if ( select.options[i].selected ) { - select.remove(i); + select.remove( i ); } } // Synchronize hidden field @@ -68,7 +68,7 @@ function updateAddBtn( name ) { var form = document.pluginForm; // Disable add button if the text input is empty - if ( form.elements['dsp_input_pluginOpt[' + name + ']'].value === "") + if ( form.elements['dsp_input_pluginOpt[' + name + ']'].value === "" ) { form.elements['addBtn[' + name + ']'].disabled = true; } @@ -102,6 +102,7 @@ function saveChanges( element ) function applyChanges() { var form = document.pluginForm; + var errorMsg = ""; // Synchronize hidden fields for ( var option in pluginOptionList ) { @@ -131,23 +132,30 @@ function applyChanges() for ( var name in pluginOptionList[option] ) { //console.log("form.elements['pluginOpt[" + name + "]'].value=" + form.elements['pluginOpt[' + name + ']'].value + " pluginOptionList[" + option + "][" + name + "]=" + pluginOptionList[option][name]); - if (form.elements['pluginOpt[' + name + ']'].value != pluginOptionList[option][name]) + if ( typeof form.elements['pluginOpt[' + name + ']'] !== "undefined" ) { - form.elements['dsp_pluginOpt[' + option + ']'].disabled = true; - // Handle additionnal controls for list option - if ( typeof form.elements['dsp_input_pluginOpt[' + option + ']'] !== "undefined" ) + if ( form.elements['pluginOpt[' + name + ']'].value != pluginOptionList[option][name] ) { - form.elements['dsp_input_pluginOpt[' + option + ']'].disabled = true; - form.elements['dsp_input_pluginOpt[' + option + ']'].value = ""; - form.elements['addBtn[' + option + ']'].disabled = true; - form.elements['removeBtn[' + option + ']'].disabled = true; + form.elements['dsp_pluginOpt[' + option + ']'].disabled = true; + // Handle additionnal controls for list option + if ( typeof form.elements['dsp_input_pluginOpt[' + option + ']'] !== "undefined" ) + { + form.elements['dsp_input_pluginOpt[' + option + ']'].disabled = true; + form.elements['dsp_input_pluginOpt[' + option + ']'].value = ""; + form.elements['addBtn[' + option + ']'].disabled = true; + form.elements['removeBtn[' + option + ']'].disabled = true; + } + enabled = false; + break; } - enabled = false; - break; + } + else + { + errorMsg += "'" + name + "' " + isNotAValidOption + "\n"; } } // Enable visible field if all dependencies are ok - if (enabled) + if ( enabled ) { form.elements['dsp_pluginOpt[' + option + ']'].disabled = false; // Handle additionnal controls for list option @@ -161,26 +169,30 @@ function applyChanges() } } } + if ( errorMsg.length !== 0 ) + { + alert( configError + "\n" + errorMsg ); + } } function limitRange( field, minValue, maxValue ) { var intval; - if ( +field.value === parseInt(field.value) ) + if ( +field.value === parseInt( field.value ) ) { - intval = parseInt(field.value); + intval = parseInt( field.value ); } else { - alert(onlyIntegerString); + alert( onlyIntegerString ); field.value = field.defaultValue; return; } - if ( intval < parseInt(minValue) ) + if ( intval < parseInt( minValue ) ) { field.value = minValue; } - else if ( intval > parseInt(maxValue) ) + else if ( intval > parseInt( maxValue ) ) { field.value = maxValue; } diff --git a/web/skins/classic/views/js/plugin.js.php b/web/skins/classic/views/js/plugin.js.php index 0b8f2dbc0..758226328 100644 --- a/web/skins/classic/views/js/plugin.js.php +++ b/web/skins/classic/views/js/plugin.js.php @@ -18,4 +18,6 @@ pluginOptionList[''][''] = var onlyAlphaCharString = ''; var alreadyInList = ''; +var configError = ''; +var isNotAValidOption = ''; var onlyIntegerString = '';