Skip to content

Commit

Permalink
Use POST
Browse files Browse the repository at this point in the history
  • Loading branch information
lesterchan committed Sep 3, 2014
1 parent 25c8689 commit 44aacb2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: GamerZ
Donate link: http://lesterchan.net/site/donation/
Tags: poll, polls, polling, vote, booth, democracy, ajax, survey, post, widget
Requires at least: 3.9
Tested up to: 3.9
Tested up to: 4.0
Stable tag: 2.67

Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.
Expand All @@ -30,6 +30,7 @@ I spent most of my free time creating, updating, maintaining and supporting thes
## Changelog

### Version 2.67
* NEW: Use POST for View Results and Vote link
* FIXED: Added ?v=VERSION_NUMBER to the plugin TinyMCE JS because it is breaking a lot of editors due to cache issue
* FIXED: Added backward compatibility with [poll=1] in order not to break older polls

Expand Down
10 changes: 5 additions & 5 deletions polls-js.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ function poll_result(current_poll_id) {
if(pollsL10n.show_loading) {
$('#polls-' + poll_id + '-loading').show();
}
$.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'action=polls&view=result&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
$.ajax({type: 'POST', xhrFields: {withCredentials: true}, url: pollsL10n.ajax_url, data: 'action=polls&view=result&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
} else {
if(pollsL10n.show_loading) {
$('#polls-' + poll_id + '-loading').show();
}
$.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'action=polls&view=result&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
$.ajax({type: 'POST', xhrFields: {withCredentials: true}, url: pollsL10n.ajax_url, data: 'action=polls&view=result&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
}
} else {
alert(pollsL10n.text_wait);
Expand All @@ -108,12 +108,12 @@ function poll_booth(current_poll_id) {
if(pollsL10n.show_loading) {
$('#polls-' + poll_id + '-loading').show();
}
$.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'action=polls&view=booth&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
$.ajax({type: 'POST', xhrFields: {withCredentials: true}, url: pollsL10n.ajax_url, data: 'action=polls&view=booth&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
} else {
if(pollsL10n.show_loading) {
$('#polls-' + poll_id + '-loading').show();
}
$.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'action=polls&view=booth&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
$.ajax({type: 'POST', xhrFields: {withCredentials: true}, url: pollsL10n.ajax_url, data: 'action=polls&view=booth&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
}
} else {
alert(pollsL10n.text_wait);
Expand All @@ -140,4 +140,4 @@ function poll_process_success(data) {
// Set is_being_voted Status
function set_is_being_voted(voted_status) {
is_being_voted = voted_status;
}
}
4 changes: 2 additions & 2 deletions polls-js.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 44aacb2

Please sign in to comment.