From b3ff5b645be9a812725e7508988fbd176ae5c99b Mon Sep 17 00:00:00 2001 From: rjy7 Date: Mon, 12 Jul 2010 20:23:50 +0000 Subject: [PATCH] Move vivo src directory out of productMods directly under vivo. Previous location didn't build correctly. --- .../edit/forms/addPublicationToAuthor.jsp | 5 +- .../customFormWithAdvanceTypeSelection.css | 8 +++ .../js/addAuthorsToInformationResource.js | 5 +- .../js/customFormWithAdvanceTypeSelection.js | 63 +++++++++++-------- .../n3editing/PersonHasPositionValidator.java | 0 .../PersonHasPublicationValidator.java | 0 .../PublicationHasAuthorValidator.java | 0 7 files changed, 51 insertions(+), 30 deletions(-) rename {productMods/src => src}/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPositionValidator.java (100%) rename {productMods/src => src}/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPublicationValidator.java (100%) rename {productMods/src => src}/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PublicationHasAuthorValidator.java (100%) diff --git a/productMods/edit/forms/addPublicationToAuthor.jsp b/productMods/edit/forms/addPublicationToAuthor.jsp index 4c3ff7f3..d643b9ce 100644 --- a/productMods/edit/forms/addPublicationToAuthor.jsp +++ b/productMods/edit/forms/addPublicationToAuthor.jsp @@ -215,11 +215,12 @@ PREFIX core: <${vivoCore}> SELECT ?individual WHERE {<${subjectUri}> core:author

- + +

<%-- RY maybe make this a label and input field. See what looks best. --%> -

+

(Verify this match)

diff --git a/productMods/edit/forms/css/customFormWithAdvanceTypeSelection.css b/productMods/edit/forms/css/customFormWithAdvanceTypeSelection.css index de2b91b0..1d4495bd 100644 --- a/productMods/edit/forms/css/customFormWithAdvanceTypeSelection.css +++ b/productMods/edit/forms/css/customFormWithAdvanceTypeSelection.css @@ -15,3 +15,11 @@ float: none; margin-right: 1em; } + +.acSelection { + margin-top: 2em; +} + +.verifyMatch { + margin-left: .5em; +} diff --git a/productMods/edit/forms/js/addAuthorsToInformationResource.js b/productMods/edit/forms/js/addAuthorsToInformationResource.js index 57c5aca6..0102e1c9 100644 --- a/productMods/edit/forms/js/addAuthorsToInformationResource.js +++ b/productMods/edit/forms/js/addAuthorsToInformationResource.js @@ -225,17 +225,16 @@ var addAuthorForm = { } $.each(results, function() { if ($.inArray(this.uri, addAuthorForm.acFilter) == -1) { - console.log("adding " + this.label + " to filtered results"); + // console.log("adding " + this.label + " to filtered results"); filteredResults.push(this); } else { - console.log("filtering out " + this.label); + // console.log("filtering out " + this.label); } }); return filteredResults; }, - // Action taken after selecting an author from the autocomplete list showSelectedAuthor: function(ui) { diff --git a/productMods/edit/forms/js/customFormWithAdvanceTypeSelection.js b/productMods/edit/forms/js/customFormWithAdvanceTypeSelection.js index da3b6c31..b462d508 100644 --- a/productMods/edit/forms/js/customFormWithAdvanceTypeSelection.js +++ b/productMods/edit/forms/js/customFormWithAdvanceTypeSelection.js @@ -29,21 +29,25 @@ var customForm = { this.requiredLegend = $('#requiredLegend'); this.typeSelector = this.form.find('#typeSelector'); + // These are classed rather than id'd in case we want more than one autocomplete on a form. + // At that point we'll use ids to match them up with one another. + this.acSelector = this.form.find('.acSelector'); + this.acSelection = this.form.find('.acSelection'); + this.acSelectionInfo = this.form.find('.acSelectionInfo'); + this.acReceiver = this.form.find('.acReceiver'); + this.verifyMatch = this.form.find('.verifyMatch'); + this.verifyMatchBaseHref = this.verifyMatch.attr('href'); + this.acSelectorWrapper = this.acSelector.parent(); + // This is the label element for the field with name 'label' - this.labelFieldLabel = $('label[for=' + $('#label').attr('id') + ']'); + this.labelFieldLabel = $('label[for=' + $('#label').attr('id') + ']'); // Get this on page load, so we can prepend to it. We can't just prepend to the current label text, // because it may have already been modified for a previous selection. this.baseLabelText = this.labelFieldLabel.html(); this.or = $('span.or'); this.cancel = this.form.find('.cancel'); - - // These are classed rather than id'd in case we want more than one autocomplete on a form. - this.acSelector = this.form.find('.acSelector'); - this.acSelection = this.form.find('.acSelection'); - this.acSelectionInfo = this.form.find('.acSelectionInfo'); - this.acReceiver = this.form.find('.acReceiver'); - + }, // Set up the form on page load @@ -87,12 +91,12 @@ var customForm = { this.button.val('Create ' + this.baseButtonText); if( this.formSteps > 1 ){ - this.cancel.unbind('click'); - this.cancel.click(function() { - customForm.clearFormData(); // clear any input and validation errors - customForm.initFormTypeView(); - return false; - }); + this.cancel.unbind('click'); + this.cancel.click(function() { + customForm.clearFormData(); // clear any input and validation errors + customForm.initFormTypeView(); + return false; + }); } }, @@ -107,13 +111,19 @@ var customForm = { customForm.acType = typeVal; if (typeVal.length) { customForm.labelFieldLabel.html(customForm.getSelectedTypeName() + ' ' + customForm.baseLabelText); - customForm.initFormFullView(); + customForm.initFormFullView(); + customForm.hideFields(customForm.acSelection); } else { // If no selection, go back to type view. This prevents problems like trying to run autocomplete // or submitting form without a type selection. customForm.initFormTypeView(); } - }); + }); + + this.verifyMatch.click(function() { + Window.open($(this).attr('href'), 'verifyMatchWindow', 'width=640,height=640,scrollbars=yes,resizable=yes,status=yes,toolbar=no,menubar=no,location=no'); + return false; + }); }, initAutocomplete: function() { @@ -211,25 +221,28 @@ var customForm = { showAutocompleteSelection: function(ui) { - this.acSelector.hide(); + var uri = ui.item.uri; + + this.acSelectorWrapper.hide(); this.acSelector.attr('disabled', 'disabled'); this.acSelection.find('label').html('Selected ' + this.getSelectedTypeName() + ':'); this.acSelection.show(); - this.acReceiver.val(ui.item.uri); + this.acReceiver.val(uri); this.acSelectionInfo.html(ui.item.label); + this.verifyMatch.attr('href', this.verifyMatchBaseHref + uri); this.button.val('Add ' + this.baseButtonText); if( this.formSteps > 1){ - this.cancel.unbind('click'); - this.cancel.click(function() { - // TODO Check out cancel action for authors form. Need to undo/empty some of the stuff above. - //do we do it in the initfullview method, or here? - customForm.initFormFullView(); - return false; - }); + this.cancel.unbind('click'); + this.cancel.click(function() { + // TODO Check out cancel action for authors form. Need to undo/empty some of the stuff above. + //do we do it in the initfullview method, or here? + customForm.initFormFullView(); + return false; + }); } }, diff --git a/productMods/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPositionValidator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPositionValidator.java similarity index 100% rename from productMods/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPositionValidator.java rename to src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPositionValidator.java diff --git a/productMods/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPublicationValidator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPublicationValidator.java similarity index 100% rename from productMods/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPublicationValidator.java rename to src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPublicationValidator.java diff --git a/productMods/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PublicationHasAuthorValidator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PublicationHasAuthorValidator.java similarity index 100% rename from productMods/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PublicationHasAuthorValidator.java rename to src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PublicationHasAuthorValidator.java