GupShup.html.dynamic.groupOwnerDetails = {};
GupShup.html.dynamic.groupOwnerDetails.vars = {};
GupShup.html.dynamic.groupOwnerDetails.vars.entityDetails = {};
GupShup.html.dynamic.groupOwnerDetails.vars.webarooUserDetails = {};
GupShup.html.dynamic.groupOwnerDetails.vars.loggedInUserId = -1;
GupShup.html.dynamic.groupOwnerDetails.vars.groupOwnerUserId = -1;
GupShup.html.dynamic.groupOwnerDetails.methods = {};
GupShup.html.dynamic.groupOwnerDetails.methods = {
updateForEntityDetails : function (htmlContent)
{
var status = false;
var entityDetails = GupShup.html.dynamic.groupOwnerDetails.vars.entityDetails;
if((typeof(entityDetails) == 'object') && (typeof(entityDetails.status) != 'undefined') && (entityDetails.status == 'SUCCESS'))
{
var map = [{key:'$ENTITY_NAME$', dataMember: 'name'}];
htmlContent.content = GupShup.util.expandTemplate(htmlContent.content, map, entityDetails.info);
status = true;
}
return status;
},
updateForWebarooUserDetails : function(htmlContent)
{
var status = false;
var webarooUserDetails = GupShup.html.dynamic.groupOwnerDetails.vars.webarooUserDetails;
if((typeof(webarooUserDetails) == 'object') && (typeof(webarooUserDetails.status) != 'undefined') && (webarooUserDetails.status == 'SUCCESS'))
{
if(GupShup.util.trim(webarooUserDetails.info[0].profileName) == "")
{
webarooUserDetails.info[0].profileName = 'anonymous';
}
var map =
[
{key:'http://resource2.smsgupshup.com/webimages/$WEBAROO_USER_IMG_SRC$.jpg', dataMember: 'imageUrl'},
{key:'$PROFILE_NAME$', dataMember: 'profileName'},
{key:'$USER_AGE$', dataMember: 'age'},
{key:'$USER_ID$', dataMember: 'id'}
];
htmlContent.content = GupShup.util.expandTemplate(htmlContent.content, map, webarooUserDetails.info);
GupShup.html.dynamic.groupOwnerDetails.vars.groupOwnerUserId = webarooUserDetails.info[0].id;
status = true;
}
return status;
},
updateDetails : function()
{
var innerHTML = GupShup.util.getInnerHTML('groupOwnerDetailsJsp_webarooUserDetailsTemplate_RIGHT');
var htmlContent = {'content': innerHTML};
var entityDetails = GupShup.html.dynamic.groupOwnerDetails.vars.entityDetails;
var webarooUserDetails = GupShup.html.dynamic.groupOwnerDetails.vars.webarooUserDetails;
if(GupShup.html.dynamic.groupOwnerDetails.methods.updateForEntityDetails(htmlContent, entityDetails)
&& GupShup.html.dynamic.groupOwnerDetails.methods.updateForWebarooUserDetails(htmlContent, webarooUserDetails))
{
GupShup.util.setInnerHTML('groupOwnerDetailsJsp_webarooUserDetailsContainerRIGHT', htmlContent.content);
var ageId = 'groupOwnerDetailsJsp_AgeDiv_RIGHT_' + webarooUserDetails.info[0].id;
if(webarooUserDetails.info[0].displayAge && (webarooUserDetails.info[0].age > 0))
GupShup.html.util.showElement(ageId);
else
GupShup.html.util.hideElement(ageId);
/* Check if we have a valid logged in user and the current group owner is same as the logged in user. */
var sendMessageDivId = 'sendMessageDiv_' + GupShup.html.dynamic.groupOwnerDetails.vars.groupOwnerUserId;
if ((GupShup.html.dynamic.groupOwnerDetails.vars.groupOwnerUserId > 0)
&& (GupShup.html.dynamic.groupOwnerDetails.vars.groupOwnerUserId == GupShup.html.dynamic.groupOwnerDetails.vars.loggedInUserId))
{
GupShup.html.util.hideElement(sendMessageDivId);
}
else
{
GupShup.html.util.showElement(sendMessageDivId);
}
GupShup.html.util.showElement('groupOwnerDetailsJsp_webarooUserDetailsContainerRIGHT');
}
else
{
GupShup.html.util.hideElement('groupOwnerDetailsJsp_webarooUserDetailsContainerRIGHT');
}
},
initPage : function()
{
var webarooUserDetailsJSONStr = '{"info":[{"gender":"MALE","age":41,"imageUrl":"http://resource2.smsgupshup.com/webimages/profile/0/215/215876_1214368623604.png","profileName":"Om Malik","displayAge":true,"description":"Om Malik is the founder and senior writer for GigaOm. Before launching his own publishing venture, Om was a senior writer for Business 2.0 magazine covering telecom and broadband stories. ","location":"San Francisco Bay Area","id":215876}],"params":{"limit":-1,"start":0,"type":"USER_INFO","infoType":"WEBAROOUSER","needTotalForPg":true,"entityId":"3814931"},"message":"","totalForPg":1,"status":"SUCCESS","errorCode":"NO_ERROR"}';
var entityDetailsJsonStr = '{"info":[{"isDefault":"false","totalSubscribers":481,"totalPosts":694,"imageUrl":"http://resource.smsgupshup.com/webimages/entity/3/814/3814931_1214343691926.png","userId":3814955,"isPrivate":false,"description":"Giga Omni Media network of sites provide one of the leading daily online news reads for the key influencers in the emerging technology market place. ","groupUrl":"http://www.smsgupshup.com/groups/GigaOM","name":"GigaOM","isPartner":false,"id":3814931,"orgName":"GigaOM"}],"params":{"limit":-1,"start":0,"type":"USER_INFO","infoType":"SMSENTITY","needTotalForPg":true,"entityId":"3814931"},"message":"","totalForPg":1,"status":"SUCCESS","errorCode":"NO_ERROR"}';
GupShup.html.dynamic.groupOwnerDetails.vars.entityDetails = GupShup.util.getJsonFromResponse(entityDetailsJsonStr);
GupShup.html.dynamic.groupOwnerDetails.vars.webarooUserDetails = GupShup.util.getJsonFromResponse(webarooUserDetailsJSONStr);
GupShup.html.dynamic.groupOwnerDetails.methods.updateDetails();
}
};
try
{
GupShup.html.dynamic.groupOwnerDetails.methods.initPage();
}
catch(error)
{
if (GupShup.conf.jsDebug)
alert('Could not process groupOwnerDetailsJsp dynamic module : error-' + error);
}
function favGroupsJsp_process()
{
var favGroupsJSONStr = '{"subscriptions":[],"userDetails":{"globalUserId":215876,"name":"Om Malik","id":3814955},"params":{"limit":5,"start":0,"type":"MY_FAV_SUBSCRIPTIONS","userId":"3814955","showLatestMsg":"false","needTotalForPg":false,"showAll":false},"message":"","webarooUserDetails":{"gender":"MALE","age":41,"imageUrl":"http://resource2.smsgupshup.com/webimages/profile/0/215/215876_1214368623604.png","profileName":"Om Malik","displayAge":true,"description":"Om Malik is the founder and senior writer for GigaOm. Before launching his own publishing venture, Om was a senior writer for Business 2.0 magazine covering telecom and broadband stories. ","location":"San Francisco Bay Area","id":215876},"status":"SUCCESS","errorCode":"NO_ERROR"}';
if (GupShup.util.isInitialized(GupShup.conf.currentModule))
{
if (GupShup.util.trim(GupShup.conf.currentModule.refreshUrl) == '')
{
GupShup.conf.currentModule.refreshUrl
= GupShup.conf.readUrl + "&type=" + 'MY_FAV_SUBSCRIPTIONS'
+ '&userId=3814955' + '&showAll=false' + '&showLatestMsg=false'
+ '&start=0' + '&limit=' + '5' + '&needTotalForPg=false';
}
else
{
favGroupsJSONStr = GupShup.conf.currentModule.refreshArgs;
}
}
var favGroups = GupShup.util.getJsonFromResponse(favGroupsJSONStr);
if((typeof(favGroups.status) != 'undefined') && (favGroups.status == 'SUCCESS') && (favGroups.subscriptions.length > 0))
{
var tmplMap =
[
{key:'http://resource.smsgupshup.com/webimages/$GROUP_IMG_SRC$.jpg', dataMember:'imageUrl'},
{key:'$GROUP_NAME$', dataMember:'name'},
{key:'http://resource.smsgupshup.com/webimages/$GROUP_PAGE_URL$.jpg', dataMember:'groupUrl'},
{key:'$POSTS_COUNT$', dataMember:'totalPosts'},
{key:'$SUBSCRIBER_COUNT$', dataMember:'totalSubscribers'}
];
var containerDivId = 'favGroupsListContainerRIGHT';
var templateDivId = 'favGroupTemplateRIGHT';
GupShup.util.expandTemplateInDiv(containerDivId, templateDivId, tmplMap, favGroups.subscriptions);
document.getElementById('favGroupsBlockContainerRIGHT').style.display = "block";
}
}
try
{
favGroupsJsp_process();
}
catch(error)
{
if (GupShup.conf.jsDebug)
alert('Could not process favGroupsJsp module : error-' + error);
}
function subscribeOnMobileShouldShowDiv(entityDetails) {
if(GupShup.util.isInitialized(entityDetails) && (entityDetails.status == 'SUCCESS'))
{
if(entityDetails.info[0].isPrivate || entityDetails.info[0].isPartner)
return false;
if(GupShup.util.isInitialized(entityDetails.info[0].subscriptionDetails))
return (!entityDetails.info[0].subscriptionDetails.isSubscribed);
return true;
}
else
{
return false;
}
}
function subscribeOnMobile_process()
{
var entityDetailsJsonStr = '{"info":[{"isDefault":"false","totalSubscribers":481,"totalPosts":694,"imageUrl":"http://resource.smsgupshup.com/webimages/entity/3/814/3814931_1214343691926.png","userId":3814955,"isPrivate":false,"description":"Giga Omni Media network of sites provide one of the leading daily online news reads for the key influencers in the emerging technology market place. ","groupUrl":"http://www.smsgupshup.com/groups/GigaOM","name":"GigaOM","isPartner":false,"id":3814931,"orgName":"GigaOM"}],"params":{"limit":-1,"start":0,"type":"USER_INFO","infoType":"SMSENTITY","needTotalForPg":true,"entityId":"3814931"},"message":"","totalForPg":1,"status":"SUCCESS","errorCode":"NO_ERROR"}';
var entityDetails = GupShup.util.getJsonFromResponse(entityDetailsJsonStr);
var moduleId = 'subscribeOnMobileModule_RIGHT';
if (subscribeOnMobileShouldShowDiv(entityDetails))
{
GupShup.html.util.showElement(moduleId);
}
else
{
GupShup.html.util.hideElement(moduleId);
}
}
try
{
subscribeOnMobile_process();
}
catch(error)
{
if (GupShup.conf.jsDebug)
alert('Could not process subscribeOnMobile module : error-' + error);
}
You are about to report that this message violates GupShup Terms of Service.
We will review your request and take appropriate steps as necessary. Your report will be strictly confidential.
$ENTITY_NAME$
$ENTITY_DESCRIPTION$
$JOIN_OR_EDITSUB_BUTTON$
Members : $SUBSCRIBER_COUNT$
Group Posts ($ENTITY_POSTS_COUNT$)
$ENTITY_NAME$
This group contains messages that may be unsuitable for some users. By clicking on 'Proceed' you confirm that you are older than 18 years of age and agree to view messages from this group.
$ENTITY_TMPL_EXPANSION$
No group found.
$ENTITY_NAME$
$ENTITY_NAME$ is a private group. You must contact the owner of this group to join it and receive group messages.
Send a message to $ENTITY_NAME$ to join this group.
To send a message from your mobile, SMS MSG $ENTITY_NAME$ followed by the message to 567678.
$ENTITY_NAME$
GupShup user is quiet.
$ENTITY_NAME$
GupShup user is quiet.
$MSG_PIC$ $MSG_TEXT$$MSG_TIMESTAMP$
$MSG_ACTIONS_EXPANSION$
This message may be unsuitable for some users. By clicking on 'Proceed' you confirm that you are older than 18 years of age and agree to view this message.
$MSG_TMPL_EXPANSION$
This member has not posted any messages yet but will surely do so soon.