| |
|
|
|
|
try
{
GupShup.html.util.showElement("adModule1",false);
GupShup.html.util.overlay(document.getElementById("adModuleholder1_RIGHT"),document.getElementById("adModule1"),"left", 0, 0);
}
catch(error)
{
if (GupShup.conf.jsDebug)
alert('Could not process ad module 1 : error-' + error);
}
/* To create a template pplaceholder map.
* 1. Create a top level object template.
* 2. This top level object contains an array with one entry for each placeholder in the template
* 3. Each entry for a placeholder has two members:
* - tmplKey: Identifies the regular expression used in the template
* - tmplMap: Identifies the member object in the JSON object which should replace the template placeholder.
*/
function getTmplPlaceHolderMap()
{
var placeHolderMap = new Array();
placeHolderMap[0] = new Object();
placeHolderMap[0].key = "http://resource.smsgupshup.com/webimages/$PIC_POST_URL$.jpg";
placeHolderMap[0].dataMember = "picHREF";
placeHolderMap[1] = new Object();
placeHolderMap[1].key = "http://resource.smsgupshup.com/webimages/$PIC_IMAGE_URL$.jpg";
placeHolderMap[1].dataMember = "picSrc";
return placeHolderMap;
}
function getLeftTmplDataObjects(picListJson)
{
var picList = picListJson.smsPictures;
/* We show first half of the categories in the left list. */
var limit = ((picList.length < 4)? picList.length : 4);
limit = Math.floor((limit + 1) / 2);
var picLeftArr = new Array();
for(var i=0; i < limit; i++)
{
var entry = new Object();
entry.picHREF = picList[i].url;
entry.picSrc = picList[i].url;
picLeftArr[i] = entry;
}
return picLeftArr;
}
function getRightTmplDataObjects(picListJson)
{
var picList = picListJson.smsPictures;
/* We show second half of the categories in the right list. */
var limit = ((picList.length < 4)? picList.length : 4);
start = Math.floor((limit + 1) / 2);
var picRightArr = new Array();
var j=0;
for(var i = start; i < limit; i++)
{
var entry = new Object();
entry.picHREF = picList[i].url;
entry.picSrc = picList[i].url;
picRightArr[j++] = entry;
}
return picRightArr;
}
function picSmsPromotionJsp_process()
{
var picListJson = '{"catId":-1,"title":"All","params":{"limit":4,"start":0,"catId":"-1","type":"SMS_PICTURE_LIST","orderBy":"title","needTotalForPg":false},"message":"","status":"SUCCESS","smsPictures":[{"title":"Aashirwad","description":"","url":"http://resource.smsgupshup.com/webimages/picimages/WEB21.png","id":21},{"title":"Angry","description":"","url":"http://resource2.smsgupshup.com/webimages/picimages/WEB54.png","id":54},{"title":"Annoyed","description":"","url":"http://resource.smsgupshup.com/webimages/picimages/WEB55.png","id":55},{"title":"Aok","description":"","url":"http://resource2.smsgupshup.com/webimages/picimages/WEB53.png","id":53}],"errorCode":"NO_ERROR","urchinUrl":"/gallery?catId=-1&page=1"}';
if (GupShup.util.isInitialized(GupShup.conf.currentModule))
{
if (GupShup.util.trim(GupShup.conf.currentModule.refreshUrl) == '')
{
GupShup.conf.currentModule.refreshUrl
= GupShup.conf.readUrl + "&type=" + 'SMS_PICTURE_LIST'
+ '&catId=' + '-1'
+ '&start=0' + '&limit=' + '4' + '&needTotalForPg=false';
}
else
{
picListJson = GupShup.conf.currentModule.refreshArgs;
}
}
var picList = GupShup.util.getJsonFromResponse(picListJson);
if((typeof(picList.status) != 'undefined') && (picList.status == 'SUCCESS') && (picList.smsPictures.length > 0))
{
var tmplPlaceHolderMap = getTmplPlaceHolderMap();
var tmplDataObjArr = getLeftTmplDataObjects(picList);
GupShup.util.expandTemplateInDiv("picListLeftTableRIGHT", "picListRowTemplateRIGHT", tmplPlaceHolderMap, tmplDataObjArr);
tmplDataObjArr = getRightTmplDataObjects(picList);
GupShup.util.expandTemplateInDiv("picListRightTableRIGHT", "picListRowTemplateRIGHT", tmplPlaceHolderMap, tmplDataObjArr);
}
}
try
{
picSmsPromotionJsp_process();
}
catch(error)
{
if (GupShup.conf.jsDebug)
alert('Could not process picSmsPromotionJsp module : error-' + error);
}
function getTmplPlaceHolderMap()
{
var placeHolderMap = new Array();
placeHolderMap[0] = new Object();
placeHolderMap[0].key = "$QUERY_STRING$";
placeHolderMap[0].dataMember = "displayName";
return placeHolderMap;
}
function extractCatDataObjects(categoryList, start, limit)
{
var catArr = new Array();
var j = 0;
for(var i=start; i <= limit; i++)
{
catArr[j++] = categoryList[i];
}
return catArr;
}
function popularSearchesJsp_process()
{
var popularSearchesJson = '/*-secure-{"popular":[{"hitCount":45976,"queryString":"stock","resultCount":1,"popularRank":10,"displayName":"stock"},{"hitCount":36454,"queryString":"cricket","resultCount":1,"popularRank":10,"displayName":"cricket"},{"hitCount":152103,"queryString":"jokes","resultCount":1,"popularRank":10,"displayName":"jokes"},{"hitCount":3587,"queryString":"food","resultCount":1,"popularRank":10,"displayName":"food"},{"hitCount":11272,"queryString":"mumbai","resultCount":1,"popularRank":10,"displayName":"mumbai"}],"params":{"limit":20,"catId":"-1","start":0,"type":"POPULAR_SEARCHES","needTotalForPg":false},"message":"","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=" + 'POPULAR_SEARCHES'
+ '&start=0' + '&limit=' + '20' + '&needTotalForPg=false';
}
else
{
popularSearchesJson = GupShup.conf.currentModule.refreshArgs;
}
}
var popularSearches = GupShup.util.getJsonFromResponse(popularSearchesJson);
if((typeof(popularSearches.status) != 'undefined') && (popularSearches.status == 'SUCCESS') && (popularSearches.popular.length > 0))
{
var searches = popularSearches.popular;
var tmplPlaceHolderMap = getTmplPlaceHolderMap();
var limit = ((searches.length < 20)? searches.length : 20);
/* Expand all the data objects, except the last, in the first template. */
var tmplDataObjArr = extractCatDataObjects(searches, 0, (limit - 2));
GupShup.util.expandTemplateInDiv("popularSearchesSpanRIGHT", "popularSearchesEntryTemplateRIGHT", tmplPlaceHolderMap, tmplDataObjArr);
/* Expand the last entry in the second template. */
tmplDataObjArr = extractCatDataObjects(searches, (limit - 1), (limit - 1));
GupShup.util.expandTemplateInDiv("popularSearchesLastEntrySpanIdRIGHT", "popularSearchesLastEntryTemplateRIGHT", tmplPlaceHolderMap, tmplDataObjArr);
}
}
try
{
popularSearchesJsp_process();
}
catch(error)
{
if (GupShup.conf.jsDebug)
alert('Could not process popularSearchesJsp module : error-' + error);
}
Advertise with us
Reach the audience you want with relevant targetted ads.
Promote your brand and engage with your customers.
Learn more.
try
{
GupShup.html.util.showElement("adModule2",false);
GupShup.html.util.overlay(document.getElementById("adModuleholder2_RIGHT"),document.getElementById("adModule2"),"left", 0, 0);
}
catch(error)
{
if (GupShup.conf.jsDebug)
alert('Could not process ad module 2 : error-' + error);
}
var innerScriptDiv = "";
var innerScriptText = "";
var orientation = "RIGHT";
var modules = GupShup.conf[orientation + '_Modules'] = new Array();
GupShup.conf.currentModule = modules[0] = {name : 'errorMsg.jsp', rank : 0,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('errorMsg.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = modules[1] = {name : 'whatsNew.jsp', rank : 1,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('whatsNew.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = modules[2] = {name : 'adModule1.jsp', rank : 2,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('adModule1.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = modules[3] = {name : 'picSmsPromotion.jsp', rank : 3,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('picSmsPromotion.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = modules[4] = {name : 'popularSearches.jsp', rank : 4,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('popularSearches.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = modules[5] = {name : 'advertiseWithUs.jsp', rank : 5,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('advertiseWithUs.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = modules[6] = {name : 'adModule2.jsp', rank : 6,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('adModule2.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = null;
|
|