authorship removal VIVO-891 and allowed concept classes being passed as array instead of hardcoded
This commit is contained in:
parent
a35e3fb4f5
commit
4ad8b4b417
2 changed files with 10 additions and 9 deletions
|
@ -53,7 +53,8 @@
|
||||||
editMode: 'add',
|
editMode: 'add',
|
||||||
typeName: 'Concept',
|
typeName: 'Concept',
|
||||||
defaultTypeName: 'concept', // used in repair mode to generate button text
|
defaultTypeName: 'concept', // used in repair mode to generate button text
|
||||||
baseHref: '${urls.base}/individual?uri='
|
baseHref: '${urls.base}/individual?uri=',
|
||||||
|
limitToConceptClasses:["http://www.w3.org/2004/02/skos/core#Concept"]
|
||||||
};
|
};
|
||||||
var i18nStrings = {
|
var i18nStrings = {
|
||||||
selectAnExisting: '${i18n().select_an_existing}',
|
selectAnExisting: '${i18n().select_an_existing}',
|
||||||
|
|
|
@ -113,7 +113,7 @@ var addAuthorForm = {
|
||||||
// after hitting 'cancel.'
|
// after hitting 'cancel.'
|
||||||
initAuthorListOnlyView: function() {
|
initAuthorListOnlyView: function() {
|
||||||
|
|
||||||
if ($('.authorship').length) { // make sure we have at least one author
|
if ($('li.authorship').length) { // make sure we have at least one author
|
||||||
// Reorder authors on page load so that previously unranked authors get a rank. Otherwise,
|
// Reorder authors on page load so that previously unranked authors get a rank. Otherwise,
|
||||||
// when we add a new author, it will get put ahead of any previously unranked authors, instead
|
// when we add a new author, it will get put ahead of any previously unranked authors, instead
|
||||||
// of at the end of the list. (It is also helpful to normalize the data before we get started.)
|
// of at the end of the list. (It is also helpful to normalize the data before we get started.)
|
||||||
|
@ -282,7 +282,7 @@ var addAuthorForm = {
|
||||||
setAcFilter: function() {
|
setAcFilter: function() {
|
||||||
this.acFilter = [];
|
this.acFilter = [];
|
||||||
|
|
||||||
$('.authorship').each(function() {
|
$('li.authorship').each(function() {
|
||||||
var uri = $(this).data('authorUri');
|
var uri = $(this).data('authorUri');
|
||||||
addAuthorForm.acFilter.push(uri);
|
addAuthorForm.acFilter.push(uri);
|
||||||
});
|
});
|
||||||
|
@ -404,7 +404,7 @@ var addAuthorForm = {
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
success: function(data, status, request) {
|
success: function(data, status, request) {
|
||||||
var pos;
|
var pos;
|
||||||
$('.authorship').each(function(index){
|
$('li.authorship').each(function(index){
|
||||||
pos = index + 1;
|
pos = index + 1;
|
||||||
// Set the new position for this element. The only function of this value
|
// Set the new position for this element. The only function of this value
|
||||||
// is so we can reset an element to its original position in case reordering fails.
|
// is so we can reset an element to its original position in case reordering fails.
|
||||||
|
@ -440,7 +440,7 @@ var addAuthorForm = {
|
||||||
// have to keep retrieving data from or modifying the DOM as we manipulate the
|
// have to keep retrieving data from or modifying the DOM as we manipulate the
|
||||||
// authorships.
|
// authorships.
|
||||||
initAuthorshipData: function() {
|
initAuthorshipData: function() {
|
||||||
$('.authorship').each(function(index) {
|
$('li.authorship').each(function(index) {
|
||||||
$(this).data(authorshipData[index]);
|
$(this).data(authorshipData[index]);
|
||||||
|
|
||||||
// RY We might still need position to put back an element after reordering
|
// RY We might still need position to put back an element after reordering
|
||||||
|
@ -462,7 +462,7 @@ var addAuthorForm = {
|
||||||
findAuthorship: function(key, value) {
|
findAuthorship: function(key, value) {
|
||||||
var matchingAuthorship = $(); // if we don't find one, return an empty jQuery set
|
var matchingAuthorship = $(); // if we don't find one, return an empty jQuery set
|
||||||
|
|
||||||
$('.authorship').each(function() {
|
$('li.authorship').each(function() {
|
||||||
var authorship = $(this);
|
var authorship = $(this);
|
||||||
if ( authorship.data(key) === value ) {
|
if ( authorship.data(key) === value ) {
|
||||||
matchingAuthorship = authorship;
|
matchingAuthorship = authorship;
|
||||||
|
@ -644,7 +644,7 @@ var addAuthorForm = {
|
||||||
url: $(link).attr('href'),
|
url: $(link).attr('href'),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: {
|
data: {
|
||||||
deletion: $(link).parents('.authorship').data('authorshipUri')
|
deletion: $(link).parents('li.authorship').data('authorshipUri')
|
||||||
},
|
},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
context: link, // context for callback
|
context: link, // context for callback
|
||||||
|
@ -654,7 +654,7 @@ var addAuthorForm = {
|
||||||
|
|
||||||
if (status === 'success') {
|
if (status === 'success') {
|
||||||
|
|
||||||
authorship = $(this).parents('.authorship');
|
authorship = $(this).parents('li.authorship');
|
||||||
|
|
||||||
// Clear autocomplete cache entries matching this author's name, else
|
// Clear autocomplete cache entries matching this author's name, else
|
||||||
// autocomplete will be retrieved from the cache, which excludes the removed author.
|
// autocomplete will be retrieved from the cache, which excludes the removed author.
|
||||||
|
@ -673,7 +673,7 @@ var addAuthorForm = {
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
|
|
||||||
// Actions that depend on the author having been removed from the DOM:
|
// Actions that depend on the author having been removed from the DOM:
|
||||||
numAuthors = $('.authorship').length; // retrieve the length after removing authorship from the DOM
|
numAuthors = $('li.authorship').length; // retrieve the length after removing authorship from the DOM
|
||||||
|
|
||||||
// If removed item not last, reorder to remove any gaps
|
// If removed item not last, reorder to remove any gaps
|
||||||
if (numAuthors > 0 && ! removeLast) {
|
if (numAuthors > 0 && ! removeLast) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue