var show_up_level = 2 ;var header_up_level = 2 ;var is_debug_log_enabled = 0; var sz_is_auto_layout = 1; var sz_high_sibling = 1; var sz_low_sibling = 0; SezWho = { Version: '1.3.0' } ; SezWho.Utils = {} ; // class for rendering the sezwho UI for each comment SezWho.PluginCore = new function () { try { this.szManageEmbedUI = function () { SezWho.Utils.log("info", "called SezWho.PluginCore.szManageEmbedUI "); if (window.sz_global_config_params == null || document.getElementById('cpEmbedPageTableid') || window.sz_comment_config_params == null || window.sz_comment_config_params.comment_number == null) { return; } var post_id = sz_comment_config_params.post_id ; var sortScore = sz_comment_config_params.sortOrder ; var isErrorShown = "false" ; if (sortScore == '') sortScore = 0 ; if (sz_comment_config_params.comment_number != sz_comment_config_params.sz_comment_data.length) sz_comment_config_params.comment_number = sz_comment_config_params.sz_comment_data.length; if (sz_comment_config_params.sz_auto_option_bar) { var fb = get_show_comment_dropdown_div(); var fbph = document.getElementById('szOptionBarPlaceHolder'); fbph.parentNode.replaceChild(fb, fbph); } else { var cn = SezWho.BlogPlatformCallbackJS.get_top_of_first_comment(sz_comment_config_params.sz_comment_data[0].comment_id); var showCommentDiv = get_show_comment_dropdown_div(); try { if (cn && cn.parentNode) cn.parentNode.insertBefore(showCommentDiv, cn); } catch (e) { if (isErrorShown == "false" ) { SezWho.Utils.log("error", "We could not handle this theme, please use the manual modification of theme as outlined in http://www.SezWho.com/FAQ.php."); isErrorShown = "true" ; return ; } } } // loop over the comment score information passed and populate the comment header and footer var hn, fn; for (var co2 = 0 ; co2 < sz_comment_config_params.comment_number; co2++) { if (sz_comment_config_params.sz_comment_data[co2].comment_score == 0) continue; hn = null; fn = null; if (sz_comment_config_params.sz_auto_comment){ try { var hnode = document.getElementById('szCommentHeaderPlaceHolder:'+co2); var commentCompositeDiv = get_composite_div(co2); var hnp = hnode; // In case there are no siblings where the hnode is (case of a div around comment header) while (!hnp.nextSibling) hnp = hnp.parentNode; while (hnp && hnp.nextSibling) commentCompositeDiv.appendChild(hnp.nextSibling); if (hnp && hnp.parentNode) hnp.parentNode.appendChild(commentCompositeDiv); // Now handle the header hn = get_comment_header_div(co2, sz_comment_config_params.sz_comment_data[co2].comment_score, get_commenter_display(co2)); hnode.parentNode.replaceChild(hn, hnode); // Footer var fnode = document.getElementById('szCommentFooterPlaceHolder:'+co2); if (fnode){ fn = get_comment_footer_div(co2); fnode.parentNode.replaceChild(fn, fnode); } } catch (e) { if (isErrorShown == "false") { SezWho.Utils.log("error", "We could not handle this theme, please use the manual modification of theme as outlined in http://www.SezWho.com/FAQ.php ."); isErrorShown = "true" ; return ; } } } else { var comment_node = SezWho.BlogPlatformCallbackJS.get_comment_node(sz_comment_config_params.sz_comment_data[co2].comment_id); if (!comment_node) comment_node = SezWho.BlogPlatformCallbackJS.get_comment_node_by_calc(sz_comment_config_params.sz_comment_data[co2].comment_id,1); if (!comment_node) continue; try { hn = get_comment_header_div(co2, sz_comment_config_params.sz_comment_data[co2].comment_score, get_commenter_display(co2)); fn = get_comment_footer_div(co2); //first insert the footer elements comment_node.insertBefore(fn, null); //Next create the composite Div and insert it var commentCompositeDiv = get_composite_div(co2); while (comment_node.firstChild) commentCompositeDiv.appendChild(comment_node.firstChild); comment_node.appendChild(commentCompositeDiv); // Last insert the comment header node. comment_node.insertBefore(hn,commentCompositeDiv); } catch (e) { if (isErrorShown == "false") { SezWho.Utils.log("error", "We could not handle this theme, please use the manual modification of theme as outlined in http://www.SezWho.com/FAQ.php ."); isErrorShown = "true" ; return ; } } } // Now setup the event handlers var ll = null; if (hn){ var pl = null; ll = hn.getElementsByTagName("A"); for (var i = 0; i < ll.length; i++) if (ll[i].className == 'cpEmbedPageProfileLinkCustom') {pl = ll[i]; break;} if (pl){ sz_cp_proto.observe(pl,"mouseover", SezWho.Utils.cpProfileEventHandler); sz_cp_proto.observe(pl,"mouseout", function(ev) { SezWho.DivUtils.cancelPopUp(); }); sz_cp_proto.observe(pl,"mousedown", SezWho.Utils.cpProfileEventHandler); } } if (fn) { ll = fn.getElementsByTagName("INPUT"); for (var i = 0; i < ll.length; i++) if (SezWho.Utils.isOpera() || ((/Safari|Konqueror|KHTML/gi).test(navigator.userAgent) && !(/Safari\/5/gi).test(navigator.userAgent))) sz_cp_proto.observe(ll[i],"click", SezWho.Utils.szHandleRatingButtonClicks); else sz_cp_proto.observe(ll[i],"mousedown", SezWho.Utils.szHandleRatingButtonClicks); } } } function get_show_comment_dropdown_div() { iHtml = "
Filter: What is this? | "; if (navigator.userAgent.match(/msie (5\.5|6)/i)&&navigator.platform=="Win32") //PNG fix iHtml = iHtml+""; else iHtml = iHtml+""; iHtml = iHtml+" |
| "+comment_author+" (Profile) | "+SezWho.Utils.get_star_rating(cScore, "comment")+" |
Please enter your email address. Your identification helps us score the comment better. Your address will be kept private and will not be shown to other users.
";
// now set cookie
if (setcookieflag) SezWho.Utils.setCookie("SZ_EMAIL_COOKIE" , emailID, 100);
var formParam = 'ratingIncrement='+escape(ratingIncrement)+'&postID='+escape(postID)+'&commentID='+escape(sz_comment_config_params.sz_comment_data[i].comment_id)+'&emailID='+encodeURIComponent(emailID)+'&msec='+SezWho.Utils.getTimeStamp()+'&__mode=cp_comment_rating_submit';
var comment_rating_submit_path = sz_comment_config_params.comment_rating_submit_path ;
if(sz_comment_config_params.use_cross_domain_posting) {
SezWho.Utils.makeJSCall(sz_global_config_params.cppluginurl+comment_rating_submit_path+"?return_js=true&"+formParam);
}
else {
var req = null;
if(window.XMLHttpRequest) req = new XMLHttpRequest();
else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP");
req.onreadystatechange = function() {
if(req.readyState == 4) {
if(req.status == 200) {
var response = req.responseText;
//alert(response);
SezWho.DivUtils.handleCommentRating(response);
}
}
};
req.open('POST', cppluginurl+comment_rating_submit_path , true);
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
req.send(formParam);
}
}
this.handleBadgeData = function(sz_badge_data_params) {
var html_output;
if (navigator.userAgent.match(/msie (5\.5|6)/i)&&navigator.platform=="Win32") //PNG fix
html_output = "| " + sz_badge_config_params.sz_badge_data[currentLength]['formatted_name'] + " |
| Star Power: |
| " + SezWho.Utils.get_star_rating(sz_badge_config_params.sz_badge_data[currentLength]['sz_score'], "badge") + " |
| Red Carpet | |
|---|---|
| " + unescape(sz_rc_config_params.sz_rc_data[i]['comment_author']).replace(/\+/g, " ") + " " + SezWho.Utils.get_star_rating(sz_rc_config_params.sz_rc_data[i]['sz_score'], "redcarpet") + " View Comment | ";
html_output = html_output + "";
html_output = html_output + "|

";
// now set cookie
if (setcookieflag) SezWho.Utils.setCookie("SZ_EMAIL_COOKIE" , emailID, 100);
var formParam = 'ratingIncrement='+escape(ratingIncrement)+'&postID='+escape(postID)+'&commentID='+escape(sz_comment_config_params.sz_comment_data[i].comment_id)+'&emailID='+encodeURIComponent(emailID)+'&msec='+SezWho.Utils.getTimeStamp()+'&__mode=cp_comment_rating_submit';
var comment_rating_submit_path = sz_comment_config_params.comment_rating_submit_path ;
if(sz_comment_config_params.use_cross_domain_posting) {
SezWho.Utils.makeJSCall(sz_global_config_params.cppluginurl+comment_rating_submit_path+"?return_js=true&"+formParam);
}
else {
var req = null;
if(window.XMLHttpRequest) req = new XMLHttpRequest();
else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP");
req.onreadystatechange = function() {
if(req.readyState == 4) {
if(req.status == 200) {
var response = req.responseText;
//alert(response);
SezWho.DivUtils.handleCommentRating(response);
}
}
};
req.open('POST', cppluginurl+comment_rating_submit_path , true);
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
req.send(formParam);
}
}
this.handleBadgeData = function(sz_badge_data_params) {
var html_output;
if (navigator.userAgent.match(/msie (5\.5|6)/i)&&navigator.platform=="Win32") //PNG fix
html_output = "