Crowdsignal Dashboard – Polls, Surveys & more - Version 2.0.19

Version Description

Bug Fixes and added filter by catergory to Top Rated Widget

=

Download this release

Release Info

Developer nickhamze
Plugin Icon 128x128 Crowdsignal Dashboard – Polls, Surveys & more
Version 2.0.19
Comparing to
See all releases

Code changes from version 2.0.18 to 2.0.19

img/info.png ADDED
Binary file
img/info@2x.png ADDED
Binary file
img/nero-hand-lrg.png ADDED
Binary file
img/nero-hand-lrg@2x.png ADDED
Binary file
img/nero-hand-med.png ADDED
Binary file
img/nero-hand-med@2x.png ADDED
Binary file
img/nero-hand-sml.png ADDED
Binary file
img/nero-hand-sml@2x.png ADDED
Binary file
img/pd-wp-icon-blue-lrg@2x.png ADDED
Binary file
img/pd-wp-icon-gray-lrg@2x.png ADDED
Binary file
img/star-blue-lrg.png ADDED
Binary file
img/star-blue-lrg@2x.png ADDED
Binary file
img/star-blue-med.png ADDED
Binary file
img/star-blue-med@2x.png ADDED
Binary file
img/star-blue-sml.png ADDED
Binary file
img/star-blue-sml@2x.png ADDED
Binary file
img/star-green-lrg.png ADDED
Binary file
img/star-green-lrg@2x.png ADDED
Binary file
img/star-green-med.png ADDED
Binary file
img/star-green-med@2x.png ADDED
Binary file
img/star-green-sml.png ADDED
Binary file
img/star-green-sml@2x.png ADDED
Binary file
img/star-grey-lrg.png ADDED
Binary file
img/star-grey-lrg@2x.png ADDED
Binary file
img/star-grey-med.png ADDED
Binary file
img/star-grey-med@2x.png ADDED
Binary file
img/star-grey-sml.png ADDED
Binary file
img/star-grey-sml@2x.png ADDED
Binary file
img/star-pd-sml.png ADDED
Binary file
img/star-red-lrg.png ADDED
Binary file
img/star-red-lrg@2x.png ADDED
Binary file
img/star-red-med.png ADDED
Binary file
img/star-red-med@2x.png ADDED
Binary file
img/star-red-sml.png ADDED
Binary file
img/star-red-sml@2x.png ADDED
Binary file
img/star-yellow-lrg.png ADDED
Binary file
img/star-yellow-lrg@2x.png ADDED
Binary file
img/star-yellow-med@2x.png ADDED
Binary file
img/star-yellow-sml.png ADDED
Binary file
img/star-yellow-sml@2x.png ADDED
Binary file
js/rating.js CHANGED
@@ -1 +1,2 @@
1
- function PDRTJS_url_encode(a){return encodeURIComponent(a).replace(/\%20/g,"+").replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/\~/g,"%7E")}function PDRTJS_is_defined(a){return typeof a=="undefined"?false:true}function PDRTJS_RATING(settings){function $(a){return document.getElementById(a)}var server=("https:"==document.location.protocol?"https:":"http:")+"//polldaddy.com";for(var property in settings){this[property]=settings[property]}var pc='<p style="padding: 0px; margin: 0px; clear: both;"></p>';var c=0;var token="";this.make_call=function(a){if(this.override!=null){a=a+"&override=true"}var b=document.createElement("SCRIPT");b.charset="utf-8";b.src=server+a;var c=document.getElementsByTagName("head").item(0);c.appendChild(b)};this.callback=function(a,b,c,d,e,f){if(this.callback_url!=null){true_callback_url=this.callback_url.replace(/{id}/,a);true_callback_url=true_callback_url.replace(/{unique_id}/,b);true_callback_url=true_callback_url.replace(/{type}/,c);true_callback_url=true_callback_url.replace(/{r}/,d);true_callback_url=true_callback_url.replace(/{voter_id}/,e);if(c=="stars"){true_callback_url=true_callback_url.replace(/{scores}/,this.votes+","+this.avg_rating)}else{true_callback_url=true_callback_url.replace(/{scores}/,this.nero_up+","+this.nero_dn)}if(f){true_callback_url=true_callback_url+"&change=true"}var g=document.createElement("SCRIPT");g.charset="utf-8";g.src=true_callback_url;var h=document.getElementsByTagName("head").item(0);h.appendChild(g)}};this.get_rating=function(){this.varname="PDRTJS_"+this.id+this.item_id;this.make_call("/ratings/rate.php?cmd=get&id="+this.id+"&uid="+this.unique_id+"&item_id="+this.item_id)};this.init=function(){eval("settings = PDRTJS_settings_"+this.id+this.item_id+";");for(var property in settings){this[property]=settings[property]}this.build()};this.build=function(){this.font=this.font_italic+" "+this.font_bold+" "+this.font_size+"/"+this.font_line_height+" "+this.font_family;var a=$("pd_rating_holder_"+this.id+this.item_id);a.style.display="inline-block";this.star_margin="1px";if(this.custom_star.length>0){this.star_image=this.custom_star;this.star_margin="1px"}else{if(this.type=="stars"){this.star_image=(this.is_secure()?"https://polldaddy.com":"http://i0.poll.fm")+"/ratings/images/star-"+this.star_color+"-"+this.size+".png"}else{this.star_image=(this.is_secure()?"https://polldaddy.com":"http://i0.poll.fm")+"/ratings/images/nero-"+this.star_color+"-"+this.size+".png"}}this.image_size="16px";if(this.size=="med"){this.image_size="20px"}else{if(this.size=="lrg"){this.image_size="24px"}}if(this.type=="stars"){var b="";var c="";var d="bottom left";var e=this.text_rate_this;if(this.votes>0){d="top left";e=this.votes+" ";if(this.votes==1&&typeof this.text_vote!="undefined"){e+=this.text_vote}else{e+=this.text_votes}}if(this.font_position=="right"){c='<div id="'+this.varname+'_msg" style="float:left; padding-left: 5px; text-align: '+this.font_align+"; font:"+this.font+"; color: #"+this.font_color+';">'+e+"</div>"}else{c='<div id="'+this.varname+'_msg" style="text-align: '+this.font_align+";font:"+this.font+";color: #"+this.font_color+';">'+e+"</div>"}if(this.font_position=="top"){b+=c+pc}b+='<div id="pd_rate_'+this.id+this.item_id+'" style="float:left;">';for(h=1;h<=5;h++){if(this.avg_rating>0){if(this.avg_rating<h){d="bottom left"}if(this.avg_rating==h-1+.5){d="center left"}}b+='<div onmouseout="'+this.varname+'.rebuild();" onclick="'+this.varname+".rate("+h+');" onmouseover="'+this.varname+".hover("+h+');" id="'+this.varname+"_stars_"+h+'" style="cursor: pointer; width: '+this.image_size+"; height: "+this.image_size+"; line-height: "+this.image_size+"; background: url("+this.star_image+") "+d+"; float: left; padding: 0px; marging: 0px; margin-right: "+this.star_margin+';"> </div>'}b+="</div>"}else{var b="";var c="";var f="bottom";var g="left";var e=new Array;e[0]=this.text_rate_this;e[1]="";e[2]="";var h=0;if(this.nero_up!=null){e[1]=this.nero_up}else{this.nero_up=0;e[1]="0"}if(this.nero_dn!=null){e[2]=this.nero_dn}else{this.nero_dn=0;e[2]="0"}if(this.font_position=="right"){c='<div id="'+this.varname+'_msg" style="float:left; padding-left: 5px; text-align: '+this.font_align+"; font:"+this.font+"; color: #"+this.font_color+';">'+e[0]+"</div>"}else{c='<div id="'+this.varname+'_msg" style="text-align: '+this.font_align+"; font:"+this.font+"; color: #"+this.font_color+';">'+e[0]+"</div>"}if(this.font_position=="top"){b+=c+pc}b+='<div id="pd_rate_'+this.id+this.item_id+'" style="float:left;">';for(h=1;h<=2;h++){if(h==2){g="right"}b+='<div onmouseout="'+this.varname+'.rebuild();" onclick="'+this.varname+".rate("+h+');" onmouseover="'+this.varname+".hover("+h+');" id="'+this.varname+"_nero_"+h+'" style="cursor: pointer; width: '+this.image_size+"; height: "+this.image_size+"; line-height: "+this.image_size+"; background: url("+this.star_image+") "+f+" "+g+'; float: left; padding: 0px; marging: 0px; margin: 0px;"> </div>';b+='<div id="'+this.varname+"_msg_"+h+'" style="text-align: center; font:'+this.font+"; color: #"+this.font_color+'; float:left; padding: 0px 4px;">'+e[h]+"</div>"}b+="</div>"}b+=this.buildPopup();if(this.font_position=="bottom"){b+=pc+c+pc}else{if(this.font_position=="right"){b+=c+pc}}a.innerHTML=b+'<img src="'+(this.is_secure()?"https:":"http:")+'//pixel.quantserve.com/pixel/p-ab3gTb8xb3dLg.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/>'};this.buildPopup=function(){var a=true;if(this.popup=="off"){a=false;this.get_results(99)}if($("pd_popup_holder_"+this.id+this.item_id)==null){var b="#pd_popup_holder_"+this.id+this.item_id+" { position:absolute; display:none; width:"+(a?"350":"175")+"px; height:auto; top:0px; left:0px; z-index:10000; border:solid 1px #CCC; background-color:white; padding:0px 15px;font-family:Arial,Sans;box-shadow: -10px 10px 20px rgba(0, 0, 0, .5);-webkit-box-shadow: 0px 0px 6px rgba(0, 0, 0, .25);-moz-box-shadow: 0px 0px 6px rgba(0, 0, 0, .25); }";var c=document.createElement("style");c.setAttribute("type","text/css");c.setAttribute("id","pd_popup_holder_style_"+this.id+this.item_id);if(c.styleSheet){c.styleSheet.cssText=b}else{c.appendChild(document.createTextNode(b))}var d=document.getElementsByTagName("head").item(0);d.appendChild(c)}return'<span style="float:left;"> </span><div id="rating_info_'+this.id+this.item_id+'" style="display:'+(a?"block":"none")+";float:left;background:url("+(this.is_secure()?"https://polldaddy.com":"http://i0.poll.fm")+'/images/ratings/info.png) no-repeat 3px 2px;width:16px;height:16px;cursor:pointer;" onclick="javascript:'+this.varname+'.togglePopup();return false;"><span style="display:none;">i</span></div><div class="pd_popup_holder" id="pd_popup_holder_'+this.id+this.item_id+'"> </div>'};this.togglePopup=function(){var a=$("pd_popup_holder_"+this.id+this.item_id);if(a.style.display=="block"){a.style.display="none";$("rating_info_"+this.id+this.item_id).style.border=""}else{this.get_results(0)}};this.showPopup=function(){var a=$("pd_popup_holder_"+this.id+this.item_id);var b=$("rating_info_"+this.id+this.item_id);a.style.display="block";var c=this.getElementPos(b);var d=this.getElementSize(b);var e=this.getViewPos();var f=this.getViewSize();var g=this.getElementSize(a);var h=x=y=0;var i=border=1;var j=$("pd_rate_"+this.id+this.item_id).offsetWidth+border*2;var k=x=c[h]-j;var l=f[h];var m=e[h];var n=g[h];var o=d[h];var p=0;if(k+n-m>l){p=k+j-n+o;if(p<l+m&&p>0){x=p}}var q=d[i]+border*2;k=y=c[i]+q;var r=f[i];var s=e[i];var t=g[i];var u=d[i];var v=0;if(k+t-s>r){v=k-q-t;if(v<r+s&&v>0){y=v}}a.style.left=x+"px";a.style.top=y+"px"};this.popdown=function(a){$("pd_popup_holder_"+this.id+this.item_id).style.display="none"};this.getElementPos=function(a){var b=e2=a;var c=y=0;if(b.offsetParent){do{c+=b.offsetLeft;y+=b.offsetTop}while(b=b.offsetParent)}while((e2=e2.parentNode)&&e2.nodeName.toUpperCase()!=="BODY"){c-=e2.scrollLeft;y-=e2.scrollTop}return[c,y]};this.getElementSize=function(a){return[a.offsetWidth,a.offsetHeight]};this.getViewPos=function(){if(typeof window.pageYOffset==="number"){return[window.pageXOffset,window.pageYOffset]}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){return[document.documentElement.scrollLeft,document.documentElement.scrollTop]}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){return[document.body.scrollLeft,document.body.scrollTop]}else{return[0,0]}}}};this.getViewSize=function(){if(typeof window.innerWidth==="number"){return[window.innerWidth,window.innerHeight]}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){return[document.documentElement.clientWidth,document.documentElement.clientHeight]}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){return[document.body.clientWidth,document.body.clientHeight]}else{return[0,0]}}}};this.get_results=function(a){var b="";var c="";if(typeof document.lastChild.attributes!=="undefined"&&document.lastChild.attributes!=null){if(typeof document.lastChild.attributes.dir!=="undefined"&&document.lastChild.attributes.dir!=null){c="&dir="+document.lastChild.attributes.dir.textContent}}for(var d in ratings_text){if(PDRTJS_is_defined(this[d])&&this[d]!=ratings_text[d]){b+="&"+d+"="+PDRTJS_url_encode(this[d])}}var e=this.id;if(this.override!=null){e=this.override}this.make_call("/ratings/rating-results.php?id="+e+"&item_id="+this.item_id+"&period="+a+"&item_count=3"+(this.popup=="off"?"&off":"")+b+c)};this.rebuild=function(){if(!this.kill_hover){this.timeout_id=setTimeout(this.varname+".build()",800)}};this.cancel_rebuild=function(){if(this.timeout_id!=null){clearTimeout(this.timeout_id);this.timeout_id=null}};this.rate=function(a){if(!this.kill_hover){var b=this.get_voter_id();if(this.type=="stars"){$(this.varname+"_msg").innerHTML=this.text_thank_you}else{$(this.varname+"_msg").innerHTML=this.text_thank_you;if(b==0){if(a==1){$(this.varname+"_msg_1").innerHTML=this.nero_up+1}else{$(this.varname+"_msg_2").innerHTML=this.nero_dn+1}}}this.kill_hover=true;var c="";var d="&cmd=rate";var e="";if(this.type=="stars"){e="&votes="+this.votes+"&avg="+this.avg_rating}else{e="&up="+this.nero_up+"&down="+this.nero_dn}if(b!=0){d="&cmd=change&vid="+PDRTJS_url_encode(b)}else{d="&cmd=rate"}c="/ratings/rate.php?title="+PDRTJS_url_encode(this.title)+"&permalink="+PDRTJS_url_encode(this.permalink)+"&type="+this.type+"&id="+this.id+"&r="+a+"&uid="+this.unique_id+"&item_id="+this.item_id+e+d+"&token="+this.token;this.make_call(c);setTimeout(this.varname+".build()",2e3);setTimeout(this.varname+".kill_hover = false",6e3)}};this.hover=function(rating){if(!this.kill_hover){if(this.type=="stars"){this.cancel_rebuild();for(c=1;c<=5;c++){if(c<=rating){$(this.varname+"_stars_"+c).style.background="url("+this.star_image+") top right"}else{$(this.varname+"_stars_"+c).style.background="url("+this.star_image+") bottom right"}}$(this.varname+"_msg").innerHTML=eval("this.text_"+rating+"_star")}else{this.cancel_rebuild();var image_pos=" top left";var msg=this.text_rate_up;if(rating==2){image_pos=" top right";msg=this.text_rate_down}$(this.varname+"_nero_"+rating).style.background="url("+this.star_image+") "+image_pos;$(this.varname+"_msg_"+rating).style.fontWeight="bold";$(this.varname+"_msg").innerHTML=msg}}};this.set_voter_id=function(a){if(this.voter_id!=null){if(document.cookie.length>4e3){var b=document.cookie.split(";");var c=new Array;var d=0;var e=0;for(var f=0;f<b.length;f++){var g=b[f];if(g.indexOf("PDRTJS_")!=-1){g=g.replace(/^\s\s*/,"").replace(/\s\s*$/,"");e+=g.length;c[d++]=g}}if(e>3e3){for(var f=0;f<c.length;f++){var g=c[f];e-=g.length;var h=g.indexOf("=");if(h>0){g=unescape(g.substring(0,h))}document.cookie=g+"=0;expires=Thu, 01-Jan-1970 00:00:01 GMT;path=/;";if(e<3e3){break}}}}a=typeof a=="undefined"?30:parseInt(a);var i=new Date;i.setTime(i.getTime());var j=60*60*24*a*1e3;var k=new Date(i.getTime()+j);var l="PDRTJS_"+this.type+"_"+this.id+(this.item_id.length>0?this.item_id:escape(this.unique_id));document.cookie=l+"="+escape(this.voter_id)+";expires="+k.toGMTString()+";path=/;"}};this.get_voter_id=function(){var a="PDRTJS_"+this.type+"_"+this.id+(this.item_id.length>0?this.item_id:escape(this.unique_id));var b=""+document.cookie;var c=b.indexOf(a+"=");if(c==-1||a==""){return 0}else{var d=b.indexOf(";",c);if(d==-1){d=b.length}return unescape(b.substring(c+a.length+1,d))}};this.is_secure=function(){return"https:"==document.location.protocol?true:false};if(this.item_id==null){this.item_id=""}this.get_rating()}var ratings_text=new Array;ratings_text.text_vote="Vote";ratings_text.text_votes="Votes";ratings_text.text_rate_this="Rate This";ratings_text.text_1_star="1 star";ratings_text.text_2_star="2 stars";ratings_text.text_3_star="3 stars";ratings_text.text_4_star="4 stars";ratings_text.text_5_star="5 stars";ratings_text.text_thank_you="Thank You";ratings_text.text_rate_up="Rate Up";ratings_text.text_rate_down="Rate Down";ratings_text.text_popcontent="Most Popular Content";ratings_text.text_close="Close";ratings_text.text_all="All";ratings_text.text_today="Today";ratings_text.text_thisweek="This Week";ratings_text.text_thismonth="This Month";ratings_text.text_rated="Rated";ratings_text.text_noratings="There are no rated items for this period";var PDRTJS_doc=document.getElementsByTagName("div");var PDRTJS_id="";for(var i=0;i<PDRTJS_doc.length;i++){if(PDRTJS_doc[i].id.substring(0,17)=="pd_rating_holder_"){PDRTJS_id=PDRTJS_doc[i].id.replace(/pd_rating_holder_/,"");eval("if ( typeof PDRTJS_"+PDRTJS_id+" == 'undefined' ){PDRTJS_"+PDRTJS_id+" = new PDRTJS_RATING( PDRTJS_settings_"+PDRTJS_id+" );}")}}
 
1
+ //v1.73 10/Apr/13
2
+ var pd_map={image_path:("https:"==document.location.protocol?"https://polldaddy.com":"http://i0.poll.fm")+"/images/ratings"};function PDRTJS_url_encode(A){return encodeURIComponent(A).replace(/\%20/g,"+").replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/\~/g,"%7E")}function PDRTJS_is_defined(A){return(typeof A=="undefined")?false:true}var ratings_text=new Array();ratings_text.text_vote="Vote";ratings_text.text_votes="Votes";ratings_text.text_rate_this="Rate This";ratings_text.text_1_star="1 star";ratings_text.text_2_star="2 stars";ratings_text.text_3_star="3 stars";ratings_text.text_4_star="4 stars";ratings_text.text_5_star="5 stars";ratings_text.text_thank_you="Thank You";ratings_text.text_rate_up="Rate Up";ratings_text.text_rate_down="Rate Down";ratings_text.text_popcontent="Most Popular Content";ratings_text.text_close="Close";ratings_text.text_all="All";ratings_text.text_today="Today";ratings_text.text_thisweek="This Week";ratings_text.text_thismonth="This Month";ratings_text.text_rated="Rated";ratings_text.text_noratings="There are no rated items for this period";function PDRTJS_RATING(settings){if(window.devicePixelRatio>1){this.resolution="retina"}else{this.resolution="lowres"}var server=("https:"==document.location.protocol?"https:":"http:")+"//polldaddy.com";for(var property in settings){this[property]=settings[property]}function $(id){return document.getElementById(id)}var pc='<p style="padding: 0px; margin: 0px; clear: both;"></p>';var c=0;var token="";this.make_call=function(url){if(this.override!=null){url=url+"&override=true"}var s=document.createElement("SCRIPT");s.charset="utf-8";s.src=server+url;var h=document.getElementsByTagName("head").item(0);h.appendChild(s)};this.callback=function(cb_id,cb_unique_id,cb_type,cb_rating,cb_voter_id,cb_vote_change){if(this.callback_url!=null){true_callback_url=this.callback_url.replace(/{id}/,cb_id);true_callback_url=true_callback_url.replace(/{unique_id}/,cb_unique_id);true_callback_url=true_callback_url.replace(/{type}/,cb_type);true_callback_url=true_callback_url.replace(/{r}/,cb_rating);true_callback_url=true_callback_url.replace(/{voter_id}/,cb_voter_id);if(cb_type=="stars"){true_callback_url=true_callback_url.replace(/{scores}/,this.votes+","+this.avg_rating)}else{true_callback_url=true_callback_url.replace(/{scores}/,this.nero_up+","+this.nero_dn)}if(cb_vote_change){true_callback_url=true_callback_url+"&change=true"}var s=document.createElement("SCRIPT");s.charset="utf-8";s.src=true_callback_url;var h=document.getElementsByTagName("head").item(0);h.appendChild(s)}};this.get_rating=function(){this.varname="PDRTJS_"+this.id+this.item_id;this.make_call("/ratings/rate.php?cmd=get&id="+this.id+"&uid="+this.unique_id+"&item_id="+this.item_id)};this.init=function(){eval("settings = PDRTJS_settings_"+this.id+this.item_id+";");for(var property in settings){this[property]=settings[property]}this.build()};this.build=function(){this.font=this.font_italic+" "+this.font_bold+" "+this.font_size+"/"+this.font_line_height+" "+this.font_family;var p=$("pd_rating_holder_"+this.id+this.item_id);p.style.display="inline-block";this.star_margin="1px";if(this.custom_star.length>0){this.star_image=this.custom_star;this.star_margin="1px"}else{this.star_image=pd_map.image_path;if(this.type=="stars"){if(this.resolution=="retina"){this.star_image+="/star-"+this.star_color+"-"+this.size+"@2x.png"}else{this.star_image+="/star-"+this.star_color+"-"+this.size+".png"}}else{if(this.resolution=="retina"){this.star_image+="/nero-"+this.star_color+"-"+this.size+"@2x.png"}else{this.star_image+="/nero-"+this.star_color+"-"+this.size+".png"}}}image_sizes={nero:{lowres:{sml:{width:"16px",height:"16px",bg_width:"32px",bg_height:"32px"},med:{width:"20px",height:"20px",bg_width:"40px",bg_height:"40px"},lrg:{width:"24px",height:"24px",bg_width:"48px",bg_height:"48px"}},retina:{sml:{width:"16px",height:"16px",bg_width:"32px",bg_height:"32px"},med:{width:"32px",height:"32px",bg_width:"64px",bg_height:"64px"},lrg:{width:"48px",height:"48px",bg_width:"96px",bg_height:"96px"}}},stars:{lowres:{sml:{width:"16px",height:"16px",bg_width:"32px",bg_height:"48px"},med:{width:"20px",height:"20px",bg_width:"40px",bg_height:"60px"},lrg:{width:"24px",height:"24px",bg_width:"48px",bg_height:"72px"}},retina:{sml:{width:"16px",height:"16px",bg_width:"32px",bg_height:"48px"},med:{width:"20px",height:"20px",bg_width:"40px",bg_height:"60px"},lrg:{width:"24px",height:"24px",bg_width:"48px",bg_height:"72px"}}}};if(this.type=="stars"){var h="";var t="";var image_pos="bottom left";var msg=this.text_rate_this;if(this.votes>0){image_pos="top left";msg=this.votes+" ";if(this.votes==1&&(typeof this.text_vote!="undefined")){msg+=this.text_vote}else{msg+=this.text_votes}}if(this.font_position=="right"){t='<div class="rating-msg" id="'+this.varname+'_msg" style="float:left; padding-left: 5px; text-align: '+this.font_align+"; font:"+this.font+"; color: #"+this.font_color+';">'+msg+"</div>"}else{t='<div class="rating-msg" id="'+this.varname+'_msg" style="text-align: '+this.font_align+";font:"+this.font+";color: #"+this.font_color+';">'+msg+"</div>"}if(this.font_position=="top"){h+=t+pc}h+='<div class="rating-icons" id="pd_rate_'+this.id+this.item_id+'" style="float:left;">';for(c=1;c<=5;c++){if(this.avg_rating>0){if(this.avg_rating<c){image_pos="bottom left"}if(this.avg_rating==(c-1+0.5)){image_pos="center left"}}h+='<div class="rating-star-icon" onmouseout="'+this.varname+'.rebuild();" onclick="'+this.varname+".rate("+c+');" onmouseover="'+this.varname+".hover("+c+');" id="'+this.varname+"_stars_"+c+'" style="background-size: '+image_sizes[this.type][this.resolution][this.size]["bg_width"]+" "+image_sizes[this.type][this.resolution][this.size]["bg_height"]+"!important; cursor: pointer; width: "+image_sizes[this.type][this.resolution][this.size]["width"]+"; height: "+image_sizes[this.type][this.resolution][this.size]["width"]+"; line-height: "+image_sizes[this.type][this.resolution][this.size]["height"]+"; background: url("+this.star_image+") "+image_pos+"; float: left; padding: 0px; marging: 0px; margin-right: "+this.star_margin+';">&nbsp;</div>'}h+="</div>"}else{var h="";var t="";var image_pos_v="bottom";var image_pos_h="left";var msg=new Array();msg[0]=this.text_rate_this;msg[1]="";msg[2]="";var c=0;if(this.nero_up!=null){msg[1]=this.nero_up}else{this.nero_up=0;msg[1]="0"}if(this.nero_dn!=null){msg[2]=this.nero_dn}else{this.nero_dn=0;msg[2]="0"}if(this.font_position=="right"){t='<div class="rating-msg" id="'+this.varname+'_msg" style="float:left; padding-left: 5px; text-align: '+this.font_align+"; font:"+this.font+"; color: #"+this.font_color+';">'+msg[0]+"</div>"}else{t='<div class="rating-msg" id="'+this.varname+'_msg" style="text-align: '+this.font_align+"; font:"+this.font+"; color: #"+this.font_color+';">'+msg[0]+"</div>"}if(this.font_position=="top"){h+=t+pc}h+='<div class="rating-icons" id="pd_rate_'+this.id+this.item_id+'" style="float:left;">';for(c=1;c<=2;c++){if(c==2){image_pos_h="right"}h+='<div class="rating-nero-icon" onmouseout="'+this.varname+'.rebuild();" onclick="'+this.varname+".rate("+c+');" onmouseover="'+this.varname+".hover("+c+');" id="'+this.varname+"_nero_"+c+'" style="background-size: '+image_sizes[this.type][this.resolution][this.size]["bg_width"]+" "+image_sizes[this.type][this.resolution][this.size]["bg_height"]+";cursor: pointer; width: "+image_sizes[this.type][this.resolution][this.size]["width"]+"; height: "+image_sizes[this.type][this.resolution][this.size]["height"]+"; line-height: "+image_sizes[this.type][this.resolution][this.size]["height"]+"; background: url("+this.star_image+") "+image_pos_v+" "+image_pos_h+'; float: left; padding: 0px; marging: 0px; margin: 0px;">&nbsp;</div>';h+='<div class="rating-nero-value" id="'+this.varname+"_msg_"+c+'" style="text-align: center; font:'+this.font+"; color: #"+this.font_color+'; float:left; padding: 0px 4px;">'+msg[c]+"</div>"}h+="</div>"}h+=this.buildPopup();if(this.font_position=="bottom"){h+=pc+t+pc}else{if(this.font_position=="right"){h+=t+pc}}p.innerHTML=h+'<img src="'+(this.is_secure()?"https:":"http:")+'//pixel.quantserve.com/pixel/p-ab3gTb8xb3dLg.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/>'};this.buildPopup=function(){var show=true;if(this.popup=="off"){show=false;this.get_results(99)}if($("pd_popup_holder_"+this.id+this.item_id)==null){var _css="#pd_popup_holder_"+this.id+this.item_id+" { position:absolute; display:none; width:"+(show?"350":"175")+"px; height:auto; top:0px; left:0px; z-index:10000; border:solid 1px #CCC; background-color:white; padding:0px 15px;font-family:Arial,Sans;box-shadow: -10px 10px 20px rgba(0, 0, 0, .5);-webkit-box-shadow: 0px 0px 6px rgba(0, 0, 0, .25);-moz-box-shadow: 0px 0px 6px rgba(0, 0, 0, .25); }";var s=document.createElement("style");s.setAttribute("type","text/css");s.setAttribute("id","pd_popup_holder_style_"+this.id+this.item_id);if(s.styleSheet){s.styleSheet.cssText=_css}else{s.appendChild(document.createTextNode(_css))}var h=document.getElementsByTagName("head").item(0);h.appendChild(s)}if(this.resolution=="retina"){infopng="/info@2x.png";backgroundsize="background-size:12px 12px;"}else{infopng="/info.png";backgroundsize=null}return'<span style="float:left;">&nbsp;</span><div id="rating_info_'+this.id+this.item_id+'" style="display:'+(show?"block":"none")+";float:left;background:url("+pd_map.image_path+infopng+") no-repeat 3px 2px;width:16px;height:16px;cursor:pointer; "+backgroundsize+' " onclick="javascript:'+this.varname+'.togglePopup();return false;"><span style="display:none;">i</span></div><div class="pd_popup_holder" id="pd_popup_holder_'+this.id+this.item_id+'">&nbsp;</div>'};this.togglePopup=function(){var popup=$("pd_popup_holder_"+this.id+this.item_id);if(popup.style.display=="block"){popup.style.display="none";$("rating_info_"+this.id+this.item_id).style.border=""}else{this.get_results(0)}};this.showPopup=function(){var popup=$("pd_popup_holder_"+this.id+this.item_id);var target=$("rating_info_"+this.id+this.item_id);popup.style.display="block";var tp=this.getElementPos(target);var ts=this.getElementSize(target);var vp=this.getViewPos();var vs=this.getViewSize();var ps=this.getElementSize(popup);var a=x=y=0;var b=border=1;var x_offset=$("pd_rate_"+this.id+this.item_id).offsetWidth+(border*2);var target_point=x=(tp[a]-x_offset);var view_width=vs[a];var view_position_width=vp[a];var popup_width=ps[a];var target_width=ts[a];var try_x=0;if(((target_point+popup_width)-view_position_width)>view_width){try_x=((target_point+x_offset)-popup_width)+target_width;if(try_x<(view_width+view_position_width)&&try_x>0){x=try_x}}var y_offset=ts[b]+(border*2);target_point=y=(tp[b]+y_offset);var view_height=vs[b];var view_position_height=vp[b];var popup_height=ps[b];var icon_height=ts[b];var try_y=0;if(((target_point+popup_height)-view_position_height)>view_height){try_y=((target_point-y_offset)-popup_height);if(try_y<(view_height+view_position_height)&&try_y>0){y=try_y}}popup.style.left=x+"px";popup.style.top=y+"px"};this.popdown=function(parent){$("pd_popup_holder_"+this.id+this.item_id).style.display="none"};this.getElementPos=function(e){var e1=e2=e;var x=y=0;if(e1.offsetParent){do{x+=e1.offsetLeft;y+=e1.offsetTop}while(e1=e1.offsetParent)}while((e2=e2.parentNode)&&e2.nodeName.toUpperCase()!=="BODY"){x-=e2.scrollLeft;y-=e2.scrollTop}return[x,y]};this.getElementSize=function(e){return[e.offsetWidth,e.offsetHeight]};this.getViewPos=function(){if(typeof window.pageYOffset==="number"){return[window.pageXOffset,window.pageYOffset]}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){return[document.documentElement.scrollLeft,document.documentElement.scrollTop]}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){return[document.body.scrollLeft,document.body.scrollTop]}else{return[0,0]}}}};this.getViewSize=function(){if(typeof window.innerWidth==="number"){return[window.innerWidth,window.innerHeight]}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){return[document.documentElement.clientWidth,document.documentElement.clientHeight]}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){return[document.body.clientWidth,document.body.clientHeight]}else{return[0,0]}}}};this.get_results=function(period){var args="";var dir="";if(typeof document.lastChild.attributes!=="undefined"&&document.lastChild.attributes!=null){if(typeof document.lastChild.attributes.dir!=="undefined"&&document.lastChild.attributes.dir!=null){dir="&dir="+document.lastChild.attributes.dir.textContent}}for(var key in ratings_text){if(PDRTJS_is_defined(this[key])&&this[key]!=ratings_text[key]){args+="&"+key+"="+PDRTJS_url_encode(this[key])}}var id=this.id;if(this.override!=null){id=this.override}this.make_call("/ratings/rating-results.php?id="+id+"&item_id="+this.item_id+"&period="+period+"&item_count=3"+((this.popup=="off")?"&off":"")+args+dir)};this.rebuild=function(){if(!this.kill_hover){this.timeout_id=setTimeout(this.varname+".build()",800)}};this.cancel_rebuild=function(){if(this.timeout_id!=null){clearTimeout(this.timeout_id);this.timeout_id=null}};this.rate=function(rating){if(!this.kill_hover){var voter_id=this.get_voter_id();if(this.type=="stars"){$(this.varname+"_msg").innerHTML=this.text_thank_you}else{$(this.varname+"_msg").innerHTML=this.text_thank_you;if(voter_id==0){if(rating==1){$(this.varname+"_msg_1").innerHTML=(this.nero_up+1)}else{$(this.varname+"_msg_2").innerHTML=(this.nero_dn+1)}}}this.kill_hover=true;var url="";var params="&cmd=rate";var scores="";if(this.type=="stars"){scores="&votes="+this.votes+"&avg="+this.avg_rating}else{scores="&up="+this.nero_up+"&down="+this.nero_dn}if(voter_id!=0){params="&cmd=change&vid="+PDRTJS_url_encode(voter_id)}else{params="&cmd=rate"}url="/ratings/rate.php?title="+PDRTJS_url_encode(this.title)+"&permalink="+PDRTJS_url_encode(this.permalink)+"&type="+this.type+"&id="+this.id+"&r="+rating+"&uid="+this.unique_id+"&item_id="+this.item_id+scores+params+"&token="+this.token;this.make_call(url);setTimeout(this.varname+".build()",2000);setTimeout(this.varname+".kill_hover = false",6000)}};this.hover=function(rating){if(!this.kill_hover){if(this.type=="stars"){this.cancel_rebuild();for(c=1;c<=5;c++){if(c<=rating){$(this.varname+"_stars_"+c).style.background="url("+this.star_image+") top right"}else{$(this.varname+"_stars_"+c).style.background="url("+this.star_image+") bottom right"}}$(this.varname+"_msg").innerHTML=eval("this.text_"+rating+"_star")}else{this.cancel_rebuild();var image_pos=" top left";var msg=this.text_rate_up;if(rating==2){image_pos=" top right";msg=this.text_rate_down}$(this.varname+"_nero_"+rating).style.background="url("+this.star_image+") "+image_pos;$(this.varname+"_msg_"+rating).style.fontWeight="bold";$(this.varname+"_msg").innerHTML=msg}}};this.set_voter_id=function(days){if(this.voter_id!=null){if(document.cookie.length>4000){var ca=document.cookie.split(";");var pdca=new Array();var pdi=0;var pds=0;for(var i=0;i<ca.length;i++){var c=ca[i];if(c.indexOf("PDRTJS_")!=-1){c=c.replace(/^\s\s*/,"").replace(/\s\s*$/,"");pds+=c.length;pdca[pdi++]=c}}if(pds>3000){for(var i=0;i<pdca.length;i++){var c=pdca[i];pds-=c.length;var eq=c.indexOf("=");if(eq>0){c=unescape(c.substring(0,eq))}document.cookie=c+"=0;expires=Thu, 01-Jan-1970 00:00:01 GMT;path=/;";if(pds<3000){break}}}}days=(typeof days=="undefined")?30:parseInt(days);var today=new Date();today.setTime(today.getTime());var expires=60*60*24*days*1000;var expires_date=new Date(today.getTime()+(expires));var name="PDRTJS_"+this.type+"_"+this.id+(this.item_id.length>0?this.item_id:escape(this.unique_id));document.cookie=name+"="+escape(this.voter_id)+";expires="+expires_date.toGMTString()+";path=/;"}};this.get_voter_id=function(){var name="PDRTJS_"+this.type+"_"+this.id+(this.item_id.length>0?this.item_id:escape(this.unique_id));var the_cookie=""+document.cookie;var ind=the_cookie.indexOf(name+"=");if(ind==-1||name==""){return 0}else{var ind1=the_cookie.indexOf(";",ind);if(ind1==-1){ind1=the_cookie.length}return unescape(the_cookie.substring(ind+name.length+1,ind1))}};this.is_secure=function(){return"https:"==document.location.protocol?true:false};if(this.item_id==null){this.item_id=""}this.get_rating()}var PDRTJS_doc=document.getElementsByTagName("div");var PDRTJS_id="";for(var i=0;i<PDRTJS_doc.length;i++){if(PDRTJS_doc[i].id.substring(0,17)=="pd_rating_holder_"){PDRTJS_id=PDRTJS_doc[i].id.replace(/pd_rating_holder_/,"");eval("if ( typeof PDRTJS_"+PDRTJS_id+" == 'undefined' ){PDRTJS_"+PDRTJS_id+" = new PDRTJS_RATING( PDRTJS_settings_"+PDRTJS_id+" );}")}};
js/style-editor.js CHANGED
@@ -1 +1 @@
1
- function mouseDown(a){a=a||window.event;var b=a.target||a.srcElement;if(_$("P_tab")){if(_$("P_tab").style.display=="block"){try{if(b.parentNode.parentNode.parentNode.parentNode.parentNode.id!="P_tab"){_$("P_tab").style.display="none"}}catch(c){_$("P_tab").style.display="none"}}}}function submitCSSEditor(){if(_$("styleTitle").value.trim().length>0){_$("formXML").submit()}else{_$("styleTitleErr").style.display="block"}}function CSSE_changeView(a){_$("A_"+currentTag).className="Aoff";_$("D_"+currentTag).className="off";_$("edit"+currentTag).style.display="none";_$("A_"+a).className="Aon";_$("D_"+a).className="on";_$("edit"+a).style.display="block";currentTag=a}function CSSE_showTag(a){if(a!=null){_$("D_"+a).style.display="block"}else{_$("D_Border").style.display="none";_$("D_Font").style.display="none";_$("D_Background").style.display="none";_$("D_Margin").style.display="none";_$("D_Padding").style.display="none";_$("D_Scale").style.display="none";_$("D_Height").style.display="none"}}function showResults(a){if(a){_$("divAnswers").style.display="none";_$("divResults").style.display="block";_$("pds-links-back").style.display="block";_$("pds-links").style.display="none";_$("pds-totalvotes-inner").style.display="block";_$("pds-question-top").innerHTML=pd_map.thankyou}else{_$("divAnswers").style.display="block";_$("divResults").style.display="none";_$("pds-links-back").style.display="none";_$("pds-links").style.display="block";_$("pds-totalvotes-inner").style.display="none";_$("pds-question-top").innerHTML=pd_map.question}}function renderStyleEdit(a){firstRun=true;switch(a){case"pds-box":{showResults(false);break};case"pds-question-top":{showResults(false);break};case"pds-box":{showResults(false);break};case"pds-answer-group":{showResults(false);break};case"pds-answer-input":{showResults(false);break};case"pds-answer":{showResults(false);break};case"pds-link":{showResults(false);break};case"pds-textfield":{showResults(false);break};case"pds-vote-button":{showResults(false);break};case"pds-answer-feedback":{showResults(true);break};case"pds-answer-feedback-bar":{showResults(true);break};case"pds-totalvotes-inner":{showResults(true);break}}_$("editBorder").style.display="none";_$("editFont").style.display="none";_$("editBackground").style.display="none";_$("editMargin").style.display="none";_$("editPadding").style.display="none";_$("editScale").style.display="none";_$("editHeight").style.display="none";CSSE_showTag(null);currentStyle=a;for(i=0;i<CSSXML.childNodes.length;i++){if(CSSXML.childNodes[i].nodeType!=3){for(x=0;x<CSSXML.childNodes[i].childNodes.length;x++){if(CSSXML.childNodes[i].childNodes[x].nodeType!=3){styleGroup=CSSXML.childNodes[i].childNodes[x];if(styleGroup.nodeName==a){for(y=0;y<styleGroup.childNodes.length;y++){for(z=0;z<styleGroup.childNodes[y].attributes.length;z++){attrName=styleGroup.childNodes[y].attributes[z].name;attrValue=styleGroup.childNodes[y].attributes[z].value;switch(_$(attrName).nodeName){case"SELECT":{for(q=0;q<_$(attrName).length;q++){if(_$(attrName).options[q].value==attrValue){_$(attrName).options[q].selected=true;break}}break};case"INPUT":{if(_$(attrName).attributes["type"].value=="checkbox"){if(attrValue!="none"&&attrValue!="normal"){_$(attrName).checked=true}else{_$(attrName).checked=false}}else{if(attrValue=="Transparent"){_$(attrName).value=""}else{_$(attrName).value=attrValue}}break}}}if(firstRun==true){switch(styleGroup.childNodes[y].nodeName){case"border":{CSSE_changeView("Border");CSSE_showTag("Border");break};case"font":{CSSE_changeView("Font");CSSE_showTag("Font");break};case"background":{CSSE_changeView("Background");CSSE_showTag("Background");break};case"margin":{CSSE_changeView("Margin");CSSE_showTag("Margin");break};case"padding":{CSSE_changeView("Padding");CSSE_showTag("Padding");break};case"scale":{CSSE_changeView("Scale");CSSE_showTag("Scale");break};case"height":{CSSE_changeView("Height");CSSE_showTag("Height");break}}firstRun=false}switch(styleGroup.childNodes[y].nodeName){case"border":{CSSE_showTag("Border");break};case"font":{CSSE_showTag("Font");break};case"background":{CSSE_showTag("Background");break};case"margin":{CSSE_showTag("Margin");break};case"padding":{CSSE_showTag("Padding");break};case"scale":{CSSE_showTag("Scale");break};case"height":{CSSE_showTag("Height");break}}}}}}break}}}function loadStyle(){loadCSSXML();for(i=0;i<CSSXML.childNodes.length;i++){if(CSSXML.childNodes[i].nodeType!=3){for(x=0;x<CSSXML.childNodes[i].childNodes.length;x++){if(CSSXML.childNodes[i].childNodes[x].nodeType!=3){currentStyle=CSSXML.childNodes[i].childNodes[x].nodeName;styleGroup=CSSXML.childNodes[i].childNodes[x];for(y=0;y<styleGroup.childNodes.length;y++){for(z=0;z<styleGroup.childNodes[y].attributes.length;z++){bind(styleGroup.childNodes[y].attributes[z].name,styleGroup.childNodes[y].attributes[z].value,true)}}}}break}}}function bindToXML(a,b){for(i=0;i<CSSXML.childNodes.length;i++){if(CSSXML.childNodes[i].nodeType!=3){for(x=0;x<CSSXML.childNodes[i].childNodes.length;x++){if(CSSXML.childNodes[i].childNodes[x].nodeType!=3){styleGroup=CSSXML.childNodes[i].childNodes[x];if(styleGroup.nodeName==currentStyle){for(y=0;y<styleGroup.childNodes.length;y++){if(styleGroup.childNodes[y].nodeType!=3){for(z=0;z<styleGroup.childNodes[y].attributes.length;z++){if(styleGroup.childNodes[y].attributes[z].name==a){switch(_$(a).nodeName){case"SELECT":{styleGroup.childNodes[y].attributes[z].value=b;break};case"INPUT":{if(_$(a).attributes["type"].value=="checkbox"){if(_$(a).id=="font-weight"&&_$(a).checked==false){styleGroup.childNodes[y].attributes[z].value="normal"}else if(_$(a).id=="font-style"&&_$(a).checked==false){styleGroup.childNodes[y].attributes[z].value="normal"}else if(_$(a).id=="text-decoration"&&_$(a).checked==false){styleGroup.childNodes[y].attributes[z].value="none"}else{styleGroup.childNodes[y].attributes[z].value=b}}else{styleGroup.childNodes[y].attributes[z].value=b}break}}break}}}}}}}break}}}function isNumeric(a){var b=/^[0-9]+$/;if(a.match(b)){return true}else{return false}}function isUrl(a){var b=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return b.test(a)}function isHex(a){if(a=="transparent"){return true}else{var b=/^#[0-9a-fA-F]{3,6}$/i;return b.test(a)}}function bind(a,b,c){var d=new bindObject(a,b);if(verifyBindValue(d)==null){return false}if(!c){bindToXML(d.elm,d.value)}bindToElement(d.elm,d.value,c);ShowXML()}function bindObject(a,b){this.elm=a;this.value=b}function verifyBindValue(a){elm=a.elm;value=a.value;if(!value){value=elm.value}if(elm.id){elm=elm.id}if(elm=="width"){if(isNumeric(value)==false){return null}}if(elm=="height"){if(isNumeric(value)==false){return null}}if(elm=="background-image"){if(value&&value.length&&value.length>0&&value!=elm){if(isUrl(value)==false){return null}}else return null}if(elm=="border-color"||elm=="color"||elm=="background-color"){if(value){if(value.indexOf("#")==-1)value="#"+value;if(isHex(value.toLowerCase())==false)return null}}a.elm=elm;a.value=value;return true}function bindToElement(a,b,c){var d=new bindObject(a,b);if(verifyBindValue(d)==null){return false}if(_$(currentStyle)==null||_$(currentStyle)=="undefined"){return false}var b=d.value;var e=_$(currentStyle).style;switch(d.elm){case"border-width":{e.borderWidth=b;break};case"border-radius":{e.MozBorderRadius=b;e.WebkitBorderRadius=b;break};case"border-style":{e.borderStyle=b;break};case"border-color":{if(b=="Transpa"){_$("border-color").value=""}e.borderColor=b;break};case"font-size":{e.fontSize=b;break};case"font-family":{e.fontFamily=b;break};case"font-weight":{if(c==true&&firstRun==true){e.fontWeight=b}else{if(_$(a).checked){e.fontWeight=b}else{e.fontWeight="normal"}}break};case"font-style":{if(c==true&&firstRun==true){e.fontStyle=b}else{if(_$(a).checked){e.fontStyle=b}else{e.fontStyle="normal"}}break};case"text-decoration":{if(c==true&&firstRun==true){e.textDecoration=b}else{if(_$(a).checked){e.textDecoration=b}else{e.textDecoration="none"}}break};case"line-height":{e.lineHeight=b;break};case"text-align":{e.textAlign=b;break};case"float":{e.cssFloat=b;break};case"color":{if(b=="Transpa"){_$("color").value=""}e.color=b;break};case"background-color":{if(b=="Transpa"){_$("background-color").value=""}e.backgroundColor=b;break};case"background-image":{if(b!=="undefined")e.backgroundImage="url("+b+")";break};case"background-repeat":{e.backgroundRepeat=b;break};case"background-position":{e.backgroundPosition=b;break};case"margin-top":{e.marginTop=b;break};case"margin-right":{e.marginRight=b;break};case"margin-bottom":{e.marginBottom=b;break};case"margin-left":{e.marginLeft=b;break};case"padding-top":{e.paddingTop=b;break};case"padding-right":{e.paddingRight=b;break};case"padding-bottom":{e.paddingBottom=b;break};case"padding-left":{e.paddingLeft=b;break};case"width":{e.width=b+"px";break};case"height":{e.height=b+"px";break};case"direction":{e.direction=b;break}}var f=["pds-link","pds-answer-group","pds-answer-input","pds-answer-feedback","pds-answer-feedback-bar","pds-feedback-group","pds-feedback-result","pds-feedback-per","pds-feedback-votes","pds-answer-text","pds-answer"];for(var g in f){var h=f[g];if(currentStyle.indexOf(h)==-1)continue;if(currentStyle==h){currentStyle=h+"1";if(!bindToElement(d.elm,b,c))currentStyle=h;break}else if(currentStyle==h+"1"){currentStyle=h+"2";if(!bindToElement(d.elm,b,c))currentStyle=h;break}else if(currentStyle==h+"2"){currentStyle=h+"3";if(!bindToElement(d.elm,b,c))currentStyle=h;break}else if(currentStyle==h+"3"){currentStyle=h;break}}return true}function force_rtl(){_$("style-force-rtl").style.display="none";_$("style-force-ltr").style.display="inline";var a=["pds-feedback-per","pds-feedback-votes"];var b=["pds-answer-input","pds-link","pds-textfield","pds-vote-button","pds-answer-feedback-bar","pds-totalvotes-inner","pds-answer-text","pds-answer-text","pds-answer"];var c=["pds-question-top","pds-answer","pds-link","pds-textfield","pds-vote-button","pds-totalvotes-inner","pds-answer-text","pds-feedback-per","pds-feedback-votes","pds-textfield"];for(var d in a){currentStyle=a[d];bind("float","left",false)}for(var d in b){currentStyle=b[d];bind("float","right",false)}for(var d in c){currentStyle=c[d];bind("text-align","right",false)}currentStyle="pds-box";bind("direction","rtl",false)}function force_ltr(){_$("style-force-rtl").style.display="inline";_$("style-force-ltr").style.display="none";var a=["pds-feedback-per","pds-feedback-votes"];var b=["pds-answer-input","pds-link","pds-textfield","pds-vote-button","pds-answer-feedback-bar","pds-totalvotes-inner","pds-answer-text","pds-answer-text","pds-answer"];var c=["pds-question-top","pds-answer","pds-link","pds-textfield","pds-vote-button","pds-totalvotes-inner","pds-answer-text","pds-feedback-per","pds-feedback-votes","pds-textfield"];for(var d in b){currentStyle=b[d];bind("float","left",false)}for(var d in a){currentStyle=a[d];bind("float","right",false)}for(var d in c){currentStyle=c[d];bind("text-align","left",false)}currentStyle="pds-box";bind("direction","ltr",false)}function loadCSSXML(){if(window.ActiveXObject){CSSXML=new ActiveXObject("Microsoft.XMLDOM");CSSXML.loadXML(CSSXMLString)}else{CSSXML=document.implementation.createDocument("","",null);objDOMParser=new DOMParser;CSSXML=objDOMParser.parseFromString(CSSXMLString,"text/xml")}}function ShowXML(){if(window.ActiveXObject){var a=CSSXML.xml}else if(document.implementation&&document.implementation.createDocument){var b=new XMLSerializer;var a=b.serializeToString(CSSXML)}document.getElementById("S_www").value=a}function submitStyleCSS(){pass=true;if(_$("styleName").value.trim().length==0){pass=false;_$("styleNameErr").style.display="block"}else{_$("styleNameErr").style.display="none"}if(_$("styleCSS").value.trim().length==0){pass=false;_$("styleCSSErr").style.display="block"}else{_$("styleCSSErr").style.display="none"}if(pass){_$("editStyle").submit()}}function preload_style(){if(_$("preload_value").value!="0"){window.location=window.location.href.replace(/(\&preload=(\d+))/g,"")+"&preload="+_$("preload_value").value}}document.onmousedown=mouseDown;var pd_map={thankyou:"Thank you for voting!",question:"Do you mostly use the internet at work, in school or at home?"};var currentTag="Background";var currentStyle;firstRun=true;
1
+ function mouseDown(e){e=e||window.event;var t=e.target||e.srcElement;if(_$("P_tab")){if(_$("P_tab").style.display=="block"){try{if(t.parentNode.parentNode.parentNode.parentNode.parentNode.id!="P_tab"){_$("P_tab").style.display="none"}}catch(n){_$("P_tab").style.display="none"}}}}function submitCSSEditor(){if(_$("styleTitle").value.trim().length>0){_$("formXML").submit()}else{_$("styleTitleErr").style.display="block"}}function CSSE_changeView(e){_$("A_"+currentTag).className="Aoff";_$("D_"+currentTag).className="off";_$("edit"+currentTag).style.display="none";_$("A_"+e).className="Aon";_$("D_"+e).className="on";_$("edit"+e).style.display="block";currentTag=e}function CSSE_showTag(e){if(e!=null){_$("D_"+e).style.display="block"}else{_$("D_Border").style.display="none";_$("D_Font").style.display="none";_$("D_Background").style.display="none";_$("D_Margin").style.display="none";_$("D_Padding").style.display="none";_$("D_Scale").style.display="none";_$("D_Height").style.display="none"}}function showResults(e){if(e){_$("divAnswers").style.display="none";_$("divResults").style.display="block";_$("pds-links-back").style.display="block";_$("pds-links").style.display="none";_$("pds-totalvotes-inner").style.display="block";_$("pds-question-top").innerHTML=pd_map.thankyou}else{_$("divAnswers").style.display="block";_$("divResults").style.display="none";_$("pds-links-back").style.display="none";_$("pds-links").style.display="block";_$("pds-totalvotes-inner").style.display="none";_$("pds-question-top").innerHTML=pd_map.question}}function renderStyleEdit(e){firstRun=true;switch(e){case"pds-box":{showResults(false);break};case"pds-question-top":{showResults(false);break};case"pds-box":{showResults(false);break};case"pds-answer-group":{showResults(false);break};case"pds-answer-input":{showResults(false);break};case"pds-answer":{showResults(false);break};case"pds-link":{showResults(false);break};case"pds-textfield":{showResults(false);break};case"pds-vote-button":{showResults(false);break};case"pds-answer-feedback":{showResults(true);break};case"pds-answer-feedback-bar":{showResults(true);break};case"pds-totalvotes-inner":{showResults(true);break}}_$("editBorder").style.display="none";_$("editFont").style.display="none";_$("editBackground").style.display="none";_$("editMargin").style.display="none";_$("editPadding").style.display="none";_$("editScale").style.display="none";_$("editHeight").style.display="none";CSSE_showTag(null);currentStyle=e;for(i=0;i<CSSXML.childNodes.length;i++){if(CSSXML.childNodes[i].nodeType!=3){for(x=0;x<CSSXML.childNodes[i].childNodes.length;x++){if(CSSXML.childNodes[i].childNodes[x].nodeType!=3){styleGroup=CSSXML.childNodes[i].childNodes[x];if(styleGroup.nodeName==e){for(y=0;y<styleGroup.childNodes.length;y++){for(z=0;z<styleGroup.childNodes[y].attributes.length;z++){attrName=styleGroup.childNodes[y].attributes[z].name;attrValue=styleGroup.childNodes[y].attributes[z].value;switch(_$(attrName).nodeName){case"SELECT":{for(q=0;q<_$(attrName).length;q++){if(_$(attrName).options[q].value==attrValue){_$(attrName).options[q].selected=true;break}}break};case"INPUT":{if(_$(attrName).attributes["type"].value=="checkbox"){if(attrValue!="none"&&attrValue!="normal"){_$(attrName).checked=true}else{_$(attrName).checked=false}}else{if(attrValue=="Transparent"){_$(attrName).value=""}else{_$(attrName).value=attrValue}}break}}}if(firstRun==true){switch(styleGroup.childNodes[y].nodeName){case"border":{CSSE_changeView("Border");CSSE_showTag("Border");break};case"font":{CSSE_changeView("Font");CSSE_showTag("Font");break};case"background":{CSSE_changeView("Background");CSSE_showTag("Background");break};case"margin":{CSSE_changeView("Margin");CSSE_showTag("Margin");break};case"padding":{CSSE_changeView("Padding");CSSE_showTag("Padding");break};case"scale":{CSSE_changeView("Scale");CSSE_showTag("Scale");break};case"height":{CSSE_changeView("Height");CSSE_showTag("Height");break}}firstRun=false}switch(styleGroup.childNodes[y].nodeName){case"border":{CSSE_showTag("Border");break};case"font":{CSSE_showTag("Font");break};case"background":{CSSE_showTag("Background");break};case"margin":{CSSE_showTag("Margin");break};case"padding":{CSSE_showTag("Padding");break};case"scale":{CSSE_showTag("Scale");break};case"height":{CSSE_showTag("Height");break}}}}}}break}}}function loadStyle(){loadCSSXML();for(i=0;i<CSSXML.childNodes.length;i++){if(CSSXML.childNodes[i].nodeType!=3){for(x=0;x<CSSXML.childNodes[i].childNodes.length;x++){if(CSSXML.childNodes[i].childNodes[x].nodeType!=3){currentStyle=CSSXML.childNodes[i].childNodes[x].nodeName;styleGroup=CSSXML.childNodes[i].childNodes[x];for(y=0;y<styleGroup.childNodes.length;y++){for(z=0;z<styleGroup.childNodes[y].attributes.length;z++){bind(styleGroup.childNodes[y].attributes[z].name,styleGroup.childNodes[y].attributes[z].value,true)}}}}break}}}function bindToXML(e,t){for(i=0;i<CSSXML.childNodes.length;i++){if(CSSXML.childNodes[i].nodeType!=3){for(x=0;x<CSSXML.childNodes[i].childNodes.length;x++){if(CSSXML.childNodes[i].childNodes[x].nodeType!=3){styleGroup=CSSXML.childNodes[i].childNodes[x];if(styleGroup.nodeName==currentStyle){for(y=0;y<styleGroup.childNodes.length;y++){if(styleGroup.childNodes[y].nodeType!=3){for(z=0;z<styleGroup.childNodes[y].attributes.length;z++){if(styleGroup.childNodes[y].attributes[z].name==e){switch(_$(e).nodeName){case"SELECT":{styleGroup.childNodes[y].attributes[z].value=t;break};case"INPUT":{if(_$(e).attributes["type"].value=="checkbox"){if(_$(e).id=="font-weight"&&_$(e).checked==false){styleGroup.childNodes[y].attributes[z].value="normal"}else if(_$(e).id=="font-style"&&_$(e).checked==false){styleGroup.childNodes[y].attributes[z].value="normal"}else if(_$(e).id=="text-decoration"&&_$(e).checked==false){styleGroup.childNodes[y].attributes[z].value="none"}else{styleGroup.childNodes[y].attributes[z].value=t}}else{styleGroup.childNodes[y].attributes[z].value=t}break}}break}}}}}}}break}}}function isNumeric(e){var t=/^[0-9]+$/;if(e.match(t)){return true}else{return false}}function isUrl(e){var t=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)}function isHex(e){if(e=="transparent"){return true}else{var t=/^#[0-9a-fA-F]{3,6}$/i;return t.test(e)}}function bind(e,t,n){var r=new bindObject(e,t);if(verifyBindValue(r)==null){return false}if(!n){bindToXML(r.elm,r.value)}bindToElement(r.elm,r.value,n);ShowXML()}function bindObject(e,t){this.elm=e;this.value=t}function verifyBindValue(e){elm=e.elm;value=e.value;if(!value){value=elm.value}if(elm.id){elm=elm.id}if(elm=="width"){if(isNumeric(value)==false){return null}}if(elm=="height"){if(isNumeric(value)==false){return null}}if(elm=="background-image"){if(value&&value.length&&value.length>0&&value!=elm){if(isUrl(value)==false){return null}}else return null}if(elm=="border-color"||elm=="color"||elm=="background-color"){if(value){if(value.indexOf("#")==-1)value="#"+value;if(isHex(value.toLowerCase())==false)return null}}e.elm=elm;e.value=value;return true}function bindToElement(e,t,n){var r=new bindObject(e,t);if(verifyBindValue(r)==null){return false}if(_$(currentStyle)==null||_$(currentStyle)=="undefined"){return false}var t=r.value;var i=_$(currentStyle).style;switch(r.elm){case"border-width":{i.borderWidth=t;break};case"border-radius":{i.MozBorderRadius=t;i.WebkitBorderRadius=t;break};case"border-style":{i.borderStyle=t;break};case"border-color":{if(t=="Transpa"){_$("border-color").value=""}i.borderColor=t;break};case"font-size":{i.fontSize=t;break};case"font-family":{i.fontFamily=t;break};case"font-weight":{if(n==true&&firstRun==true){i.fontWeight=t}else{if(_$(e).checked){i.fontWeight=t}else{i.fontWeight="normal"}}break};case"font-style":{if(n==true&&firstRun==true){i.fontStyle=t}else{if(_$(e).checked){i.fontStyle=t}else{i.fontStyle="normal"}}break};case"text-decoration":{if(n==true&&firstRun==true){i.textDecoration=t}else{if(_$(e).checked){i.textDecoration=t}else{i.textDecoration="none"}}break};case"line-height":{i.lineHeight=t;break};case"text-align":{i.textAlign=t;break};case"float":{i.cssFloat=t;break};case"color":{if(t=="Transpa"){_$("color").value=""}i.color=t;break};case"background-color":{if(t=="Transpa"){_$("background-color").value=""}i.backgroundColor=t;break};case"background-image":{if(t!=="undefined")i.backgroundImage="url("+t+")";break};case"background-repeat":{i.backgroundRepeat=t;break};case"background-position":{i.backgroundPosition=t;break};case"margin-top":{i.marginTop=t;break};case"margin-right":{i.marginRight=t;break};case"margin-bottom":{i.marginBottom=t;break};case"margin-left":{i.marginLeft=t;break};case"padding-top":{i.paddingTop=t;break};case"padding-right":{i.paddingRight=t;break};case"padding-bottom":{i.paddingBottom=t;break};case"padding-left":{i.paddingLeft=t;break};case"width":{i.width=t+"px";break};case"height":{i.height=t+"px";break};case"direction":{i.direction=t;break}}var s=["pds-link","pds-answer-group","pds-answer-input","pds-answer-feedback","pds-answer-feedback-bar","pds-feedback-group","pds-feedback-result","pds-feedback-per","pds-feedback-votes","pds-answer-text","pds-answer"];for(var o in s){var u=s[o];if(currentStyle.indexOf(u)==-1)continue;if(currentStyle==u){currentStyle=u+"1";if(!bindToElement(r.elm,t,n))currentStyle=u;break}else if(currentStyle==u+"1"){currentStyle=u+"2";if(!bindToElement(r.elm,t,n))currentStyle=u;break}else if(currentStyle==u+"2"){currentStyle=u+"3";if(!bindToElement(r.elm,t,n))currentStyle=u;break}else if(currentStyle==u+"3"){currentStyle=u;break}}return true}function force_rtl(){_$("style-force-rtl").style.display="none";_$("style-force-ltr").style.display="inline-block";var e=["pds-feedback-per","pds-feedback-votes"];var t=["pds-answer-input","pds-link","pds-textfield","pds-vote-button","pds-answer-feedback-bar","pds-totalvotes-inner","pds-answer-text","pds-answer-text","pds-answer"];var n=["pds-question-top","pds-answer","pds-link","pds-textfield","pds-vote-button","pds-totalvotes-inner","pds-answer-text","pds-feedback-per","pds-feedback-votes","pds-textfield"];for(var r in e){currentStyle=e[r];bind("float","left",false)}for(var r in t){currentStyle=t[r];bind("float","right",false)}for(var r in n){currentStyle=n[r];bind("text-align","right",false)}currentStyle="pds-box";bind("direction","rtl",false)}function force_ltr(){_$("style-force-rtl").style.display="inline-block";_$("style-force-ltr").style.display="none";var e=["pds-feedback-per","pds-feedback-votes"];var t=["pds-answer-input","pds-link","pds-textfield","pds-vote-button","pds-answer-feedback-bar","pds-totalvotes-inner","pds-answer-text","pds-answer-text","pds-answer"];var n=["pds-question-top","pds-answer","pds-link","pds-textfield","pds-vote-button","pds-totalvotes-inner","pds-answer-text","pds-feedback-per","pds-feedback-votes","pds-textfield"];for(var r in t){currentStyle=t[r];bind("float","left",false)}for(var r in e){currentStyle=e[r];bind("float","right",false)}for(var r in n){currentStyle=n[r];bind("text-align","left",false)}currentStyle="pds-box";bind("direction","ltr",false)}function loadCSSXML(){if(window.ActiveXObject){CSSXML=new ActiveXObject("Microsoft.XMLDOM");CSSXML.loadXML(CSSXMLString)}else{CSSXML=document.implementation.createDocument("","",null);objDOMParser=new DOMParser;CSSXML=objDOMParser.parseFromString(CSSXMLString,"text/xml")}}function ShowXML(){if(window.ActiveXObject){var e=CSSXML.xml}else if(document.implementation&&document.implementation.createDocument){var t=new XMLSerializer;var e=t.serializeToString(CSSXML)}document.getElementById("S_www").value=e}function submitStyleCSS(){pass=true;if(_$("styleName").value.trim().length==0){pass=false;_$("styleNameErr").style.display="block"}else{_$("styleNameErr").style.display="none"}if(_$("styleCSS").value.trim().length==0){pass=false;_$("styleCSSErr").style.display="block"}else{_$("styleCSSErr").style.display="none"}if(pass){_$("editStyle").submit()}}function preload_style(){if(_$("preload_value").value!="0"){var e=window.location.href.split("#");window.location=e[0].replace(/(\&preload=(\d+))/g,"")+"&preload="+_$("preload_value").value}}document.onmousedown=mouseDown;var pd_map={thankyou:"Thank you for voting!",question:"Do you mostly use the internet at work, in school or at home?"};var currentTag="Background";var currentStyle;firstRun=true
polldaddy-org.php CHANGED
@@ -15,7 +15,7 @@ class WPORG_Polldaddy extends WP_Polldaddy {
15
  function __construct() {
16
  parent::__construct();
17
  $this->log( 'Created WPORG_Polldaddy Object: constructor' );
18
- $this->version = '2.0.16';
19
  $this->base_url = plugins_url() . '/' . dirname( plugin_basename( __FILE__ ) ) . '/';
20
  $this->polldaddy_client_class = 'WPORG_Polldaddy_Client';
21
  $this->use_ssl = (int) get_option( 'polldaddy_use_ssl' );
@@ -332,7 +332,7 @@ class WPORG_Polldaddy extends WP_Polldaddy {
332
  <?php wp_nonce_field( 'polldaddy-account' ); ?>
333
  <input type="hidden" name="action" value="account" />
334
  <input type="hidden" name="account" value="import" />
335
- <input type="submit" value="<?php echo attribute_escape( __( 'Submit', 'polldaddy' ) ); ?>" />
336
  </p>
337
  </form>
338
  </div>
@@ -555,7 +555,7 @@ class PolldaddyShortcode {
555
  return '<!-- Polldaddy shortcode passed invalid attributes -->';
556
  }
557
 
558
- $inline = false;
559
  $no_script = false;
560
  $infinite_scroll = false;
561
 
@@ -582,7 +582,7 @@ class PolldaddyShortcode {
582
  $item_id = is_page() ? '_page_'.$post->ID : '_post_'.$post->ID;
583
 
584
  if ( empty( $title ) )
585
- $title = apply_filters( 'wp_title', $post->post_title, '', '' );
586
 
587
  if ( empty( $permalink ) )
588
  $permalink = get_permalink( $post->ID );
@@ -608,7 +608,7 @@ class PolldaddyShortcode {
608
  <script type="text/javascript" charset="UTF-8"><!--//--><![CDATA[//><!--
609
  PDRTJS_settings_{$rating}{$item_id}={$settings};
610
  //--><!]]></script>
611
- <script type="text/javascript" charset="UTF-8" src="http://i.polldaddy.com/ratings/rating.js"></script>
612
  SCRIPT;
613
  }
614
  else {
@@ -818,7 +818,7 @@ CONTAINER;
818
  foreach( self::$scripts['rating'] as $rating ) {
819
  $script .= "PDRTJS_settings_{$rating['id']}{$rating['item_id']}={$rating['settings']}; if ( typeof PDRTJS_RATING !== 'undefined' ){if ( typeof PDRTJS_{$rating['id']}{$rating['item_id']} == 'undefined' ){PDRTJS_{$rating['id']}{$rating['item_id']} = new PDRTJS_RATING( PDRTJS_settings_{$rating['id']}{$rating['item_id']} );}}";
820
  }
821
- $script .= "\n//--><!]]></script><script type='text/javascript' charset='UTF-8' src='http://i.polldaddy.com/ratings/rating.js'></script>";
822
 
823
  }
824
 
@@ -837,9 +837,8 @@ CONTAINER;
837
  * If the theme uses infinite scroll, include jquery at the start
838
  */
839
  function check_infinite() {
840
- if ( current_theme_supports( 'infinite-scroll' ) ) {
841
  wp_enqueue_script( 'jquery' );
842
- }
843
  }
844
 
845
  /**
@@ -854,7 +853,7 @@ CONTAINER;
854
  $script_url = json_encode( esc_url_raw( plugins_url( 'js/polldaddy-shortcode.js', __FILE__ ) ) );
855
 
856
  // if the script hasn't been loaded, load it
857
- // if the script loads successfully, fire an 'as-script-load' event
858
  echo <<<SCRIPT
859
  <script type='text/javascript'>
860
  //<![CDATA[
@@ -921,12 +920,46 @@ if ( class_exists( 'WP_Widget' ) ) {
921
  $comments_rating_id = (int) get_option( 'pd-rating-comments-id' );
922
  $rating_seq = $instance['show_posts'] . $instance['show_pages'] . $instance['show_comments'];
923
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
924
  $widget = <<<EOD
925
  {$before_title}{$title}{$after_title}
926
  <div id="pd_top_rated_holder"></div>
927
- <script language="javascript" charset="UTF-8" src="http://i.polldaddy.com/ratings/rating-top.js"></script>
928
  <script type="text/javascript" charset="UTF-8"><!--//--><![CDATA[//><!--
929
- PDRTJS_TOP = new PDRTJS_RATING_TOP( {$posts_rating_id}, {$pages_rating_id}, {$comments_rating_id}, '{$rating_seq}', {$instance['item_count']} );
930
  //--><!]]></script>
931
  EOD;
932
  echo $before_widget;
@@ -941,63 +974,57 @@ EOD;
941
  $instance['show_posts'] = (int) $new_instance['show_posts'];
942
  $instance['show_pages'] = (int) $new_instance['show_pages'];
943
  $instance['show_comments'] = (int) $new_instance['show_comments'];
 
944
  $instance['item_count'] = (int) $new_instance['item_count'];
945
  return $instance;
946
  }
947
 
948
  function form( $instance ) {
949
 
950
- $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'show_posts' => '1', 'show_pages' => '1', 'show_comments' => '1', 'item_count' => '5' ) );
951
  $title = strip_tags( $instance['title'] );
952
  $show_posts = (int) $instance['show_posts'];
953
  $show_pages = (int) $instance['show_pages'];
954
  $show_comments = (int) $instance['show_comments'];
 
955
  $item_count = (int) $instance['item_count'];
956
  ?>
957
- <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title', 'polldaddy' ); ?>: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape( $title ); ?>" /></label></p>
 
958
  <p>
959
  <label for="<?php echo $this->get_field_id( 'show_posts' ); ?>">
960
- <?php
961
- $checked = '';
962
- if ( $show_posts == 1 )
963
- $checked = 'checked="checked"';
964
- ?>
965
- <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'show_posts' ); ?>" name="<?php echo $this->get_field_name( 'show_posts' ); ?>" value="1" <?php echo $checked; ?> />
966
  <?php _e( 'Show for posts', 'polldaddy' ); ?>
967
  </label>
968
  </p>
969
- <p>
970
- <label for="<?php echo $this->get_field_id( 'show_pages' ); ?>">
971
- <?php
972
- $checked = '';
973
- if ( $show_pages == 1 )
974
- $checked = 'checked="checked"';
975
- ?>
976
- <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'show_pages' ); ?>" name="<?php echo $this->get_field_name( 'show_pages' ); ?>" value="1" <?php echo $checked; ?> />
977
- <?php _e( 'Show for pages', 'polldaddy' ); ?>
978
- </label>
979
- </p>
980
- <p>
981
- <label for="<?php echo $this->get_field_id( 'show_comments' ); ?>">
982
- <?php
983
- $checked = '';
984
- if ( $show_comments == 1 )
985
- $checked = 'checked="checked"';
986
- ?>
987
- <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'show_comments' ); ?>" name="<?php echo $this->get_field_name( 'show_comments' ); ?>" value="1" <?php echo $checked; ?>/>
988
- <?php _e( 'Show for comments', 'polldaddy' ); ?>
989
- </label>
990
- </p>
991
- <p>
992
- <label for="rss-items-<?php echo $number; ?>"><?php _e( 'How many items would you like to display?', 'polldaddy' ); ?>
993
- <select id="<?php echo $this->get_field_id( 'item_count' ); ?>" name="<?php echo $this->get_field_name( 'item_count' ); ?>">
994
- <?php
995
- for ( $i = 1; $i <= 20; ++$i )
996
- echo "<option value='$i' " . ( $item_count == $i ? "selected='selected'" : '' ) . ">$i</option>";
997
  ?>
998
- </select>
999
- </label>
1000
- </p>
1001
  <?php
1002
  }
1003
  }
15
  function __construct() {
16
  parent::__construct();
17
  $this->log( 'Created WPORG_Polldaddy Object: constructor' );
18
+ $this->version = '2.0.19';
19
  $this->base_url = plugins_url() . '/' . dirname( plugin_basename( __FILE__ ) ) . '/';
20
  $this->polldaddy_client_class = 'WPORG_Polldaddy_Client';
21
  $this->use_ssl = (int) get_option( 'polldaddy_use_ssl' );
332
  <?php wp_nonce_field( 'polldaddy-account' ); ?>
333
  <input type="hidden" name="action" value="account" />
334
  <input type="hidden" name="account" value="import" />
335
+ <input class="button-secondary" type="submit" value="<?php echo attribute_escape( __( 'Submit', 'polldaddy' ) ); ?>" />
336
  </p>
337
  </form>
338
  </div>
555
  return '<!-- Polldaddy shortcode passed invalid attributes -->';
556
  }
557
 
558
+ $inline = !in_the_loop();
559
  $no_script = false;
560
  $infinite_scroll = false;
561
 
582
  $item_id = is_page() ? '_page_'.$post->ID : '_post_'.$post->ID;
583
 
584
  if ( empty( $title ) )
585
+ $title = apply_filters( 'the_title', $post->post_title );
586
 
587
  if ( empty( $permalink ) )
588
  $permalink = get_permalink( $post->ID );
608
  <script type="text/javascript" charset="UTF-8"><!--//--><![CDATA[//><!--
609
  PDRTJS_settings_{$rating}{$item_id}={$settings};
610
  //--><!]]></script>
611
+ <script type="text/javascript" charset="UTF-8" src="http://i0.poll.fm/js/rating/rating.js"></script>
612
  SCRIPT;
613
  }
614
  else {
818
  foreach( self::$scripts['rating'] as $rating ) {
819
  $script .= "PDRTJS_settings_{$rating['id']}{$rating['item_id']}={$rating['settings']}; if ( typeof PDRTJS_RATING !== 'undefined' ){if ( typeof PDRTJS_{$rating['id']}{$rating['item_id']} == 'undefined' ){PDRTJS_{$rating['id']}{$rating['item_id']} = new PDRTJS_RATING( PDRTJS_settings_{$rating['id']}{$rating['item_id']} );}}";
820
  }
821
+ $script .= "\n//--><!]]></script><script type='text/javascript' charset='UTF-8' src='http://i0.poll.fm/js/rating/rating.js'></script>";
822
 
823
  }
824
 
837
  * If the theme uses infinite scroll, include jquery at the start
838
  */
839
  function check_infinite() {
840
+ if ( current_theme_supports( 'infinite-scroll' ) && class_exists( 'The_Neverending_Home_Page' ) && The_Neverending_Home_Page::archive_supports_infinity() )
841
  wp_enqueue_script( 'jquery' );
 
842
  }
843
 
844
  /**
853
  $script_url = json_encode( esc_url_raw( plugins_url( 'js/polldaddy-shortcode.js', __FILE__ ) ) );
854
 
855
  // if the script hasn't been loaded, load it
856
+ // if the script loads successfully, fire an 'pd-script-load' event
857
  echo <<<SCRIPT
858
  <script type='text/javascript'>
859
  //<![CDATA[
920
  $comments_rating_id = (int) get_option( 'pd-rating-comments-id' );
921
  $rating_seq = $instance['show_posts'] . $instance['show_pages'] . $instance['show_comments'];
922
 
923
+ $filter = '';
924
+ if ( $instance['show_posts'] == 1 && $instance['filter_by_category'] == 1 ) {
925
+ if ( is_single() ) { //get all posts in current category
926
+ global $post;
927
+ if( !empty( $post ) )
928
+ $current_category = get_the_category( $post->ID );
929
+ }
930
+
931
+ if ( is_category() ) { //get all posts in category archive page
932
+ global $posts;
933
+ if( !empty( $posts ) )
934
+ $current_category = get_the_category( $posts[0]->ID );
935
+ }
936
+
937
+ if ( is_array( $current_category ) && (int) $current_category[0]->cat_ID > 0 ) {
938
+ $args = array( 'category' => $current_category[0]->cat_ID );
939
+ $post_ids = '';
940
+ foreach( get_posts( $args ) as $p )
941
+ $post_ids .= $p->ID . ',';
942
+ $post_ids = substr( $post_ids, 0, -1 );
943
+ }
944
+
945
+ if ( !empty( $post_ids ) ) //set variable
946
+ $filter = 'PDRTJS_TOP.filters = [' . $post_ids . '];';
947
+ }
948
+
949
+ $show = "PDRTJS_TOP.get_top( 'posts', '0' );";
950
+ if ( $instance['show_pages'] == 1 )
951
+ $show = "PDRTJS_TOP.get_top( 'pages', '0' );";
952
+ elseif ( $instance['show_comments'] == 1 )
953
+ $show = "PDRTJS_TOP.get_top( 'comments', '0' );";
954
+
955
+ echo '</script>';
956
+
957
  $widget = <<<EOD
958
  {$before_title}{$title}{$after_title}
959
  <div id="pd_top_rated_holder"></div>
960
+ <script language="javascript" charset="UTF-8" src="http://i0.poll.fm/js/rating/rating-top.js"></script>
961
  <script type="text/javascript" charset="UTF-8"><!--//--><![CDATA[//><!--
962
+ PDRTJS_TOP = new PDRTJS_RATING_TOP( {$posts_rating_id}, {$pages_rating_id}, {$comments_rating_id}, '{$rating_seq}', {$instance['item_count']} );{$filter}{$show}
963
  //--><!]]></script>
964
  EOD;
965
  echo $before_widget;
974
  $instance['show_posts'] = (int) $new_instance['show_posts'];
975
  $instance['show_pages'] = (int) $new_instance['show_pages'];
976
  $instance['show_comments'] = (int) $new_instance['show_comments'];
977
+ $instance['filter_by_category'] = (int) $new_instance['filter_by_category'];
978
  $instance['item_count'] = (int) $new_instance['item_count'];
979
  return $instance;
980
  }
981
 
982
  function form( $instance ) {
983
 
984
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'show_posts' => '1', 'show_pages' => '1', 'show_comments' => '1', 'item_count' => '5', 'filter_by_category' => '', ) );
985
  $title = strip_tags( $instance['title'] );
986
  $show_posts = (int) $instance['show_posts'];
987
  $show_pages = (int) $instance['show_pages'];
988
  $show_comments = (int) $instance['show_comments'];
989
+ $filter_by_category = (int) $instance['filter_by_category'];
990
  $item_count = (int) $instance['item_count'];
991
  ?>
992
+ <p>
993
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title', 'polldaddy' ); ?>: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape( $title ); ?>" /></label></p>
994
  <p>
995
  <label for="<?php echo $this->get_field_id( 'show_posts' ); ?>">
996
+ <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'show_posts' ); ?>" name="<?php echo $this->get_field_name( 'show_posts' ); ?>" value="1" <?php echo $show_posts == 1 ? 'checked="checked"' : ''; ?> />
 
 
 
 
 
997
  <?php _e( 'Show for posts', 'polldaddy' ); ?>
998
  </label>
999
  </p>
1000
+ <p>
1001
+ <label for="<?php echo $this->get_field_id( 'show_pages' ); ?>">
1002
+ <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'show_pages' ); ?>" name="<?php echo $this->get_field_name( 'show_pages' ); ?>" value="1" <?php echo $show_pages == 1 ? 'checked="checked"' : ''; ?> />
1003
+ <?php _e( 'Show for pages', 'polldaddy' ); ?>
1004
+ </label>
1005
+ </p>
1006
+ <p>
1007
+ <label for="<?php echo $this->get_field_id( 'show_comments' ); ?>">
1008
+ <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'show_comments' ); ?>" name="<?php echo $this->get_field_name( 'show_comments' ); ?>" value="1" <?php echo $show_comments == 1 ? 'checked="checked"' : ''; ?> />
1009
+ <?php _e( 'Show for comments', 'polldaddy' ); ?>
1010
+ </label>
1011
+ </p>
1012
+ <p>
1013
+ <label for="<?php echo $this->get_field_id( 'filter_by_category' ); ?>">
1014
+ <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'filter_by_category' ); ?>" name="<?php echo $this->get_field_name( 'filter_by_category' ); ?>" value="1" <?php echo $filter_by_category == 1 ? 'checked="checked"':''; ?>/>
1015
+ <?php _e('Filter by category'); ?>
1016
+ </label>
1017
+ </p>
1018
+ <p>
1019
+ <label for="rss-items-<?php echo $number; ?>"><?php _e( 'How many items would you like to display?', 'polldaddy' ); ?>
1020
+ <select id="<?php echo $this->get_field_id( 'item_count' ); ?>" name="<?php echo $this->get_field_name( 'item_count' ); ?>">
1021
+ <?php
1022
+ for ( $i = 1; $i <= 20; ++$i )
1023
+ echo "<option value='$i' " . ( $item_count == $i ? "selected='selected'" : '' ) . ">$i</option>";
 
 
 
 
1024
  ?>
1025
+ </select>
1026
+ </label>
1027
+ </p>
1028
  <?php
1029
  }
1030
  }
polldaddy.php CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://wordpress.org/extend/plugins/polldaddy/
6
  Description: Create and manage Polldaddy polls and ratings in WordPress
7
  Author: Automattic, Inc.
8
  Author URL: http://automattic.com/
9
- Version: 2.0.18
10
  */
11
 
12
  // You can hardcode your Polldaddy PartnerGUID (API Key) here
@@ -35,7 +35,7 @@ class WP_Polldaddy {
35
  $this->log( 'Created WP_Polldaddy Object: constructor' );
36
  $this->errors = new WP_Error;
37
  $this->scheme = 'https';
38
- $this->version = '2.0.18';
39
  $this->multiple_accounts = true;
40
  $this->polldaddy_client_class = 'api_client';
41
  $this->polldaddy_clients = array();
@@ -284,7 +284,7 @@ class WP_Polldaddy {
284
  <?php wp_nonce_field( 'polldaddy-account' ); ?>
285
  <input type="hidden" name="action" value="account" />
286
  <input type="hidden" name="account" value="import" />
287
- <input type="submit" value="<?php echo esc_attr( __( 'Submit', 'polldaddy' ) ); ?>" />
288
  </p>
289
  </form>
290
  </div>
@@ -469,7 +469,7 @@ class WP_Polldaddy {
469
 
470
  foreach ( (array) $_REQUEST['poll'] as $poll_id ) {
471
  $polldaddy->reset();
472
- $poll_object = $polldaddy->get_poll( $poll );
473
 
474
  if ( !$this->can_edit( $poll_object ) ) {
475
  $this->errors->add( 'permission', __( 'You are not allowed to delete this poll.', 'polldaddy' ) );
@@ -505,7 +505,7 @@ class WP_Polldaddy {
505
 
506
  foreach ( (array) $_REQUEST['poll'] as $poll_id ) {
507
  $polldaddy->reset();
508
- $poll_object = $polldaddy->get_poll( $poll );
509
 
510
  if ( !$this->can_edit( $poll_object ) ) {
511
  $this->errors->add( 'permission', __( 'You are not allowed to open this poll.', 'polldaddy' ) );
@@ -541,7 +541,7 @@ class WP_Polldaddy {
541
 
542
  foreach ( (array) $_REQUEST['poll'] as $poll_id ) {
543
  $polldaddy->reset();
544
- $poll_object = $polldaddy->get_poll( $poll );
545
 
546
  if ( !$this->can_edit( $poll_object ) ) {
547
  $this->errors->add( 'permission', __( 'You are not allowed to close this poll.', 'polldaddy' ) );
@@ -1185,7 +1185,7 @@ class WP_Polldaddy {
1185
  case 'results' :
1186
  ?>
1187
 
1188
- <h2 id="poll-list-header"><?php printf( __( 'Poll Results <a href="%s" class="add-new-h2">All Polls</a>', 'polldaddy' ), esc_url( add_query_arg( array( 'action' => 'polls', 'poll' => false, 'message' => false ) ) ) ); ?></h2>
1189
 
1190
  <?php
1191
  $this->poll_results_page( $poll );
@@ -1194,7 +1194,7 @@ class WP_Polldaddy {
1194
  case 'edit-poll' :
1195
  ?>
1196
 
1197
- <h2 id="poll-list-header"><?php printf( __( 'Edit Poll <a href="%s" class="add-new-h2">All Polls</a>', 'polldaddy' ), esc_url( add_query_arg( array( 'action' => 'polls', 'poll' => false, 'message' => false ) ) ) ); ?></h2>
1198
 
1199
  <?php
1200
 
@@ -4834,7 +4834,7 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"&gt;&lt;/scr
4834
  <?php wp_nonce_field( 'polldaddy-account' ); ?>
4835
  <input type="hidden" name="action" value="import-account" />
4836
  <input type="hidden" name="account" value="import" />
4837
- <input type="submit" class="button-primary" style="padding:3px 8px;" value="<?php echo esc_attr( __( 'Import Account', 'polldaddy' ) ); ?>" />
4838
  </p>
4839
  </form>
4840
  <br />
@@ -4921,7 +4921,7 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"&gt;&lt;/scr
4921
  <p class="submit">
4922
  <?php wp_nonce_field( 'polldaddy-account' ); ?>
4923
  <input type="hidden" name="action" value="update-options" />
4924
- <input type="submit" class="button-primary" style="padding:3px 8px;" value="<?php echo esc_attr( __( 'Save Options', 'polldaddy' ) ); ?>" />
4925
  </p>
4926
  </form>
4927
  </div>
@@ -4949,6 +4949,11 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"&gt;&lt;/scr
4949
  $this->log( 'can_edit: poll owner equals id.' );
4950
  return true;
4951
  }
 
 
 
 
 
4952
 
4953
  //check to see if poll owner is a member of this blog
4954
  if ( function_exists( 'get_users' ) ) {
6
  Description: Create and manage Polldaddy polls and ratings in WordPress
7
  Author: Automattic, Inc.
8
  Author URL: http://automattic.com/
9
+ Version: 2.0.19
10
  */
11
 
12
  // You can hardcode your Polldaddy PartnerGUID (API Key) here
35
  $this->log( 'Created WP_Polldaddy Object: constructor' );
36
  $this->errors = new WP_Error;
37
  $this->scheme = 'https';
38
+ $this->version = '2.0.19';
39
  $this->multiple_accounts = true;
40
  $this->polldaddy_client_class = 'api_client';
41
  $this->polldaddy_clients = array();
284
  <?php wp_nonce_field( 'polldaddy-account' ); ?>
285
  <input type="hidden" name="action" value="account" />
286
  <input type="hidden" name="account" value="import" />
287
+ <input class="button-secondary" type="submit" value="<?php echo esc_attr( __( 'Submit', 'polldaddy' ) ); ?>" />
288
  </p>
289
  </form>
290
  </div>
469
 
470
  foreach ( (array) $_REQUEST['poll'] as $poll_id ) {
471
  $polldaddy->reset();
472
+ $poll_object = $polldaddy->get_poll( $poll_id );
473
 
474
  if ( !$this->can_edit( $poll_object ) ) {
475
  $this->errors->add( 'permission', __( 'You are not allowed to delete this poll.', 'polldaddy' ) );
505
 
506
  foreach ( (array) $_REQUEST['poll'] as $poll_id ) {
507
  $polldaddy->reset();
508
+ $poll_object = $polldaddy->get_poll( $poll_id );
509
 
510
  if ( !$this->can_edit( $poll_object ) ) {
511
  $this->errors->add( 'permission', __( 'You are not allowed to open this poll.', 'polldaddy' ) );
541
 
542
  foreach ( (array) $_REQUEST['poll'] as $poll_id ) {
543
  $polldaddy->reset();
544
+ $poll_object = $polldaddy->get_poll( $poll_id );
545
 
546
  if ( !$this->can_edit( $poll_object ) ) {
547
  $this->errors->add( 'permission', __( 'You are not allowed to close this poll.', 'polldaddy' ) );
1185
  case 'results' :
1186
  ?>
1187
 
1188
+ <h2 id="poll-list-header"><?php printf( __( 'Poll Results <a href="%s" class="add-new-h2">All Polls</a> <a href="%s" class="add-new-h2">Edit Poll</a>', 'polldaddy' ), esc_url( add_query_arg( array( 'action' => 'polls', 'poll' => false, 'message' => false ) ) ), esc_url( add_query_arg( array( 'action' => 'edit-poll', 'poll' => $poll, 'message' => false ) ) ) ); ?></h2>
1189
 
1190
  <?php
1191
  $this->poll_results_page( $poll );
1194
  case 'edit-poll' :
1195
  ?>
1196
 
1197
+ <h2 id="poll-list-header"><?php printf( __( 'Edit Poll <a href="%s" class="add-new-h2">All Polls</a> <a href="%s" class="add-new-h2">View Results</a>', 'polldaddy' ), esc_url( add_query_arg( array( 'action' => 'polls', 'poll' => false, 'message' => false ) ) ), esc_url( add_query_arg( array( 'action' => 'results', 'poll' => $poll, 'message' => false ) ) ) ); ?></h2>
1198
 
1199
  <?php
1200
 
4834
  <?php wp_nonce_field( 'polldaddy-account' ); ?>
4835
  <input type="hidden" name="action" value="import-account" />
4836
  <input type="hidden" name="account" value="import" />
4837
+ <input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Import Account', 'polldaddy' ) ); ?>" />
4838
  </p>
4839
  </form>
4840
  <br />
4921
  <p class="submit">
4922
  <?php wp_nonce_field( 'polldaddy-account' ); ?>
4923
  <input type="hidden" name="action" value="update-options" />
4924
+ <input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Save Options', 'polldaddy' ) ); ?>" />
4925
  </p>
4926
  </form>
4927
  </div>
4949
  $this->log( 'can_edit: poll owner equals id.' );
4950
  return true;
4951
  }
4952
+
4953
+ if ( $poll->parentID == (int) $GLOBALS['blog_id'] && current_user_can( 'edit_others_posts' ) ) {
4954
+ $this->log( 'can_edit: poll was created on this blog and current user can edit_others_posts' );
4955
+ return true;
4956
+ }
4957
 
4958
  //check to see if poll owner is a member of this blog
4959
  if ( function_exists( 'get_users' ) ) {
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: eoigal, alternatekev, mdawaffe, donncha, johnny5
3
  Tags: polls, poll, polldaddy, wppolls, vote, polling, surveys, rate, rating, ratings
4
  Requires at least: 3.2
5
- Tested up to: 3.5
6
- Stable tag: 2.0.18
7
 
8
  Create and manage Polldaddy polls and ratings from within WordPress.
9
 
@@ -72,6 +72,10 @@ You can find further help on our [support page](http://support.polldaddy.com/).
72
 
73
  == Frequently Asked Questions ==
74
 
 
 
 
 
75
  = I have multiple authors on my blog? What happens? =
76
 
77
  Each author that wants to create polls will need his or her own Polldaddy.com account.
@@ -104,10 +108,16 @@ Your theme is getting the post content, without necessarily showing it. If the p
104
 
105
 
106
  == Upgrade Notice ==
107
- = 2.0.17 =
108
- Fixed couple of bugs with adding/deleting images in poll editor
109
 
110
  == Changelog ==
 
 
 
 
 
 
111
  = 2.0.18 =
112
  * Update poll editor to allow a user to delete an image from a poll answer
113
  * Fixed bug with new polls not including images when a poll is created
2
  Contributors: eoigal, alternatekev, mdawaffe, donncha, johnny5
3
  Tags: polls, poll, polldaddy, wppolls, vote, polling, surveys, rate, rating, ratings
4
  Requires at least: 3.2
5
+ Tested up to: 3.5.1
6
+ Stable tag: 2.0.19
7
 
8
  Create and manage Polldaddy polls and ratings from within WordPress.
9
 
72
 
73
  == Frequently Asked Questions ==
74
 
75
+ = Where do I find my Polls & Ratings menus? =
76
+
77
+ The Polls & Ratings menus can now be found under the Feedbacks top level menu.
78
+
79
  = I have multiple authors on my blog? What happens? =
80
 
81
  Each author that wants to create polls will need his or her own Polldaddy.com account.
108
 
109
 
110
  == Upgrade Notice ==
111
+ = 2.0.19 =
112
+ Bug Fixes and added filter by catergory to Top Rated Widget
113
 
114
  == Changelog ==
115
+ = 2.0.19 =
116
+ * Added filter by category to Top Rated Widget
117
+ * Added more retina images for ratings
118
+ * Updated edit permissions on poll to allow an editor to edit a poll belonging to a user no longer member of blog
119
+ * Fixed minor JS/CSS bugs
120
+
121
  = 2.0.18 =
122
  * Update poll editor to allow a user to delete an image from a poll answer
123
  * Fixed bug with new polls not including images when a poll is created