| |
|
|
|
|
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":60904,"queryString":"stock","resultCount":1,"popularRank":10,"displayName":"stock"},{"hitCount":72180,"queryString":"cricket","resultCount":1,"popularRank":10,"displayName":"cricket"},{"hitCount":264909,"queryString":"jokes","resultCount":1,"popularRank":10,"displayName":"jokes"},{"hitCount":5057,"queryString":"food","resultCount":1,"popularRank":10,"displayName":"food"},{"hitCount":17618,"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.
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 : 'sms_gallery.jsp', rank : 2,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('sms_gallery.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = modules[3] = {name : 'smsapp_chat.jsp', rank : 3,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('smsapp_chat.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = modules[4] = {name : 'smsapp_quiz.jsp', rank : 4,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('smsapp_quiz.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = modules[5] = {name : 'popularSearches.jsp', rank : 5,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('popularSearches.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = modules[6] = {name : 'advertiseWithUs.jsp', rank : 6,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('advertiseWithUs.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = null;
|
|