Version Description
- Update poll editor to allow a user to delete an image from a poll answer
- Fixed bug with new polls not including images when a poll is created
- Fixed bug with missing retina image for polldaddy icon
Download this release
Release Info
Developer | eoigal |
Plugin | Crowdsignal Dashboard – Polls, Surveys & more |
Version | 2.0.18 |
Comparing to | |
See all releases |
Code changes from version 2.0.17 to 2.0.18
- js/polldaddy.js +20 -1
- polldaddy.php +30 -27
- readme.txt +7 -2
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-4.png +0 -0
js/polldaddy.js
CHANGED
@@ -1 +1,20 @@
|
|
1 |
-
jQuery(function(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(function($){if(typeof(window.$)=='undefined'){window.$=jQuery;}
|
2 |
+
Plugin=function(args){var opts=$.extend({delete_rating:'Are you sure you want to delete the rating for "%s"?',delete_poll:'Are you sure you want to delete "%s"?',delete_answer:'Are you sure you want to delete this answer?',new_answer:'Enter an answer here',delete_answer_title:'delete this answer',reorder_answer_title:'click and drag to reorder',add_image_title:'Add an Image',add_audio_title:'Add Audio',add_video_title:'Add Video',standard_styles:'Standard Styles',custom_styles:'Custom Styles',base_url:''},args);$('.hide-if-js').hide();$('.empty-if-js').empty();$('.hide-if-no-js').removeClass('hide-if-no-js');$('.polldaddy-shortcode-row pre').click(function(){var refNode=$(this)[0];if($.browser.msie){var range=document.body.createTextRange();range.moveToElementText(refNode);range.select();}else if($.browser.mozilla||$.browser.opera){var selection=window.getSelection();var range=document.createRange();range.selectNodeContents(refNode);selection.removeAllRanges();selection.addRange(range);}else if($.browser.safari){var selection=window.getSelection();selection.setBaseAndExtent(refNode,0,refNode,1);}});$('input#shortcode-field').click(function(){$(this).select();});$('a.delete-rating').click(function(){return confirm(opts.delete_rating.replace("%s",$(this).parents('td').find('strong').text()));});$('a.delete-poll').click(function(){return confirm(opts.delete_poll.replace("%s",$(this).parents('td').find('strong').text()));});$('span.view a.thickbox').attr('href',function(){return $(this).attr('href')+'&iframe&TB_iframe=true';});var delAnswerPrep=function(context){$('a.delete-answer',context||null).click(function(){if(confirm(opts.delete_answer)){$(this).parents('li').remove();$('#choices option:last-child').remove();}
|
3 |
+
return false;});};delAnswerPrep();$('#answers').sortable({axis:'y',containment:'parent',handle:'.handle',tolerance:'pointer'});function is_ssl(){return"https:"==document.location.protocol?true:false}
|
4 |
+
function add_answer(aa,src){return false;}
|
5 |
+
var busy=false;$('#add-answer-holder').show().find('button').click(function(){if(!busy){busy=true;var aa=(1+get_number_answers()).toString();var src=$(this).closest('p').attr('class');$('form[name=add-answer] input[name=aa]').val(aa);$('form[name=add-answer] input[name=src]').val(src);$('form[name=add-answer] input[name=action]').val('polls_add_answer');$('form[name=add-answer]').ajaxSubmit(function(response){delAnswerPrep($('#answers').append(response).find('li:last'));$('#choices').append('<option value="'+(aa-1)+'">'+(aa-1)+'</option>');busy=false;init();});}
|
6 |
+
return false;});var win=window.dialogArguments||opener||parent||top;$('.polldaddy-send-to-editor').click(function(){var pollID=$(this).parents('div.row-actions').find('.polldaddy-poll-id').val();if(!pollID)pollID=$('.polldaddy-poll-id:first').val();if(pollID){pollID=parseInt(pollID);if(pollID>0){win.send_to_editor('[polldaddy poll='+pollID.toString()+']');}}});$('.polldaddy-show-shortcode').toggle(function(ev){ev.preventDefault();$(this).parents('tr:first').next('tr').fadeIn();$(this).parents('tr:first').next('tr').show();$(this).closest('tr').css('display','none');return false;},function(){$(this).parents('tr:first').next('tr').fadeOut();$(this).parents('tr:first').next('tr').hide();return false;});$('.pd-embed-done').click(function(ev){ev.preventDefault();$(this).closest('tr').hide();$(this).closest('tr').prev('tr').show();});$('.pd-tabs a').click(function(){if(!jQuery(this).closest('li').hasClass('selected')){jQuery('.pd-tabs li').removeClass('selected');jQuery(this).closest('li').addClass('selected');jQuery('.pd-tab-panel').removeClass('show');jQuery('.pd-tab-panel#'+$(this).closest('li').attr('id')+'-panel').addClass('show');}});var hiddenStyleID=$(':input[name=styleID]');var customStyle=$(':input[name=customSelect]');var customStyleVal=parseInt(customStyle.val());if(customStyleVal>0){hiddenStyleID.val(customStyleVal.toString());$('#pd-custom-styles a').click();}
|
7 |
+
$("#multipleChoice").click(function(){if($("#multipleChoice").is(":checked")){$("#numberChoices").show("fast");}else{$("#numberChoices").hide("fast");}});$('.block-repeat').click(function(){var repeat=jQuery(this).val();if(repeat=='off'){$('#cookieip_expiration_label').hide();$('#cookieip_expiration').hide();}else{$('#cookieip_expiration_label').show();$('#cookieip_expiration').show();}});var uploading=false;function init(){$('a.delete-media').unbind('click').click(function(){var container=$(this).parents('td.answer-media-icons');container.find('li.image-added').removeClass('image-added').html('');container.find(':hidden').val('');})
|
8 |
+
$('td.answer-media-icons li.image-added').unbind('mouseover').mouseover(function(){$(this).find('img').addClass('hidden');$(this).find('a.delete-media img').removeClass('hidden');$(this).find('a.delete-media').removeClass('hidden');}).unbind('mouseout').mouseout(function(){$(this).find('a.delete-media').addClass('hidden');$(this).find('img').removeClass('hidden');});$('.image').unbind('click').click(function(){var media_id=$(this).attr('id').replace('add_poll_image','');tb_show('Add an Image','media-upload.php?type=image&&polls_media=1TB_iframe=1');win.send_to_editor=function(html){var $h=$('<div/>').html(html);img=$h.find('img');attach_id=0;url=img.attr('src')
|
9 |
+
if(is_ssl())url=url.replace('http://','https://');match=img.attr('class').match(/wp-image-(\d+)/);if($.isArray(match)&&match[1]!==undefined)
|
10 |
+
attach_id=match[1];tb_remove();send_media(url,media_id,attach_id);}
|
11 |
+
return false;});$('.video').unbind('click').click(function(){var media_id=$(this).attr('id').replace('add_poll_video','');tb_show('Add Video','media-upload.php?type=video&tab=type_url&polls_media=1&TB_iframe=1');win.send_to_editor=function(shortcode){tb_remove();add_media(media_id,shortcode,'<img height="16" width="16" src="'+opts.base_url+'img/icon-report-ip-analysis.png" alt="Video Embed">');}
|
12 |
+
return false;});$('.audio').unbind('click').click(function(){var media_id=$(this).attr('id').replace('add_poll_audio','');tb_show('Add Audio','media-upload.php?type=audio&polls_media=1&TB_iframe=1');win.send_to_editor=function(html){var $h=$('<div/>').html(html);img=$h.find('img');attach_id=0;url=img.attr('src');if(is_ssl())url=url.replace('http://','https://');match=img.attr('class').match(/wp-image-(\d+)/);if($.isArray(match)&&match[1]!==undefined)
|
13 |
+
attach_id=match[1];tb_remove();send_media(url,media_id,attach_id);}
|
14 |
+
return false;});}
|
15 |
+
function send_media(url,media_id,attach_id){if(uploading==true)
|
16 |
+
return false;uploading=true;$('input[name="media\['+media_id+'\]"]').parents('td').find('.media-preview').addClass('st_image_loader');$('form[name=send-media] input[name=media-id]').val(media_id);$('form[name=send-media] input[name=attach-id]').val(attach_id);$('form[name=send-media] input[name=url]').val(url);$('form[name=send-media] input[name=action]').val('polls_upload_image');$('form[name=send-media]').ajaxSubmit(function(response){uploading=false;response=response.replace(/<div.*/,'');if(response.substr(0,4)=='true'){var parts=response.split('||');add_media(parts[4],parts[1],parts[2]);}
|
17 |
+
else
|
18 |
+
add_media(media_id,'','');});return false;}
|
19 |
+
function add_media(media_id,upload_id,img){if(parseInt(upload_id)>0)$('input[name="mediaType\['+media_id+'\]"]').val(1);else $('input[name="mediaType\['+media_id+'\]"]').val(2);if(is_ssl())img.replace('http://','https://');var link=$('div.hidden-links').find('div.delete-media-link').html();img+=link;var img_container=$('input[name="media\['+media_id+'\]"]').parents('td.answer-media-icons').find('li.media-preview');img_container.removeClass('st_image_loader');img_container.html(img);img_container.addClass('image-added');$('input[name="media\['+media_id+'\]"]').val(upload_id);init();};function get_number_answers(){var num_answers=parseInt($('.answer').size());$('input.answer-text').each(function(){var item=this;if($(item).val()==opts.new_answer||$(item).hasClass('idle'))num_answers--;});return num_answers;}
|
20 |
+
init();var api={add_media:add_media};return api;}});
|
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.
|
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.
|
39 |
$this->multiple_accounts = true;
|
40 |
$this->polldaddy_client_class = 'api_client';
|
41 |
$this->polldaddy_clients = array();
|
@@ -740,7 +740,7 @@ class WP_Polldaddy {
|
|
740 |
}
|
741 |
|
742 |
$answers = array();
|
743 |
-
foreach ( $_POST['answer'] as $answer ) {
|
744 |
$answer = stripslashes( trim( $answer ) );
|
745 |
|
746 |
if ( strlen( $answer ) > 0 ) {
|
@@ -748,7 +748,7 @@ class WP_Polldaddy {
|
|
748 |
|
749 |
$args['text'] = (string) $answer;
|
750 |
|
751 |
-
$answer_id = (int) str_replace('new', '', $
|
752 |
$mc = '';
|
753 |
$mt = 0;
|
754 |
|
@@ -819,7 +819,7 @@ class WP_Polldaddy {
|
|
819 |
|
820 |
if ( isset( $mediaType[999999999] ) )
|
821 |
$poll_data['mediaType'] = intval( $mediaType[999999999] );
|
822 |
-
|
823 |
$poll = $polldaddy->create_poll( $poll_data );
|
824 |
$this->parse_errors( $polldaddy );
|
825 |
|
@@ -1636,6 +1636,8 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"></scr
|
|
1636 |
}
|
1637 |
}
|
1638 |
$this->print_errors();
|
|
|
|
|
1639 |
?>
|
1640 |
|
1641 |
<form enctype="multipart/form-data" name="send-media" action="admin-ajax.php" method="post">
|
@@ -1837,17 +1839,16 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"></scr
|
|
1837 |
<td class="answer-media-icons" <?php echo isset( $_GET['iframe'] ) ? 'style="width: 55px !important;"' : '';?>>
|
1838 |
<ul class="answer-media" <?php echo isset( $_GET['iframe'] ) ? 'style="min-width: 30px;"' : '';?>>
|
1839 |
<?php if ( $mediaType[999999999] == 2 ) { ?>
|
1840 |
-
<li class="media-preview" style="width: 20px; height: 16px; padding-left: 5px;"><img height="16" width="16" src="<?php echo
|
1841 |
-
<?php } else {
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
|
1848 |
-
|
1849 |
-
|
1850 |
-
echo $url; ?></li>
|
1851 |
<?php }
|
1852 |
|
1853 |
if ( !isset( $_GET['iframe'] ) ) : ?>
|
@@ -1904,17 +1905,16 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"></scr
|
|
1904 |
<td class="answer-media-icons" <?php echo isset( $_GET['iframe'] ) ? 'style="width: 55px !important;"' : '';?>>
|
1905 |
<ul class="answer-media" <?php echo isset( $_GET['iframe'] ) ? 'style="min-width: 30px;"' : '';?>>
|
1906 |
<?php if ( isset( $mediaType[$answer_id] ) && $mediaType[$answer_id] == 2 ) { ?>
|
1907 |
-
<li class="media-preview" style="width: 20px; height: 16px; padding-left: 5px;"><img height="16" width="16" src="<?php echo
|
1908 |
-
<?php } else {
|
1909 |
-
|
1910 |
-
|
1911 |
-
|
1912 |
-
$url = urldecode( $media[$answer_id]->img_small );
|
1913 |
|
1914 |
-
|
1915 |
-
|
1916 |
-
|
1917 |
-
|
1918 |
<?php }
|
1919 |
|
1920 |
if ( !isset( $_GET['iframe'] ) ) : ?>
|
@@ -1992,6 +1992,8 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"></scr
|
|
1992 |
|
1993 |
</div>
|
1994 |
</div>
|
|
|
|
|
1995 |
|
1996 |
<div id="design" class="postbox">
|
1997 |
|
@@ -2289,7 +2291,8 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"></scr
|
|
2289 |
add_audio_title: '<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>',
|
2290 |
add_video_title: '<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>',
|
2291 |
standard_styles: '<?php echo esc_attr( __( 'Standard Styles', 'polldaddy' ) ); ?>',
|
2292 |
-
custom_styles: '<?php echo esc_attr( __( 'Custom Styles', 'polldaddy' ) ); ?>'
|
|
|
2293 |
} );
|
2294 |
});
|
2295 |
</script>
|
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 |
$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();
|
740 |
}
|
741 |
|
742 |
$answers = array();
|
743 |
+
foreach ( $_POST['answer'] as $answer_id => $answer ) {
|
744 |
$answer = stripslashes( trim( $answer ) );
|
745 |
|
746 |
if ( strlen( $answer ) > 0 ) {
|
748 |
|
749 |
$args['text'] = (string) $answer;
|
750 |
|
751 |
+
$answer_id = (int) str_replace('new', '', $answer_id );
|
752 |
$mc = '';
|
753 |
$mt = 0;
|
754 |
|
819 |
|
820 |
if ( isset( $mediaType[999999999] ) )
|
821 |
$poll_data['mediaType'] = intval( $mediaType[999999999] );
|
822 |
+
|
823 |
$poll = $polldaddy->create_poll( $poll_data );
|
824 |
$this->parse_errors( $polldaddy );
|
825 |
|
1636 |
}
|
1637 |
}
|
1638 |
$this->print_errors();
|
1639 |
+
|
1640 |
+
$delete_media_link = '<a href="#" class="delete-media delete hidden" title="' . esc_attr( __( 'delete this image' ) ) . '"><img src="' . $this->base_url . 'img/icon-clear-search.png" width="16" height="16" /></a>';
|
1641 |
?>
|
1642 |
|
1643 |
<form enctype="multipart/form-data" name="send-media" action="admin-ajax.php" method="post">
|
1839 |
<td class="answer-media-icons" <?php echo isset( $_GET['iframe'] ) ? 'style="width: 55px !important;"' : '';?>>
|
1840 |
<ul class="answer-media" <?php echo isset( $_GET['iframe'] ) ? 'style="min-width: 30px;"' : '';?>>
|
1841 |
<?php if ( $mediaType[999999999] == 2 ) { ?>
|
1842 |
+
<li class="media-preview image-added" style="width: 20px; height: 16px; padding-left: 5px;"><img height="16" width="16" src="<?php echo $this->base_url; ?>img/icon-report-ip-analysis.png" alt="Video Embed"><?php echo $delete_media_link;?></li>
|
1843 |
+
<?php } else {
|
1844 |
+
$url = '';
|
1845 |
+
if ( isset($media[999999999]) ) {
|
1846 |
+
$url = urldecode( $media[999999999]->img_small );
|
1847 |
+
|
1848 |
+
if ( is_ssl() )
|
1849 |
+
$url = preg_replace( '/http\:/', 'https:', $url );
|
1850 |
+
}?>
|
1851 |
+
<li class="media-preview <?php echo !empty( $url ) ? 'image-added' : ''; ?>" style="width: 20px; height: 16px; padding-left: 5px;"><?php echo $url; ?><?php echo $delete_media_link;?></li>
|
|
|
1852 |
<?php }
|
1853 |
|
1854 |
if ( !isset( $_GET['iframe'] ) ) : ?>
|
1905 |
<td class="answer-media-icons" <?php echo isset( $_GET['iframe'] ) ? 'style="width: 55px !important;"' : '';?>>
|
1906 |
<ul class="answer-media" <?php echo isset( $_GET['iframe'] ) ? 'style="min-width: 30px;"' : '';?>>
|
1907 |
<?php if ( isset( $mediaType[$answer_id] ) && $mediaType[$answer_id] == 2 ) { ?>
|
1908 |
+
<li class="media-preview image-added" style="width: 20px; height: 16px; padding-left: 5px;"><img height="16" width="16" src="<?php echo $this->base_url; ?>img/icon-report-ip-analysis.png" alt="Video Embed"><?php echo $delete_media_link;?></li>
|
1909 |
+
<?php } else {
|
1910 |
+
$url = '';
|
1911 |
+
if ( isset($media[$answer_id]) ) {
|
1912 |
+
$url = urldecode( $media[$answer_id]->img_small );
|
|
|
1913 |
|
1914 |
+
if ( is_ssl() )
|
1915 |
+
$url = preg_replace( '/http\:/', 'https:', $url );
|
1916 |
+
}?>
|
1917 |
+
<li class="media-preview <?php echo !empty( $url ) ? 'image-added' : ''; ?>" style="width: 20px; height: 16px; padding-left: 5px;"><?php echo $url; ?><?php echo $delete_media_link;?></li>
|
1918 |
<?php }
|
1919 |
|
1920 |
if ( !isset( $_GET['iframe'] ) ) : ?>
|
1992 |
|
1993 |
</div>
|
1994 |
</div>
|
1995 |
+
|
1996 |
+
<div class="hidden-links"><div class="delete-media-link"><?php echo $delete_media_link;?></div></div>
|
1997 |
|
1998 |
<div id="design" class="postbox">
|
1999 |
|
2291 |
add_audio_title: '<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>',
|
2292 |
add_video_title: '<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>',
|
2293 |
standard_styles: '<?php echo esc_attr( __( 'Standard Styles', 'polldaddy' ) ); ?>',
|
2294 |
+
custom_styles: '<?php echo esc_attr( __( 'Custom Styles', 'polldaddy' ) ); ?>',
|
2295 |
+
base_url: '<?php echo esc_attr( $this->base_url ); ?>'
|
2296 |
} );
|
2297 |
});
|
2298 |
</script>
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ 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.
|
7 |
|
8 |
Create and manage Polldaddy polls and ratings from within WordPress.
|
9 |
|
@@ -105,9 +105,14 @@ Your theme is getting the post content, without necessarily showing it. If the p
|
|
105 |
|
106 |
== Upgrade Notice ==
|
107 |
= 2.0.17 =
|
108 |
-
|
109 |
|
110 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
111 |
= 2.0.17 =
|
112 |
* Updated ratings settings to allow blog to show rating in search and archive pages
|
113 |
* Updated how ratings are shown in excerpts which should work better with Jetpack and certain themes
|
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 |
|
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
|
114 |
+
* Fixed bug with missing retina image for polldaddy icon
|
115 |
+
|
116 |
= 2.0.17 =
|
117 |
* Updated ratings settings to allow blog to show rating in search and archive pages
|
118 |
* Updated how ratings are shown in excerpts which should work better with Jetpack and certain themes
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-4.png
CHANGED
Binary file
|