Skip to content

Commit

Permalink
show hidden invalid fields when submitting admin config form
Browse files Browse the repository at this point in the history
  • Loading branch information
ron4mac committed Jul 6, 2019
1 parent d80743a commit 571798e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Changelog
[S] = Security fix (issues that are related to security)
*********************************************

2019-07-06 [B] Show hidden invalid fields when submitting admin config form {ron4mac}
2019-06-05 [A] Updated Estonian language file (user contribution) {eenemeenemuu}
2019-04-17 [C] Added title to intermediate-sized image, changed alt attritube (thread ID 79654) {eenemeenemuu}
2019-03-28 [B] Correct regex for valid file name in showthumb.php {ron4mac}
Expand Down
16 changes: 12 additions & 4 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
*
* v1.0 originally written by Gregory Demar
*
* @copyright Copyright (c) 2003-2018 Coppermine Dev Team
* @copyright Copyright (c) 2003-2019 Coppermine Dev Team
* @license GNU General Public License version 3 or later; see LICENSE
*
* admin.php
* @since 1.6.06
* @since 1.6.07
*/

define('IN_COPPERMINE', true);
Expand Down Expand Up @@ -274,6 +274,14 @@ function kmgOpts ($m)
$admin_page .= '<br />'.$LINEBREAK;
}

$admin_page .= '<style>
#cpgform input:invalid {
border-color: #900;
background-color: #FDD;
}
</style>
';

$signature = 'Coppermine Photo Gallery ' . COPPERMINE_VERSION . ' ('. COPPERMINE_VERSION_STATUS . ')';

$tabindexCounter = 1;
Expand Down Expand Up @@ -647,7 +655,6 @@ function kmgOpts ($m)
endtable();
echo '<br />';


list($timestamp, $form_token) = getFormToken();
echo <<< EOT
<input type="hidden" name="form_token" value="{$form_token}" />
Expand All @@ -666,6 +673,7 @@ function kmgOpts ($m)
</script>
EOT;
}

pagefooter();

//EOF
//EOF
6 changes: 4 additions & 2 deletions js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
*
* v1.0 originally written by Gregory Demar
*
* @copyright Copyright (c) 2003-2018 Coppermine Dev Team
* @copyright Copyright (c) 2003-2019 Coppermine Dev Team
* @license GNU General Public License version 3 or later; see LICENSE
*
* js/admin.js
* @since 1.6.06
* @since 1.6.07
*/

function resetToDefault(theFieldId, fieldType, numberOfItems)
Expand Down Expand Up @@ -95,6 +95,8 @@ function thumbMethodUI (elm)

function adminPageLoaded(){

$("#cpgform input").on("invalid", function() { $(this).parents('.detail_body').show(); });

$('a.direct_config_link').click(function(){

var aname = $(this).attr('hash').replace('#', '');
Expand Down

0 comments on commit 571798e

Please sign in to comment.