Add cover photo submitter, cover photo votes, and portal details to large portal display dialog.
This commit is contained in:
@ -23,6 +23,43 @@ window.getPortalDescriptionFromDetails = function(details) {
|
||||
return desc;
|
||||
}
|
||||
|
||||
// Grabs more info, including the submitter name for the current main
|
||||
// portal image
|
||||
window.getPortalDescriptionFromDetailsExtended = function(details) {
|
||||
var descObj = details.portalV2.descriptiveText;
|
||||
var photoStreamObj = details.photoStreamInfo;
|
||||
|
||||
var submitterObj = new Object();
|
||||
submitterObj.type = "";
|
||||
submitterObj.name = "Unknown";
|
||||
submitterObj.team = "";
|
||||
submitterObj.link = "";
|
||||
submitterObj.voteCount = 0;
|
||||
|
||||
if(photoStreamObj && photoStreamObj.hasOwnProperty("coverPhoto") && photoStreamObj.coverPhoto.hasOwnProperty("attributionMarkup")) {
|
||||
var attribution = photoStreamObj.coverPhoto.attributionMarkup;
|
||||
submitterObj.type = attribution[0];
|
||||
if(attribution[1].hasOwnProperty("plain"))
|
||||
submitterObj.name = attribution[1].plain;
|
||||
if(attribution[1].hasOwnProperty("team"))
|
||||
submitterObj.team = attribution[1].team;
|
||||
if(attribution[1].hasOwnProperty("attributionLink"))
|
||||
submitterObj.link = attribution[1].attributionLink;
|
||||
if(photoStreamObj.coverPhoto.hasOwnProperty("voteCount"))
|
||||
submitterObj.voteCount = photoStreamObj.coverPhoto.voteCount;
|
||||
}
|
||||
|
||||
|
||||
var portalDetails = {
|
||||
title: descObj.TITLE,
|
||||
description: descObj.DESCRIPTION,
|
||||
address: descObj.ADDRESS,
|
||||
submitter: submitterObj
|
||||
};
|
||||
|
||||
return portalDetails;
|
||||
}
|
||||
|
||||
|
||||
// given portal details, returns html code to display mod details.
|
||||
window.getModDetails = function(d) {
|
||||
|
Reference in New Issue
Block a user