if( typeof(SNI)=='undefined' ){ SNI = {}; } if( typeof(SNI.Community)=='undefined' ){ SNI.Community = {}; } if( typeof(SNI.Community.Toolbox)=='undefined' ){ SNI.Community.Toolbox = {}; } if( typeof(SNI.Community.Widgets) == 'undefined' ) { SNI.Community.Widgets = {}; } SNI.Community.Widgets.isPVProject = false; if(document.getElementById("ispv")){ SNI.Community.Widgets.isPVProject = true; } SNI.Community.Widgets.imageUrl; // Shell page script codes //function showHideDiv() SNI.Community.Widgets.Carousel = function(ele, config) SNI.Community.Widgets.showHideDiv = function() { for(var i=0;i0){ widId = widVal; } if(refVal!="" && refVal!="null"){ fromUrl = refVal; } var url=statsBaseUrl+"pickleStats.do?pid="+parObjId+"&oid="+escape(objId)+"&wid="+escape(widId)+"&furl="+escape(fromUrl); url += "&ctry="+escape(country)+"&ip="+escape(fromIp)+"&fuid="+escape(fuserid)+"&et="+escape(entType)+"&hft="+escape(hitFromType); request.onreadystatechange=function() { if(request.readyState==4) { if(request.status==200) { //alert('request.responseText :'+request.responseText); } } } request.open("POST",url,true); request.setRequestHeader("content-type","application/x-www-form-urlencoded"); request.send(''); } } //function searchStats(searchType,searchWords,searchIp,searchUserId){ SNI.Community.Widgets.searchStats = function(searchType,searchWords,searchIp,searchUserId){ //try{ var searchWords = document.getElementById('pickle_search_box').value; var filterTermSearch = document.getElementById('gFilterTermsSearch').value; defaultSearchText = filterTermSearch; if(SNI.Community.Widgets.trim(searchWords)==defaultSearchText) searchWords=""; var previewMode = document.getElementById('gPreviewMode').value; if((previewMode=='null' || previewMode=='') && SNI.Community.Widgets.trim(searchWords)!=''){ var a = document.getElementById('mainPageURL').href; a = a.split("/"); var statsBaseUrl = "/"; var loc_temp = document.location+""; if(loc_temp.indexOf("localhost")!=-1) statsBaseUrl += "PickleWeb/"; var currentTxtRec = 0; var ie=document.all; var request=ie?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest(); var url=statsBaseUrl+"pickleSearchStats.do?stype="+searchType+"&swords="+escape(searchWords)+"&ip="+escape(searchIp)+"&uid="+escape(searchUserId); request.onreadystatechange=function() { if(request.readyState==4) { if(request.status==200) { //alert('request.responseText :'+request.responseText); SNI.Community.Widgets.pickleGlobalSearch(); } } } request.open("POST",url,true); request.setRequestHeader("content-type","application/x-www-form-urlencoded"); request.send(''); } //}catch(e){} } //function removeCategorytag(inputStr) SNI.Community.Widgets.removeCategorytag = function(inputStr) { //alert("inside remove :"+inputStr); var tmpRet = ""; if(inputStr!=undefined){ inputStr = inputStr.replace(/[^a-zA-Z 0-9]+/g,''); inputStr = inputStr.replace(/ /g,"-"); tmpRet = inputStr; } //alert(tmpRet); return tmpRet; } //function removeUnwatned(input) SNI.Community.Widgets.removeUnwatned = function(input) { var temp = ""; for(i=0;i0) { str=SNI.Community.Widgets.ConvertSpecialChars(str); str=SNI.Community.Widgets.ConvertLatin2ToAsciiChars(str); } return str; } //function ConvertSpecialChars(str) SNI.Community.Widgets.ConvertSpecialChars = function(str) { if(str.length > 0){ str = str.replace(new RegExp(String.fromCharCode(8216),"g"),"'"); str = str.replace(new RegExp(String.fromCharCode(8217),"g"),"'"); str = str.replace(new RegExp(String.fromCharCode(8220),"g"),"\""); str = str.replace(new RegExp(String.fromCharCode(8221),"g"),"\""); return str; } } //function ConvertLatin2ToAsciiChars(str) SNI.Community.Widgets.ConvertLatin2ToAsciiChars = function(str) { str = str.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < str.length; n++) { var c = str.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return str; } //function formatString2(str) SNI.Community.Widgets.formatString2 = function(str) { str = str.replace(/</g,"<"); str = str.replace(/>/g,">"); str = str.replace(/&/g,"&"); str = str.replace(/'/g,"'"); str = str.replace(/"/g,"\""); return str; } //function formatString(str) SNI.Community.Widgets.formatString = function(str) { str = str.replace(/%0A/g, "
"); str = unescape(str); return str; } //function submitPrint(curObj){ SNI.Community.Widgets.submitPrint = function(curObj){ var printUrl = document.getElementById("gPrintUrl").value; document.location = printUrl+escape(document.location); //document.location = "<%=ajaxUrl%>/collectionsprint.do?<%=Pickle2WebHttpRequestConstants.URL_OBJECT_ID%>=<%=CVO.getObjectId()%>&wid=<%=wid%>&loc="+escape(document.location); } //function closeErrorMsg(){ SNI.Community.Widgets.closeErrorMsg = function(){ document.getElementById('cgp-id-page-itemsaved-d2c').style.display = "none"; } //function closeErrorMsgSingleUp(){ SNI.Community.Widgets.closeErrorMsgSingleUp = function(){ document.getElementById('cgp-id-page-itemsaved').style.display = "none"; } //function getElementsByClassName(className, tag, elm){ SNI.Community.Widgets.getElementsByClassName = function(className, tag, elm){ var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)"); var tag = tag || "*"; var elm = elm || document; var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag); var returnElements = []; var current; var length = elements.length; for(var i=0; i',1);\">Please sign in to rate" }else{ SNI.Community.Widgets.select_star_css(parseInt(SNI.Community.Widgets.getratingscookie(1))); } } SNI.Community.Widgets.temp_obj = 0; SNI.Community.Widgets.prev_val = ""; //function rateTypes(inDiv, inRateType,curId,val) SNI.Community.Widgets.rateTypes = function(inDiv, inRateType,curId,val) { var gObjId = document.getElementById("gObjId").value; //Get PhotoVideo object id or Collection object id var userLogin = null; if(document.getElementById("gUserLogin") != null){ userLogin = SNI.Community.Widgets.trim(document.getElementById("gUserLogin").value); } else{ if(document.getElementById("gUserLogged") != null){ userLogin = SNI.Community.Widgets.trim(document.getElementById("gUserLogged").value); } } var ur = SNI.Community.Widgets.trim(document.getElementById("gUrNonur").value); if(SNI.Community.Widgets.getratingscookie()){ if(SNI.Community.Widgets.getratingscookie().search(gObjId)!=-1) return; } var tmpInRateType = inRateType; if(inRateType=="rating_val"){ inRateType = document.getElementById('cgp-ratings-message-hidden').value; } if(userLogin=="true" || ur=="false"){ SNI.Community.Widgets.temp_obj = val; if(tmpInRateType!="rating_val") { SNI.Community.Widgets.select_star_css(val); } else { //SNI.Community.Widgets.select_star_css(0); } } //document.getElementById(inDiv).innerHTML = inRateType; } //function reset_stars() SNI.Community.Widgets.reset_stars = function() { var gObjId = document.getElementById("gObjId").value; //Get PhotoVideo object id or Collection object id if(SNI.Community.Widgets.getratingscookie()){ if(SNI.Community.Widgets.getratingscookie().search(gObjId)!=-1) return; } SNI.Community.Widgets.select_star_css(SNI.Community.Widgets.temp_obj); } //function reset_stars_restore() SNI.Community.Widgets.reset_stars_restore = function() { var gObjId = document.getElementById("gObjId").value; //Get PhotoVideo object id or Collection object id if(SNI.Community.Widgets.bol) { SNI.Community.Widgets.bol = false; false; } if(SNI.Community.Widgets.getratingscookie()){ if(SNI.Community.Widgets.getratingscookie().search(gObjId)!=-1) return; } SNI.Community.Widgets.select_star_css(0); //document.getElementById("cgp-ratings-message").innerHTML = "Ratings: <%--=CVO.getNumOfRatings()--%>" ; document.getElementById("cgp-ratings-notloggedin").style.display = "none"; document.getElementById("cgp-ratings-message").style.display = "block"; //SNI.Community.Widgets.prev_val = ""; } //function getlogin(inDiv) SNI.Community.Widgets.getlogin = function(inDiv) { var userLogin = null; if(document.getElementById("gUserLogin") != null){ userLogin = SNI.Community.Widgets.trim(document.getElementById("gUserLogin").value); } else{ if(document.getElementById("gUserLogged") != null){ userLogin = SNI.Community.Widgets.trim(document.getElementById("gUserLogged").value); } } var ur = SNI.Community.Widgets.trim(document.getElementById("gUrNonur").value); if(ur=="true"){ if(userLogin=="false"){ document.getElementById(inDiv).innerHTML = "Please sign in to rate" }else{ document.getElementById(inDiv).innerHTML = document.getElementById('cgp-ratings-message-hidden').value; } }else{ document.getElementById(inDiv).innerHTML = document.getElementById('cgp-ratings-message-hidden').value; } } //function securefavorite(val) SNI.Community.Widgets.securefavorite = function(val) { var gObjId = document.getElementById("gObjId").value; //Get PhotoVideo object id or Collection object id secureComponent("SNI.Community.Widgets.submitvotes('"+gObjId+"','"+val+"')","YOU NEED TO BE SIGNED IN TO DO THAT.",'cgp-id-page-title-area',4); } //function secureFlag(){ SNI.Community.Widgets.secureFlag = function(){ secureComponent("SNI.Community.Widgets.showConfirm()","YOU NEED TO BE SIGNED IN TO DO THAT.",'cgp-id-page-title-area',6); } //function postsecureFlag(){ SNI.Community.Widgets.postsecureFlag = function(){ var gObjId = document.getElementById("gObjId").value; //Get PhotoVideo object id or Collection object id flagAsInappropriate(gObjId,'items','flag_link','null'); } //function showConfirm(){ SNI.Community.Widgets.showConfirm = function(){ SNI.Community.Widgets.displayOn('cgp-flyout-flag'); document.getElementById("item_flag_reason_error").innerHTML = ""; SNI.Community.Widgets.displayOff("item_flag_reason_error"); } //function secureComments(id,flagType,obj,commentsId){ SNI.Community.Widgets.secureComments = function(id,flagType,obj,commentsId){ secureComponent("SNI.Community.Widgets.postsecureComments('"+id+"','"+flagType+"','"+obj+"','"+commentsId+"')","YOU NEED TO BE SIGNED IN TO DO THAT.",obj,5); SNI.Community.Widgets.displayOff('cgp-flyout-flag'); } //function postsecureComments(id,flagType,obj,commentsId){ SNI.Community.Widgets.postsecureComments = function(id,flagType,obj,commentsId){ flagAsInappropriate(id,flagType,obj,commentsId); } //function secureRating(id,retVal){ SNI.Community.Widgets.secureRating = function(id,retVal){ var userLogin = null; if(document.getElementById("gUserLogin") != null){ userLogin = SNI.Community.Widgets.trim(document.getElementById("gUserLogin").value); } else{ if(document.getElementById("gUserLogged") != null){ userLogin = SNI.Community.Widgets.trim(document.getElementById("gUserLogged").value); } } var ur = SNI.Community.Widgets.trim(document.getElementById("gUrNonur").value); var gObjId = document.getElementById("gObjId").value; //Get PhotoVideo object id or Collection object id if(userLogin=="true"){ if(SNI.Community.Widgets.getratingscookie()&&SNI.Community.Widgets.getratingscookie().search(gObjId)!=-1) return ; } secureComponent("SNI.Community.Widgets.postsecureRating('"+id+"','"+retVal+"')","YOU NEED TO BE SIGNED IN TO DO THAT.","cgp-id-page-title-area",3); } SNI.Community.Widgets.secureRating = function(id,retVal){ var userLogin = null; if(document.getElementById("gUserLogin") != null){ userLogin = SNI.Community.Widgets.trim(document.getElementById("gUserLogin").value); } else{ if(document.getElementById("gUserLogged") != null){ userLogin = SNI.Community.Widgets.trim(document.getElementById("gUserLogged").value); } } var ur = SNI.Community.Widgets.trim(document.getElementById("gUrNonur").value); var gObjId = document.getElementById("gObjId").value; //Get PhotoVideo object id or Collection object id if(userLogin=="true"){ if(SNI.Community.Widgets.getratingscookie()&&SNI.Community.Widgets.getratingscookie().search(gObjId)!=-1) return ; } secureComponent("SNI.Community.Widgets.postsecureRating('"+id+"','"+retVal+"')","YOU NEED TO BE SIGNED IN TO DO THAT.","cgp-id-page-title-area",3); } SNI.Community.Widgets.securechat = function(val){ secureComponent("SNI.Community.Widgets.submitvotes('0','yes')","YOU NEED TO BE SIGNED IN TO DO THAT."); } SNI.Community.Widgets.postsecureRating = function(id,retVal){ SNI.Community.Widgets.submitrating(id,retVal); } //Carousel related code start SNI.Community.Widgets.paginationLen = 5; SNI.Community.Widgets.resultText = ""; SNI.Community.Widgets.objType = ""; SNI.Community.Widgets.objHeight = "0"; SNI.Community.Widgets.objWidth = "0"; SNI.Community.Widgets.selectedId = 0; SNI.Community.Widgets.count =0 ; SNI.Community.Widgets.inAppItemId = 0; SNI.Community.Widgets.restAll = function(){ for(i=0;i= ( parseInt(itemListCount)-1 ) ) if( SNI.Community.Widgets.posI > ( parseInt(itemListCount)-1 ) ) SNI.Community.Widgets.posI = 0; else if(SNI.Community.Widgets.posI<0) SNI.Community.Widgets.posI = parseInt(itemListCount)-1; // Code to Display Overlay Popup on clicking next button var ovlyCnt=itemListCount; if(overLay=="true"){ if(SNI.Community.Widgets.ovPos==ovlyCnt){ //SNI.Community.Widgets.showOtherSpaces('<%=strContainerIds%>','<%=CVO.getObjectId()%>','1','<%=vwvo.getWidgetProjectId()%>','<%=systemTagList.SNI.Community.Widgets.replaceAll("'","\\\\'")%>','all','<%=CVO.getUserId()%>'); SNI.Community.Widgets.testOverlay(); SNI.Community.Widgets.ovPos=-1; SNI.Community.Widgets.posI = parseInt(itemListCount)-1; } else{ SNI.Community.Widgets.closeOtherSpaces(); } var itemCnt=SNI.Community.Widgets.currentTxtRec; } var sObjType = ""; if(document.getElementById('sObjType'+SNI.Community.Widgets.posI)){ sObjType = document.getElementById('sObjType'+SNI.Community.Widgets.posI).value; } SNI.Community.Widgets.showThis(SNI.Community.Widgets.posI,sObjType,defaultWidth,defaultHeight,true,curObjSNI); //SNI.Community.Widgets.showThis(SNI.Community.Widgets.posI,'<%//=defaultObjectType%>','<%//=defaultWidth%>','<%//=defaultHeight%>',false,curObjSNI); } SNI.Community.Widgets.renderHidenIframe = function(){ var gAjaxUrl = document.getElementById("gAjaxUrl").value; if(document.getElementById('hidfrme')) { document.getElementById('hidfrme').src = gAjaxUrl+"/jsp_p2/widget/fixHits.html"; }else{ var a = document.createElement('iframe'); a.id = "hidfrme"; a.src = gAjaxUrl+"/jsp_p2/widget/fixHits.html"; a.style.visibility = "hidden"; a.style.position = "absolute"; document.getElementsByTagName('head')[0].appendChild(a); } } SNI.Community.Widgets.overallCount = 0; SNI.Community.Widgets.showThis = function(in_pos,in_obj_type,in_width,in_height,statsStatus,curObjSNI) { //var p = prompt("Test","Pos :"+in_pos+", objTYpe :"+in_obj_type+", width :"+in_width+", Height :"+in_height+", status :"+statsStatus+", curObj"+curObjSNI ); var adDelay = SNI.Community.Widgets.trim(document.getElementById("gAdDelay").value); var userTagDisplay = SNI.Community.Widgets.trim(document.getElementById("gUserTagDisplay").value); SNI.Community.Widgets.renderHidenIframe(); SNI.Community.Widgets.posI = in_pos; var newCaption=''; var newText=''; var newTags = ''; var newProducer = ''; var myObjColl = SNI.Community.Widgets.getElementsByClassName('jcarousel-pageimg'); SNI.Community.Widgets.restAll(); var carouselMaxRec = document.getElementById("txtCarouselMaxRec").value; SNI.Community.Widgets.fireEvent(myObjColl[0].childNodes[Math.floor( parseInt(in_pos)/parseInt(carouselMaxRec) )],'click'); SNI.Community.Widgets.count++; if(SNI.Community.Widgets.count==parseInt(adDelay)) { SNI.Community.Widgets.count = 0; var randomnumber=Math.floor(Math.random()*100000) if(SNI.Community.Widgets.overallCount!=0) { try{ /* * Big Box Ad setting */ var url = VideoPlayerAd("BIGBOX", "", 5); if(url.indexOf("ORD=")!=-1) { var part1 = url.substring(0,url.indexOf("ORD=")); var part2 = url.substring(url.indexOf("ORD="),url.length); part2 = part2.substring(part2.indexOf("&")+1,part2.length); url = part1+part2; } url += "&ord=" + randomnumber; try{ setDartEnterpriseBanner("BIGBOX", url); }catch(e){ document.getElementById('bigbox').innerHTML = ""); //document.writeln("
"); //document.writeln(""); //document.writeln(""); //document.writeln(""); //document.writeln("
"); //document.getElementById('includedcss').value = SNI.Community.Widgets.getPageElements("link"); //document.getElementById('includedjs').value = SNI.Community.Widgets.getPageElements("script"); var headID = document.getElementsByTagName("head")[0]; //alert("head :"+headID.innerHTML); var newScript = document.createElement('script'); newScript.type = 'text/javascript'; newScript.src = jsonUrl; headID.appendChild(newScript); //document.getElementById('p2_f1').submit(); } SNI.Community.Widgets.getPageElements = function(type) { var links = document.getElementsByTagName(type); var urls = ""; for(i=0;i/g,'<b>'); input = input.replace(/<\/b>/g,'</b>'); input = input.replace(//g,'<i>'); input = input.replace(/<\/i>/g,'</i>'); input = input.replace(//g,'<u>'); input = input.replace(/<\/u>/g,'</u>'); input = input.replace(//g,'>'); input = input.replace(/<b>/g,''); input = input.replace(/<\/b>/g,''); input = input.replace(/<i>/g,''); input = input.replace(/<\/i>/g,''); input = input.replace(/<u>/g,''); input = input.replace(/<\/u>/g,''); input = input.replace(/\n/g,"
"); input = input.replace(/ /g,"-$-"); input = SNI.Community.Widgets.appendAnchorTag( input ); return input; } SNI.Community.Widgets.repaceLineBreaks = function( input ){ input = input.replace(/\n/g,"
"); return input; } SNI.Community.Widgets.appendAnchorTag = function( input ){ var result=""; var arr2 = input.split("-$-"); for( var j=0;j"+arr2[j]+""+" "; else result = result+""+arr2[j]+""+" "; } else{ result = result+arr2[j]+" "; } } return result; } SNI.Community.Widgets.setCookie = function(sortOrder,objectId){ SNI.Community.Widgets.Set_Cookie( "pickle_pv_selected_category",sortOrder, '365', '/', '', '' ); } /* * Call Search on hitting Enter Key */ SNI.Community.Widgets.ifEnter = function(field,event){ var theCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (theCode == 13){ SNI.Community.Widgets.pickleGlobalSearch(); return false; } else return true; } SNI.Community.Widgets.ifEnterStop = function(field,event){ var theCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (theCode == 13){ event.returnValue=false; event.cancel = true; return false; } else{ return true; } } /* * Craousel Wrapper Code Starts */ SNI.Community.Widgets.Carousel = function(ele, config) { config = $.extend( { pause : null, scroll : 1, animation : "slow", auto : 0, wrap : null, pagelink : null, pagetext : null, start : 1 } , config); var crsl_itemFirstInCallback = function(carousel, item, idx, state) { if(config["pagelink"] == "text") { var tmpText = config["pagetext"]; tmpText = tmpText.replace(/_current/ig, idx); tmpText = tmpText.replace(/_total/ig, carousel["options"]["size"]); carousel.container.find(".jcarousel-pagetext").html(tmpText); } else if(config["pagelink"] == "image") { jQuery(ele).find('.jcarousel-pageimg a.current').removeClass("current"); link = jQuery(ele).find('.jcarousel-pageimg a')[idx - 1]; jQuery(link).addClass("current"); } } ; var crsl_initCallback = function(carousel, state) { if((config["pagelink"] == "text") || (config["pagelink"] == "both")) { carousel.container.append('
'); } else if((config["pagelink"] == "image") || (config["pagelink"] == "both")) { var imgLinks = ""; for(var i = 1; i <= carousel["options"]["size"]; i ++ ) { imgLinks += '' + i + ''; } carousel.container.append('
'); jQuery(ele).find(".jcarousel-pageimg").append(imgLinks); jQuery(ele).find(".jcarousel-pageimg").css("left", parseInt($(ele).width()) / 2 - parseInt($(ele).find(".jcarousel-pageimg").width()) / 2); jQuery(ele).find('.jcarousel-pageimg a').bind('click', function() { carousel.scroll(jQuery.jcarousel.intval(jQuery(this).html())); return false; } ); } } ; $(ele).find('.crsl').jcarousel( { scroll : config["scroll"], animation : config["slow"], auto : config["auto"], wrap : config["wrap"], itemFirstInCallback : crsl_itemFirstInCallback, initCallback : crsl_initCallback, start : config["start"] } ); }; /* Events API code Starts here ... */ if(typeof(SNI.Community.Widgets.Events)=='undefined' ) SNI.Community.Widgets.Events = {} SNI.Community.Widgets.Events.AllowFBPost = false; SNI.Community.Widgets.Events.FBNAME = "NA"; SNI.Community.Widgets.Events.getLoggedUserName = function(){ var userIds = new Array(); userIds[0] = FB.Facebook.apiClient.get_session().uid; var requiredFeilds = new Array(); requiredFeilds[0] = "first_name"; FB.Facebook.apiClient.users_getInfo(userIds,requiredFeilds,SNI.Community.Widgets.Events.setFBValues); } SNI.Community.Widgets.Events.setFBValues = function(obj) { SNI.Community.Widgets.Events.FBNAME = obj[0]['first_name']; } //SNI.Community.Widgets.Events.api_key = "39b77ff5c12c27773d69818884e401d8"; //SNI.Community.Widgets.Events.channel_path = "xd_receiver.htm"; //FB.init(SNI.Community.Widgets.Events.api_key, SNI.Community.Widgets.Events.channel_path, {"ifUserConnected": SNI.Community.Widgets.Events.getLoggedUserName}); SNI.Community.Widgets.Events.RZCommenting = function() { this._caption; this._postedname; this._ratingcount = 2; this._commenttext; this._objecturl; this._imageurl; this._onsite; this._callback = null; this.setCallBack = function(callback){ this._callback = callback; }; this.setObjectUrl = function(objecturl) { this._objecturl = objecturl; }; this.setCaption = function(caption) { this._caption = caption; }; this.setPostedBy = function(postedname) { this._postedname = postedname; }; this.setRatingCount = function(ratingcount) { this._ratingcount = ratingcount; }; this.setCommentText = function(commenttext) { this._commenttext = commenttext; }; this.setOnSite = function(sitename) { this._onsite = sitename; }; this.setImageURL = function(imageurl) { this._imageurl = imageurl; }; this.getXML = function(){ var xml = ">"+// Note :: should be replaced by the siteId while we fetch on fly .... ""+ ""+ ""+ ""+ ""; try{ var imgurl = this._imageurl.split(","); for(i=0;i"+ ""+ ""; } }catch(e){} xml += ""+// Note :: TIME should be replaced by actual time of the event while fetching .... "<"+ ">"+ ">"; return xml; } this.getFaceBookXML = function(){ var xml = ""+ ""+ ""+ ""+ "View this"+ ""+ ""; try{ var imgurl = this._imageurl.split(","); for(i=0;i"+ ""+ ""; } }catch(e){} xml += ""; return xml; } this.getCallBack = function(){ return this._callback; } return this; } SNI.Community.Widgets.Events.FBUpload = function(){ this._fbfirstname; this._caption; this._onsite; this._imgurl; this._imghref; this._objecturl; this._desc; this._callback = null; this.setCallBack = function(callback){ this._callback = callback; }; this.setDesc = function(desc){ this._desc = desc; } this.setObjectUrl = function(objecturl) { this._objecturl = objecturl; }; this.setCaption = function(caption) { this._caption = caption; }; this.setOnSite = function(sitename) { this._onsite = sitename; }; this.setImageUrl = function(imgurl) { this._imgurl = imgurl; }; this.setImageHREF = function(imghref) { this._imghref = imghref; }; this.getFaceBookXML = function(){ var xml = ""+ ""+ ""+ ""+ ""+ "View this"+ ""; var imgurl = this._imgurl.split(","); //var imghref = this._imghref.split(","); for(i=0;i"+ ""+ ""; } xml +=""; return xml; } this.getCallBack = function(){ return this._callback; } return this; } SNI.Community.Widgets.Events.RZTopicCommenting = function() { this._caption; this._topicname; this._ratingcount; this._commenttext; this._objecturl; this._onsite; this._callback = null; this.setCallBack = function(callback){ this._callback = callback; }; this.setOnSite = function(sitename) { this._onsite = sitename; }; this.setObjectUrl = function(objecturl) { this._objecturl = objecturl; }; this.setCaption = function(caption) { this._caption = caption; }; this.setTopicName = function(topicname) { this._topicname = topicname; }; this.setRatingCount = function(ratingcount) { this._ratingcount = ratingcount; }; this.setCommentText = function(commenttext) { this._commenttext = commenttext; }; this.getXML = function(){ var xml = ">"+// Note :: should be replaced by the siteId while we fetch on fly .... ""+ ""+ ""+ ""+ ""+ "Recipezaar"+ ""+// Note :: TIME should be replaced by actual time of the event while fetching .... "<"+ ">"+ ">"; return xml; } this.getFaceBookXML = function(){ var xml = ""+ ""+ ""+ ""+ ""+ "Join the Discussion"+ ""+ ""; return xml; } this.getCallBack = function(){ return this._callback; } return this; } SNI.Community.Widgets.Events.RZSave = function() { this._caption; this._postedname; this._objecturl; this._callback = null; this.setCallBack = function(callback){ this._callback = callback; }; this.setObjectUrl = function(objecturl) { this._objecturl = objecturl; }; this.setCaption = function(caption) { this._caption = caption; }; this.setPostedBy = function(postedname) { this._postedname = postedname; }; this.getXML = function(){ var xml = ">"+// Note :: should be replaced by the siteId while we fetch on fly .... ""+ ""+ ""+ "Recipezaar"+ ""+// Note :: TIME should be replaced by actual time of the event while fetching .... "<"+ ">"+ ">"; return xml; } this.getCallBack = function(){ return this._callback; } return this; } SNI.Community.Widgets.Events.RZFan = function() { this._postedname; this._objecturl; this._callback = null; this.setCallBack = function(callback){ this._callback = callback; }; this.setObjectUrl = function(objecturl) { this._objecturl = objecturl; }; this.setFanOf = function(postedname) { this._postedname = postedname; }; // this.getXML = function(){ var xml = ">"+// Note :: should be replaced by the siteId while we fetch on fly .... ""+ ""+ ""+ "Recipezaar"+ ""+// Note :: TIME should be replaced by actual time of the event while fetching .... "<"+ ">"+ ">"; return xml; } this.getCallBack = function(){ return this._callback; } return this; } SNI.Community.Widgets.Events.RZUpload = function() { this._caption; this._imageurls; this._objecturl; this._callback = null; this.setCallBack = function(callback){ this._callback = callback; }; this.setObjectUrl = function(objecturl) { this._objecturl = objecturl; }; this.setCaption = function(caption) { this._caption = caption; }; this.setImageUrls = function(imageurls) { this._imageurls = imageurls; }; this.getXML = function(){ var xml = ">"+// Note :: should be replaced by the siteId while we fetch on fly .... ""; var imgurl = this._imageurls.split(","); for(i=0;i"+ ""+ ""; } xml += ""+// Note :: TIME should be replaced by actual time of the event while fetching .... "Recipezaar"+ ""+ ""+ "<"+ ">"+ ">"; return xml; } this.getFaceBookXML = function(){ var xml = ""+ ""+ ""+ ""+ "View Recipe"+ ""+ ""; var imgurl = this._imageurl.split(","); for(i=0;i"+ ""+ ""; } xml +=""; return xml; } this.getCallBack = function(){ return this._callback; } return this; } SNI.Community.Widgets.Events.RZSharedRecipe = function() { this._caption; this._imageurl; this._desc; this._objecturl; this._callback = null; this.setCallBack = function(callback){ this._callback = callback; }; this.setObjectUrl = function(objecturl) { this._objecturl = objecturl; }; this.setCaption = function(caption) { this._caption = caption; }; this.setImageUrl = function(imageurl) { this._imageurl = imageurl; }; this.setDesc = function(desc) { this._desc = desc; }; this.getXML = function(){ var xml = ">"+// Note :: should be replaced by the siteId while we fetch on fly .... ""; var imgurl = this._imageurl.split(","); for(i=0;i"+ ""+ ""; } ""+ ""+ "Recipezaar"+ ""+// Note :: TIME should be replaced by actual time of the event while fetching .... "<"+ ">"+ ">"; return xml; } this.getFaceBookXML = function(){ var xml = ""+ ""+ ""+ ""+ "View Recipe"+ ""+ ""; var imgurl = this._imageurl.split(","); for(i=0;i"+ ""+ ""; } xml +=""; return xml; } this.getCallBack = function(){ return this._callback; } return this; } SNI.Community.Widgets.Events.RZSharedCookBook = function() { this._caption; this._imageurl; this._recipecount; this._desc; this._objecturl; this._callback = null; this.setCallBack = function(callback){ this._callback = callback; }; this.setObjectUrl = function(objecturl) { this._objecturl = objecturl; }; this.setCaption = function(caption) { this._caption = caption; }; this.setImageUrl = function(imageurl) { this._imageurl = imageurl; }; this.setRecipeCount = function(recipecount) { this._recipecount = recipecount; }; this.setDesc = function(desc) { this._desc = desc; }; this.getXML = function(){ var xml = ">"+// Note :: should be replaced by the siteId while we fetch on fly .... ""+ ""; var imgurl = this._imageurl.split(","); for(i=0;i"+ ""+ ""; } xml += ""+ ""+ "Recipezaar"+ ""+// Note :: TIME should be replaced by actual time of the event while fetching .... "<"+ ">"+ ">"; return xml; } this.getFaceBookXML = function(){ var xml = ""+ ""+ ""+ ""+ ""+ "View Cookbook"+ ""; var imgurl = this._imageurl.split(","); for(i=0;i"+ ""+ ""; } xml +=""; return xml; } this.getCallBack = function(){ return this._callback; } return this; } SNI.Community.Widgets.Events.loadLocalXML = function(text){ if (window.DOMParser) { parser=new DOMParser(); xmlDoc=parser.parseFromString(text,"text/xml"); } else // Internet Explorer { xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async="false"; xmlDoc.loadXML(text); } return xmlDoc; } SNI.Community.Widgets.Events.loadXML = function(src){ if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else // Internet Explorer 5/6 { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET",src,false); xhttp.send(""); xmlDoc=xhttp.responseXML; return xmlDoc; } SNI.Community.Widgets.Events.postToFB = function (xml,obj){ if(!SNI.Community.Widgets.Events.allowFBPublish){ eval(obj.getCallBack()+"()"); return false; } try{ if(parseInt(SNI.Community.Widgets.Events.fbUserId) != parseInt(FB.Facebook.apiClient.get_session().uid)) { eval(obj.getCallBack()+"()"); return false; } }catch(e){} var singleton=FB.Connect._singleton; if(parseInt(singleton._userInfo.shortStorySetting) != parseInt(FB.FeedStorySetting.autoaccept)){ FB.Connect.showPermissionDialog("publish_stream", function(granted){ if(granted != ""){ var singleton=FB.Connect._singleton; singleton._userInfo.shortStorySetting = FB.FeedStorySetting.autoaccept; SNI.Community.Widgets.Events.postToFB(xml,obj); }else{ } }); return false; } var xml=SNI.Community.Widgets.Events.loadLocalXML(xml); var xsl=SNI.Community.Widgets.Events.loadXML("/xsltemplate.xslt"); if(!document.getElementById('hidden_div')) { var div_ele = document.createElement('div'); div_ele.style.display = "none"; div_ele.id = "hidden_div"; document.getElementsByTagName('head')[0].appendChild(div_ele); }else{ document.getElementById("hidden_div").innerHTML = ""; } var js_code = ""; if (window.ActiveXObject) { js_code=xml.transformNode(xsl); document.getElementById("hidden_div").innerHTML=js_code; } else if (document.implementation && document.implementation.createDocument) { xsltProcessor=new XSLTProcessor(); xsltProcessor.importStylesheet(xsl); js_code = xsltProcessor.transformToFragment(xml,document); document.getElementById("hidden_div").appendChild(js_code); } eval(document.getElementById("hidden_div").innerHTML); } SNI.Community.Widgets.Events.RegisterBulkevent = function(site,bulkObject){ for(i=0;i