diff --git a/productMods/templates/freemarker/edit/forms/addAuthorsToInformationResource.ftl b/productMods/templates/freemarker/edit/forms/addAuthorsToInformationResource.ftl index 8c0c608a..7599f287 100644 --- a/productMods/templates/freemarker/edit/forms/addAuthorsToInformationResource.ftl +++ b/productMods/templates/freemarker/edit/forms/addAuthorsToInformationResource.ftl @@ -100,7 +100,8 @@ or - Return to Publication + Return to Publication +
@@ -167,7 +168,8 @@ or - Cancel + Cancel +

* required fields

diff --git a/productMods/templates/freemarker/edit/forms/js/addAuthorsToInformationResource.js b/productMods/templates/freemarker/edit/forms/js/addAuthorsToInformationResource.js index 9ddf9dc8..71992350 100644 --- a/productMods/templates/freemarker/edit/forms/js/addAuthorsToInformationResource.js +++ b/productMods/templates/freemarker/edit/forms/js/addAuthorsToInformationResource.js @@ -72,6 +72,7 @@ var addAuthorForm = { this.selectedOrgName = $('span#selectedOrgName'); this.orgLink = $('a#orgLink'); this.personLink = $('a#personLink'); + this.returnLink = $('a#returnLink'); this.orgSection.hide(); }, @@ -618,11 +619,23 @@ var addAuthorForm = { var removeLast = false, message = 'Are you sure you want to remove this author:\n\n' + authorName + ' ?\n\n'; - if (!confirm(message)) { return false; } - + + if ( addAuthorForm.showFormButtonWrapper.is(':visible') ) { + addAuthorForm.returnLink.hide(); + $('img#indicatorOne').removeClass('hidden'); + addAuthorForm.showFormButton.addClass('disabledSubmit'); + addAuthorForm.showFormButton.attr('disabled','disabled'); + } + else { + addAuthorForm.cancel.hide(); + $('img#indicatorTwo').removeClass('hidden'); + addAuthorForm.submit.addClass('disabledSubmit'); + addAuthorForm.submit.attr('disabled','disabled'); + } + if ($(link)[0] === $('.remove:last')[0]) { removeLast = true; } @@ -671,15 +684,34 @@ var addAuthorForm = { if (numAuthors < 2) { addAuthorForm.disableAuthorDD(); } + + if ( $('img#indicatorOne').is(':visible') ) { + $('img#indicatorOne').fadeOut(100, function() { + $(this).addClass('hidden'); + }); + + addAuthorForm.returnLink.fadeIn(100, function() { + $(this).show(); + }); + addAuthorForm.showFormButton.removeClass('disabledSubmit'); + addAuthorForm.showFormButton.attr('disabled',''); + } + else { + $('img#indicatorTwo').fadeOut(100, function() { + $(this).addClass('hidden'); + }); + + addAuthorForm.cancel.fadeIn(100, function() { + $(this).show(); + }); + addAuthorForm.submit.removeClass('disabledSubmit'); + addAuthorForm.submit.attr('disabled',''); + } }); -// $(this).hide(); -// $(this).siblings('.undo').show(); -// author.html(authorName + ' has been removed'); -// author.css('width', 'auto'); -// author.effect('highlight', {}, 3000); } else { alert('Error processing request: author not removed'); + } } }); diff --git a/productMods/templates/freemarker/edit/forms/js/manageWebpagesForIndividual.js b/productMods/templates/freemarker/edit/forms/js/manageWebpagesForIndividual.js index 1eb73ba6..a8a881d7 100644 --- a/productMods/templates/freemarker/edit/forms/js/manageWebpagesForIndividual.js +++ b/productMods/templates/freemarker/edit/forms/js/manageWebpagesForIndividual.js @@ -160,6 +160,8 @@ var manageWebpages = { $('a#returnToIndividual').hide(); $('img#indicator').removeClass('hidden'); + $('a#showAddForm').addClass('disabledSubmit'); + $('a#showAddForm').attr('disabled', 'disabled'); if ($(link)[0] === $('.remove:last')[0]) { removeLast = true; @@ -200,15 +202,17 @@ var manageWebpages = { } $('img#indicator').fadeOut(100, function() { $(this).addClass('hidden'); - }) + }); $('a#returnToIndividual').fadeIn(100, function() { $(this).show(); }); + $('a#showAddForm').removeClass('disabledSubmit'); + $('a#showAddForm').attr('disabled', ''); }); } else { - alert('Error processing request: web page not removed'); + alert('Error processing request: web page not removed.'); } } }); diff --git a/productMods/templates/freemarker/edit/forms/manageWebpagesForIndividual.ftl b/productMods/templates/freemarker/edit/forms/manageWebpagesForIndividual.ftl index 0a09ad97..918b094d 100644 --- a/productMods/templates/freemarker/edit/forms/manageWebpagesForIndividual.ftl +++ b/productMods/templates/freemarker/edit/forms/manageWebpagesForIndividual.ftl @@ -59,7 +59,7 @@ Add New Web Page Return to Individual - +