*/
$YP(document).ready(function(){
if(/rprl=/.test(window.location.search) || simpleSubmissionURL != null ) {
/*
Extended Use case: User not logged in & clicks write a review
user sent to login site
return from login page & review dialog shown
User fills out review and submits
User now clicks write a review on another listing
*/
// Give priority to passed in simpleSubmissionURL over rprl query param value
if( simpleSubmissionURL != null ) {
var resultPageReviewLink = simpleSubmissionURL;
} else {
var resultPageReviewLinkMatch = /[?&]rprl=([^]+)/.exec(window.location.search);
var resultPageReviewLink = resultPageReviewLinkMatch ? decodeURIComponent(resultPageReviewLinkMatch[1]) : null;
}
var ssoUserId = sso_getReviewID();
var ssoUserNN = sso_getUserName();
var submissionurl = "http://" + window.location.host + "/bvSubmit.html?ssoUserId=" + ssoUserId + "&ssoUserNN=" + ssoUserNN;
var iframeSrcURL = resultPageReviewLink + "&submissionurl=" + encodeURIComponent(submissionurl);
// When DOM not ready, colorbox errors out
$YP.fn.colorbox
({
iframe:true
,href: "/iframe.html?iframeSrc=" + encodeURIComponent(iframeSrcURL)
,innerWidth:700, innerHeight:428
,scrolling:true, opacity:0.75
,customTitle:true
,title:"Ratings and reviews"
,close:""
});
}
});
}