(function ($, document, window) { var currentItem; function updateTabs(page, item) { var query = MetadataEditor.getEditQueryString(item); $('#btnEditMetadata', page).attr('href', 'edititemmetadata.html?' + query); $('#btnEditImages', page).attr('href', 'edititemimages.html?' + query); } function reload(page) { Dashboard.showLoadingMsg(); MetadataEditor.getItemPromise().done(function (item) { $('#btnRefresh', page).buttonEnabled(true); if (item.LocationType == "Offline") { $('#divAddPerson', page).hide(); } else { $('#divAddPerson', page).show(); } $('#refreshLoading', page).hide(); currentItem = item; LibraryBrowser.renderName(item, $('.itemName', page), true); updateTabs(page, item); fillPeopleContainer(item, item.People, $('#peopleContainer', page)); Dashboard.hideLoadingMsg(); }); } function fillPeopleContainer(item, people, container) { people = people || new Array(); var html = ''; for (var i = 0; i < people.length; i++) { html += constructPerson(item, people[i]); } container.html(html).trigger('create'); } function constructPerson(item, person) { var html = '
'; if (item.LocationType !== "Offline") { html += ''; html += ''; html += ''; } html += ' '; html += '
'; html += '