WordPress.org

Plugin Directory

Changeset 627459


Ignore:
Timestamp:
11/20/12 01:15:41 (17 months ago)
Author:
GamerZ
Message:

Remember "Maximum Number Of Selected Answers Allowed?" Props @ArtemR

Location:
wp-polls/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-polls/trunk/polls-admin-js.dev.js

    r546882 r627459  
     1// ==ClosureCompiler== 
     2// @output_file_name default.js 
     3// @compilation_level SIMPLE_OPTIMIZATIONS 
     4// ==/ClosureCompiler== 
     5 
    16/* 
    27+----------------------------------------------------------------+ 
     
    121126// Reoder Answer Answer 
    122127function reorder_answer_num() { 
     128    var selected = jQuery('#pollq_multiple').val(); 
    123129    jQuery('#pollq_multiple').empty(); 
    124130    jQuery('#poll_answers tr > th').each(function (i) { 
    125131        jQuery(this).text(pollsAdminL10n.text_answer + ' ' + (i+1)); 
    126         jQuery('#pollq_multiple').append('<option value="' + (i+1) + '">' + (i+1) + '</option>'); 
     132        if(selected == (i+1)) 
     133            jQuery('#pollq_multiple').append('<option value="' + (i+1) + '" selected="selected">' + (i+1) + '</option>'); 
     134        else 
     135            jQuery('#pollq_multiple').append('<option value="' + (i+1) + '">' + (i+1) + '</option>'); 
    127136    }); 
    128137} 
  • wp-polls/trunk/polls-admin-js.js

    r546882 r627459  
    77function opening_poll(a,b,c){if(open_poll_confirm=confirm(b))global_poll_id=a,jQuery.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_open_poll+"&pollq_id="+a+"&action=polls-admin&_ajax_nonce="+c,cache:!1,success:function(a){jQuery("#message").html(a);jQuery("#message").show();jQuery("#open_poll").hide();jQuery("#close_poll").show()}})} 
    88function closing_poll(a,b,c){if(close_poll_confirm=confirm(b))global_poll_id=a,jQuery.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_close_poll+"&pollq_id="+a+"&action=polls-admin&_ajax_nonce="+c,cache:!1,success:function(a){jQuery("#message").html(a);jQuery("#message").show();jQuery("#open_poll").show();jQuery("#close_poll").hide()}})} 
    9 function reorder_answer_num(){jQuery("#pollq_multiple").empty();jQuery("#poll_answers tr > th").each(function(a){jQuery(this).text(pollsAdminL10n.text_answer+" "+(a+1));jQuery("#pollq_multiple").append('<option value="'+(a+1)+'">'+(a+1)+"</option>")})} 
     9function reorder_answer_num(){var a=jQuery("#pollq_multiple").val();jQuery("#pollq_multiple").empty();jQuery("#poll_answers tr > th").each(function(b){jQuery(this).text(pollsAdminL10n.text_answer+" "+(b+1));a==b+1?jQuery("#pollq_multiple").append('<option value="'+(b+1)+'" selected="selected">'+(b+1)+"</option>"):jQuery("#pollq_multiple").append('<option value="'+(b+1)+'">'+(b+1)+"</option>")})} 
    1010function check_totalvotes(){temp_vote_count=0;jQuery("#poll_answers tr td input[size=4]").each(function(){temp_vote_count=isNaN(jQuery(this).val())?temp_vote_count+0:temp_vote_count+parseInt(jQuery(this).val())});jQuery("#pollq_totalvotes").val(temp_vote_count)} 
    1111function add_poll_answer_add(){jQuery("#poll_answers").append('<tr id="poll-answer-'+count_poll_answer+'"><th width="20%" scope="row" valign="top"></th><td width="80%"><input type="text" size="50" maxlength="200" name="polla_answers[]" />&nbsp;&nbsp;&nbsp;<input type="button" value="'+pollsAdminL10n.text_remove_poll_answer+'" onclick="remove_poll_answer_add('+count_poll_answer+');" class="button" /></td></tr>');count_poll_answer++;reorder_answer_num()} 
Note: See TracChangeset for help on using the changeset viewer.