Changeset 828725
- Timestamp:
- 12/26/2013 05:36:43 PM (12 years ago)
- Location:
- comment-contest/trunk
- Files:
-
- 4 added
- 17 edited
-
comment-contest.php (modified) (3 diffs)
-
css/comment-contest.css (modified) (1 diff)
-
css/comment-contest.min.css (modified) (1 diff)
-
img/minus.png (added)
-
img/plus.png (added)
-
js/OrgZhyweb_WPCommentContest_jQuery.js (modified) (6 diffs)
-
js/OrgZhyweb_WPCommentContest_jQuery.min.js (modified) (1 diff)
-
lang/comment-contest-fr_FR.mo (modified) (previous)
-
lang/comment-contest-fr_FR.po (modified) (18 diffs)
-
php/OrgZhyweb_WPCommentContest_AbstractTableUI.php (modified) (1 diff)
-
php/OrgZhyweb_WPCommentContest_MainUI.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
screenshot-1.png (modified) (previous)
-
screenshot-2.png (modified) (previous)
-
screenshot-3.png (modified) (previous)
-
screenshot-4.png (modified) (previous)
-
screenshot-5.png (modified) (previous)
-
screenshot-6.png (modified) (previous)
-
screenshot-7.png (modified) (previous)
-
screenshot-8.png (added)
-
screenshot-9.png (added)
Legend:
- Unmodified
- Added
- Removed
-
comment-contest/trunk/comment-contest.php
r828636 r828725 5 5 Description: If you create a contest on your website, you can draw all comments in a specific post 6 6 Author: Thomas "Zhykos" Cicognani 7 Version: 2. 1.37 Version: 2.2 8 8 Author URI: http://www.zhyweb.org/ 9 9 */ … … 69 69 */ 70 70 public function orgZhyweb_wpCommentContest_loadJsCSS() { 71 // Comment Contest Javascript file (needs jQuery, jQueryUI and jQueryUI Dialog)72 wp_register_script('OrgZhywebWPCommentContest.js', plugins_url('/js/OrgZhyweb_WPCommentContest_jQuery.min.js', __FILE__), array('jquery', 'jquery-ui-core', 'jquery-ui-dialog' ));71 // Comment Contest Javascript file (needs jQuery, jQueryUI, jQueryUI Dialog and jQueryUI DatePicker) 72 wp_register_script('OrgZhywebWPCommentContest.js', plugins_url('/js/OrgZhyweb_WPCommentContest_jQuery.min.js', __FILE__), array('jquery', 'jquery-ui-core', 'jquery-ui-dialog', 'jquery-ui-datepicker')); 73 73 wp_enqueue_script('OrgZhywebWPCommentContest.js'); 74 74 … … 77 77 wp_enqueue_script('TipTip.js'); 78 78 79 // jQuery UI Dialogstyle80 wp_enqueue_style(' wp-jquery-ui-dialog');79 // jQuery UI style 80 wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.min.css'); 81 81 82 82 // Plugin CSS -
comment-contest/trunk/css/comment-contest.css
r754147 r828725 50 50 .subsubsub { 51 51 clear: both; 52 } 53 54 #filters { 55 border-left: 1px dotted black; 56 padding-left: 10px; 57 margin-bottom: 20px; 52 58 } 53 59 -
comment-contest/trunk/css/comment-contest.min.css
r754147 r828725 1 .removedComment{background-color:#ffe5eb}.cheatComment{background-color:#ddffc9}.restoreLink{color:#006905;display:none}.cheatLink{color:#006905}.stopCheatLink{color:#bc0b0b;display:none}.help{height:15px;vertical-align:middle;margin-left:10px}#mainHelp{margin-top:15px}.subsubsub{clear:both}# tiptip_holder{display:none;position:absolute;top:0;left:0;z-index:99999}#tiptip_holder.tip_top{padding-bottom:5px}#tiptip_holder.tip_bottom{padding-top:5px}#tiptip_holder.tip_right{padding-left:5px}#tiptip_holder.tip_left{padding-right:5px}#tiptip_content{font-size:11px;color:#fff;text-shadow:0 0 2px #000;padding:4px 8px;border:1px solid rgba(255,255,255,.25);background-color:#191919;background-color:rgba(25,25,25,.92);background-image:-webkit-gradient(linear,0 0,0 100%,from(transparent),to(#000));border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;box-shadow:0 0 3px #555;-webkit-box-shadow:0 0 3px #555;-moz-box-shadow:0 0 3px #555}#tiptip_content code{background:#1d94cf;color:#fff;text-shadow:none;padding:2px;font-size:12px}#tiptip_content a{color:#0cf}#tiptip_content a:hover{color:#f93}#tiptip_arrow,#tiptip_arrow_inner{position:absolute;border:6px solid transparent;height:0;width:0}#tiptip_holder.tip_top #tiptip_arrow{border-top-color:#fff;border-top-color:rgba(255,255,255,.35)}#tiptip_holder.tip_bottom #tiptip_arrow{border-bottom-color:#fff;border-bottom-color:rgba(255,255,255,.35)}#tiptip_holder.tip_right #tiptip_arrow{border-right-color:#fff;border-right-color:rgba(255,255,255,.35)}#tiptip_holder.tip_left #tiptip_arrow{border-left-color:#fff;border-left-color:rgba(255,255,255,.35)}#tiptip_holder.tip_top #tiptip_arrow_inner{margin-top:-7px;margin-left:-6px;border-top-color:#191919;border-top-color:rgba(25,25,25,.92)}#tiptip_holder.tip_bottom #tiptip_arrow_inner{margin-top:-5px;margin-left:-6px;border-bottom-color:#191919;border-bottom-color:rgba(25,25,25,.92)}#tiptip_holder.tip_right #tiptip_arrow_inner{margin-top:-6px;margin-left:-5px;border-right-color:#191919;border-right-color:rgba(25,25,25,.92)}#tiptip_holder.tip_left #tiptip_arrow_inner{margin-top:-6px;margin-left:-7px;border-left-color:#191919;border-left-color:rgba(25,25,25,.92)}1 .removedComment{background-color:#ffe5eb}.cheatComment{background-color:#ddffc9}.restoreLink{color:#006905;display:none}.cheatLink{color:#006905}.stopCheatLink{color:#bc0b0b;display:none}.help{height:15px;vertical-align:middle;margin-left:10px}#mainHelp{margin-top:15px}.subsubsub{clear:both}#filters{border-left:1px dotted black;padding-left:10px;margin-bottom:20px}#tiptip_holder{display:none;position:absolute;top:0;left:0;z-index:99999}#tiptip_holder.tip_top{padding-bottom:5px}#tiptip_holder.tip_bottom{padding-top:5px}#tiptip_holder.tip_right{padding-left:5px}#tiptip_holder.tip_left{padding-right:5px}#tiptip_content{font-size:11px;color:#fff;text-shadow:0 0 2px #000;padding:4px 8px;border:1px solid rgba(255,255,255,0.25);background-color:#191919;background-color:rgba(25,25,25,0.92);background-image:-webkit-gradient(linear,0 0,0 100%,from(transparent),to(#000));border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;box-shadow:0 0 3px #555;-webkit-box-shadow:0 0 3px #555;-moz-box-shadow:0 0 3px #555}#tiptip_content code{background:#1d94cf;color:#fff;text-shadow:none;padding:2px;font-size:12px}#tiptip_content a{color:#0CF}#tiptip_content a:hover{color:#F93}#tiptip_arrow,#tiptip_arrow_inner{position:absolute;border:6px solid transparent;height:0;width:0}#tiptip_holder.tip_top #tiptip_arrow{border-top-color:#fff;border-top-color:rgba(255,255,255,0.35)}#tiptip_holder.tip_bottom #tiptip_arrow{border-bottom-color:#fff;border-bottom-color:rgba(255,255,255,0.35)}#tiptip_holder.tip_right #tiptip_arrow{border-right-color:#fff;border-right-color:rgba(255,255,255,0.35)}#tiptip_holder.tip_left #tiptip_arrow{border-left-color:#fff;border-left-color:rgba(255,255,255,0.35)}#tiptip_holder.tip_top #tiptip_arrow_inner{margin-top:-7px;margin-left:-6px;border-top-color:#191919;border-top-color:rgba(25,25,25,0.92)}#tiptip_holder.tip_bottom #tiptip_arrow_inner{margin-top:-5px;margin-left:-6px;border-bottom-color:#191919;border-bottom-color:rgba(25,25,25,0.92)}#tiptip_holder.tip_right #tiptip_arrow_inner{margin-top:-6px;margin-left:-5px;border-right-color:#191919;border-right-color:rgba(25,25,25,0.92)}#tiptip_holder.tip_left #tiptip_arrow_inner{margin-top:-6px;margin-left:-7px;border-left-color:#191919;border-left-color:rgba(25,25,25,0.92)} -
comment-contest/trunk/js/OrgZhyweb_WPCommentContest_jQuery.js
r754147 r828725 77 77 var line = jQuery(this); 78 78 79 // Search for span tag with class zhyweb_comment_contest_role" which is equal to "roleID"79 // Search for span tag with class "zhyweb_comment_contest_role" which is equal to "roleID" 80 80 // A user can have several roles, separated by a pipe (|) 81 81 var rolesStr = line.find('.zhyweb_comment_contest_role').text(); … … 110 110 } 111 111 112 /** 113 * Open / Hide filters DIV component 114 * @since 2.2 115 */ 116 function toggleFilters(pluginURL) { 117 var filtersDIV = jQuery('#filters'); 118 119 filtersDIV.fadeToggle("slow", "linear", function() { 120 if (filtersDIV.is(':visible')) { 121 jQuery('#filtersImg').attr('src', pluginURL + '/img/minus.png'); 122 } else { 123 jQuery('#filtersImg').attr('src', pluginURL + '/img/plus.png'); 124 } 125 }); 126 } 127 128 /** 129 * Select duplicated lines in the table. 130 * Lines are duplicated when a certain line parameter is the same in two lines. 131 * @param cssClassParameter [string] CSS class name for the searched parameter 132 * @since 2.2 133 */ 134 function selectDuplicates(cssClassParameter) { 135 var line1nb = 0; 136 jQuery('#contestForm tr').each(function() { 137 // Browse all table lines 138 var line1 = jQuery(this); 139 140 var line2nb = 0; 141 jQuery('#contestForm tr').each(function() { 142 // Browse all table lines 143 var line2 = jQuery(this); 144 if (line1nb != line2nb) { // Compare two different lines 145 var data1 = line1.find('.' + cssClassParameter).text(); 146 var data2 = line2.find('.' + cssClassParameter).text(); 147 if (data1 == data2 && data1 != "") { 148 // If data are equal => check both lines 149 line1.find('input[id^="cb-select"]').each(function() { 150 jQuery(this).attr("checked", true); 151 }); 152 line2.find('input[id^="cb-select"]').each(function() { 153 jQuery(this).attr("checked", true); 154 }); 155 } 156 } 157 158 line2nb++; 159 }); 160 161 line1nb++; 162 }); 163 } 164 112 165 // ----------------------------------------------------------------------------- 113 166 // jQuery ready document 114 167 115 168 jQuery(document).ready(function() { 169 170 // ------------------------ IP address filter ------------------------------ 171 172 jQuery('#ipAddressFilter').click(function() { 173 selectDuplicates("zhyweb_comment_contest_ip"); 174 }); 175 176 // ------------------------ end IP address filter -------------------------- 177 178 // ------------------------ Email filter ----------------------------------- 179 180 jQuery('#emailAddressFilter').click(function() { 181 selectDuplicates("zhyweb_comment_contest_email"); 182 }); 183 184 // ------------------------ end Email filter ------------------------------- 185 186 // ------------------------ Date filter ------------------------------------ 187 188 jQuery('#datepicker').datepicker(); 189 190 jQuery('#dateSubmit').click(function() { 191 // Clear error messages 192 jQuery('#zwpcc_dateFilter_error_message').hide(); 193 jQuery('#datepicker').css("border", "1px solid rgb(223,223,223)"); 194 jQuery('#dateHours').css("border", "1px solid rgb(223,223,223)"); 195 jQuery('#dateMinutes').css("border", "1px solid rgb(223,223,223)"); 196 197 // Check date format 198 var dateFormatOk = false; 199 var dateRegex = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/; 200 var dateValue = jQuery('#datepicker').val(); 201 var month = ""; 202 var day = ""; 203 var year = ""; 204 if (dateRegex.test(dateValue)) { 205 var match = dateRegex.exec(dateValue); 206 month = match[1]; 207 day = match[2]; 208 year = match[3]; 209 if (month > 0 && month < 13 && day > 0 && day <32 && year > 0) { 210 dateFormatOk = true; 211 } 212 } 213 214 if (dateFormatOk) { 215 // Check hours format 216 var dateHours = jQuery('#dateHours').val(); 217 var dateMinutes = jQuery('#dateMinutes').val(); 218 if (dateHours != "" && dateHours >= 0 && dateHours < 24 && dateMinutes != "" && dateMinutes >= 0 && dateMinutes < 60) { 219 // Date OK => Launch selection 220 jQuery('#contestForm tr').each(function() { 221 // Browse all table lines 222 var line = jQuery(this); 223 224 // Search for span tag with class "zhyweb_comment_contest_timestamp" 225 var timestampComment = line.find('.zhyweb_comment_contest_timestamp').text(); 226 if (timestampComment != "") { 227 var wantedTimestamp = year + month + day + dateHours + dateMinutes; 228 if (timestampComment > wantedTimestamp) { 229 // If comment time > deadline => Check the box in lines 230 line.find('input[id^="cb-select"]').each(function() { 231 jQuery(this).attr("checked", true); 232 }); 233 } 234 } 235 }); 236 } else { 237 jQuery('#zwpcc_dateFilter_error_message').show(); 238 jQuery('#dateHours').css("border", "2px solid red"); 239 jQuery('#dateMinutes').css("border", "2px solid red"); 240 } 241 } else { 242 jQuery('#zwpcc_dateFilter_error_message').show(); 243 jQuery('#datepicker').css("border", "2px solid red"); 244 } 245 }); 246 247 // ------------------------ END Date filter -------------------------------- 116 248 117 249 // ------------------------ Tooltips (Help) -------------------------------- … … 209 341 var line = jQuery(this); 210 342 211 // Get only normal etcheating lines343 // Get only normal and cheating lines 212 344 if (!line.hasClass("removedComment")) { 213 345 var commentID = line.find('.zhyweb_comment_contest_id').html(); … … 232 364 fisherYates(commentsCheat); 233 365 if (commentsCheat.length < nbWinners) { 234 // Optimisation 366 // Optimisation : randomize array only if necessary 235 367 fisherYates(commentsNormal); 236 368 } … … 253 385 254 386 // Clean all inputs 387 jQuery("#zwpcc_nbWinners_error_message").hide(); 255 388 jQuery(this).find('input').each(function() { 256 389 jQuery(this).css('border', '1px solid rgb(223,223,223)'); … … 259 392 // Check all values 260 393 // "Number of winners" must be numeric 261 if (!jQuery.isNumeric(jQuery("#zwpcc_nb_winners").val())) { 394 var nbWinners = jQuery("#zwpcc_nb_winners").val(); 395 if (!jQuery.isNumeric(nbWinners) || nbWinners <= 0) { 262 396 launch = false; 263 397 jQuery("#zwpcc_nb_winners").css('border', '2px solid red'); 398 jQuery("#zwpcc_nbWinners_error_message").show(); 264 399 } 265 400 -
comment-contest/trunk/js/OrgZhyweb_WPCommentContest_jQuery.min.js
r754147 r828725 1 function commentContestDelete( commentID){jQuery("#comment-contest-"+commentID).removeClass("cheatComment");jQuery("#comment-contest-"+commentID).addClass("removedComment");jQuery("#restoreLink-"+commentID).show();jQuery("#deleteLink-"+commentID).hide();jQuery("#stopCheatLink-"+commentID).hide();jQuery("#cheatLink-"+commentID).show()}function commentContestRestore(commentID){jQuery("#comment-contest-"+commentID).removeClass("removedComment");jQuery("#deleteLink-"+commentID).show();jQuery("#restoreLink-"+commentID).hide()}function commentContestCheat(commentID){jQuery("#comment-contest-"+commentID).removeClass("removedComment");jQuery("#comment-contest-"+commentID).addClass("cheatComment");jQuery("#stopCheatLink-"+commentID).show();jQuery("#cheatLink-"+commentID).hide();jQuery("#deleteLink-"+commentID).show();jQuery("#restoreLink-"+commentID).hide()}function commentContestStopCheat(commentID){jQuery("#comment-contest-"+commentID).removeClass("cheatComment");jQuery("#stopCheatLink-"+commentID).hide();jQuery("#cheatLink-"+commentID).show()}function selectRole(roleID){jQuery('#contestForm tr').each(function(){var line=jQuery(this);var rolesStr=line.find('.zhyweb_comment_contest_role').text();var roles=rolesStr.split('|');if(jQuery.inArray(roleID,roles)>=0&&rolesStr.length>0){line.find('input[id^="cb-select"]').each(function(){jQuery(this).attr("checked",true)})}})}function fisherYates(myArray){var i=myArray.length;if(i>0){while(--i){var j=Math.floor(Math.random()*(i+1));var tempi=myArray[i];var tempj=myArray[j];myArray[i]=tempj;myArray[j]=tempi}}}jQuery(document).ready(function(){jQuery('.help').tipTip({'attribute':'title','fadeIn':50,'fadeOut':50,'keepAlive':true,'activation':'hover','maxWidth':400});jQuery(".help").tipTip();function deleteSelectedComments(){jQuery('#contestForm input[id^="cb-select"]:checked').each(function(index,domElem){if(domElem.id.indexOf("-all-")==-1){commentContestDelete(jQuery(this).val())}else{jQuery(this).attr("checked",false)}})}jQuery("#contestForm #doaction").click(function(){if(jQuery('#contestForm select[name="action"]').val()=='delete'){deleteSelectedComments()}});jQuery("#contestForm #doaction2").click(function(){if(jQuery('#contestForm select[name="action2"]').val()=='delete'){deleteSelectedComments()}});function restoreSelectedComments(){jQuery('#contestForm input[id^="cb-select"]:checked').each(function(index,domElem){if(domElem.id.indexOf("-all-")==-1){commentContestRestore(jQuery(this).val())}else{jQuery(this).attr("checked",false)}})}jQuery("#contestForm #doaction").click(function(){if(jQuery('#contestForm select[name="action"]').val()=='restore'){restoreSelectedComments()}});jQuery("#contestForm #doaction2").click(function(){if(jQuery('#contestForm select[name="action2"]').val()=='restore'){restoreSelectedComments()}});jQuery("#dialog-modal-winners").dialog({height:500,width:800,modal:true,autoOpen:false,dialogClass:'wp-dialog',open:function(){var nbWinners=jQuery('#zwpcc_nb_winners').val();var commentsNormal=new Array();var commentsCheat=new Array();jQuery('#contestForm tr').each(function(){var line=jQuery(this);if(!line.hasClass("removedComment")){var commentID=line.find('.zhyweb_comment_contest_id').html();if(commentID!=null&&commentID!=""){if(line.hasClass("cheatComment")){commentsCheat.push(commentID)}else{commentsNormal.push(commentID)}}}});jQuery('#dialog-modal-winners tr[id^="result-comment-contest"]').each(function(){jQuery(this).hide()});fisherYates(commentsCheat);if(commentsCheat.length<nbWinners){fisherYates(commentsNormal)}var comments=jQuery.merge(commentsCheat,commentsNormal);for(var i=0;i<nbWinners&&i<comments.length;i++){jQuery("#result-comment-contest-"+comments[i]).show();if(i>=1){jQuery("#result-comment-contest-"+comments[i-1]).after(jQuery("#result-comment-contest-"+comments[i]))}}}});jQuery("#zwpcc_form").submit(function(){launch=true;jQuery(this).find('input').each(function(){jQuery(this).css('border','1px solid rgb(223,223,223)')});if(!jQuery.isNumeric(jQuery("#zwpcc_nb_winners").val())){launch=false;jQuery("#zwpcc_nb_winners").css('border','2px solid red')}if(launch){jQuery("#dialog-modal-winners").dialog("open")}return false})});1 function commentContestDelete(a){jQuery("#comment-contest-"+a).removeClass("cheatComment");jQuery("#comment-contest-"+a).addClass("removedComment");jQuery("#restoreLink-"+a).show();jQuery("#deleteLink-"+a).hide();jQuery("#stopCheatLink-"+a).hide();jQuery("#cheatLink-"+a).show()}function commentContestRestore(a){jQuery("#comment-contest-"+a).removeClass("removedComment");jQuery("#deleteLink-"+a).show();jQuery("#restoreLink-"+a).hide()}function commentContestCheat(a){jQuery("#comment-contest-"+a).removeClass("removedComment");jQuery("#comment-contest-"+a).addClass("cheatComment");jQuery("#stopCheatLink-"+a).show();jQuery("#cheatLink-"+a).hide();jQuery("#deleteLink-"+a).show();jQuery("#restoreLink-"+a).hide()}function commentContestStopCheat(a){jQuery("#comment-contest-"+a).removeClass("cheatComment");jQuery("#stopCheatLink-"+a).hide();jQuery("#cheatLink-"+a).show()}function selectRole(a){jQuery("#contestForm tr").each(function(){var c=jQuery(this);var b=c.find(".zhyweb_comment_contest_role").text();var d=b.split("|");if(jQuery.inArray(a,d)>=0&&b.length>0){c.find('input[id^="cb-select"]').each(function(){jQuery(this).attr("checked",true)})}})}function fisherYates(c){var b=c.length;if(b>0){while(--b){var a=Math.floor(Math.random()*(b+1));var e=c[b];var d=c[a];c[b]=d;c[a]=e}}}function toggleFilters(a){var b=jQuery("#filters");b.fadeToggle("slow","linear",function(){if(b.is(":visible")){jQuery("#filtersImg").attr("src",a+"/img/minus.png")}else{jQuery("#filtersImg").attr("src",a+"/img/plus.png")}})}function selectDuplicates(b){var a=0;jQuery("#contestForm tr").each(function(){var c=jQuery(this);var d=0;jQuery("#contestForm tr").each(function(){var f=jQuery(this);if(a!=d){var e=c.find("."+b).text();var g=f.find("."+b).text();if(e==g&&e!=""){c.find('input[id^="cb-select"]').each(function(){jQuery(this).attr("checked",true)});f.find('input[id^="cb-select"]').each(function(){jQuery(this).attr("checked",true)})}}d++});a++})}jQuery(document).ready(function(){jQuery("#ipAddressFilter").click(function(){selectDuplicates("zhyweb_comment_contest_ip")});jQuery("#emailAddressFilter").click(function(){selectDuplicates("zhyweb_comment_contest_email")});jQuery("#datepicker").datepicker();jQuery("#dateSubmit").click(function(){jQuery("#zwpcc_dateFilter_error_message").hide();jQuery("#datepicker").css("border","1px solid rgb(223,223,223)");jQuery("#dateHours").css("border","1px solid rgb(223,223,223)");jQuery("#dateMinutes").css("border","1px solid rgb(223,223,223)");var f=false;var d=/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/;var e=jQuery("#datepicker").val();var h="";var j="";var i="";if(d.test(e)){var g=d.exec(e);h=g[1];j=g[2];i=g[3];if(h>0&&h<13&&j>0&&j<32&&i>0){f=true}}if(f){var c=jQuery("#dateHours").val();var k=jQuery("#dateMinutes").val();if(c!=""&&c>=0&&c<24&&k!=""&&k>=0&&k<60){jQuery("#contestForm tr").each(function(){var m=jQuery(this);var n=m.find(".zhyweb_comment_contest_timestamp").text();if(n!=""){var l=i+h+j+c+k;if(n>l){m.find('input[id^="cb-select"]').each(function(){jQuery(this).attr("checked",true)})}}})}else{jQuery("#zwpcc_dateFilter_error_message").show();jQuery("#dateHours").css("border","2px solid red");jQuery("#dateMinutes").css("border","2px solid red")}}else{jQuery("#zwpcc_dateFilter_error_message").show();jQuery("#datepicker").css("border","2px solid red")}});jQuery(".help").tipTip({attribute:"title",fadeIn:50,fadeOut:50,keepAlive:true,activation:"hover",maxWidth:400});jQuery(".help").tipTip();function b(){jQuery('#contestForm input[id^="cb-select"]:checked').each(function(c,d){if(d.id.indexOf("-all-")==-1){commentContestDelete(jQuery(this).val())}else{jQuery(this).attr("checked",false)}})}jQuery("#contestForm #doaction").click(function(){if(jQuery('#contestForm select[name="action"]').val()=="delete"){b()}});jQuery("#contestForm #doaction2").click(function(){if(jQuery('#contestForm select[name="action2"]').val()=="delete"){b()}});function a(){jQuery('#contestForm input[id^="cb-select"]:checked').each(function(c,d){if(d.id.indexOf("-all-")==-1){commentContestRestore(jQuery(this).val())}else{jQuery(this).attr("checked",false)}})}jQuery("#contestForm #doaction").click(function(){if(jQuery('#contestForm select[name="action"]').val()=="restore"){a()}});jQuery("#contestForm #doaction2").click(function(){if(jQuery('#contestForm select[name="action2"]').val()=="restore"){a()}});jQuery("#dialog-modal-winners").dialog({height:500,width:800,modal:true,autoOpen:false,dialogClass:"wp-dialog",open:function(){var e=jQuery("#zwpcc_nb_winners").val();var d=new Array();var c=new Array();jQuery("#contestForm tr").each(function(){var h=jQuery(this);if(!h.hasClass("removedComment")){var i=h.find(".zhyweb_comment_contest_id").html();if(i!=null&&i!=""){if(h.hasClass("cheatComment")){c.push(i)}else{d.push(i)}}}});jQuery('#dialog-modal-winners tr[id^="result-comment-contest"]').each(function(){jQuery(this).hide()});fisherYates(c);if(c.length<e){fisherYates(d)}var g=jQuery.merge(c,d);for(var f=0;f<e&&f<g.length;f++){jQuery("#result-comment-contest-"+g[f]).show();if(f>=1){jQuery("#result-comment-contest-"+g[f-1]).after(jQuery("#result-comment-contest-"+g[f]))}}}});jQuery("#zwpcc_form").submit(function(){launch=true;jQuery("#zwpcc_nbWinners_error_message").hide();jQuery(this).find("input").each(function(){jQuery(this).css("border","1px solid rgb(223,223,223)")});var c=jQuery("#zwpcc_nb_winners").val();if(!jQuery.isNumeric(c)||c<=0){launch=false;jQuery("#zwpcc_nb_winners").css("border","2px solid red");jQuery("#zwpcc_nbWinners_error_message").show()}if(launch){jQuery("#dialog-modal-winners").dialog("open")}return false})}); -
comment-contest/trunk/lang/comment-contest-fr_FR.po
r754147 r828725 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: Comment Contest v2. 0\n"3 "Project-Id-Version: Comment Contest v2.2\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2013- 08-09 18:37+0100\n"6 "PO-Revision-Date: 2013- 08-09 18:38+0100\n"5 "POT-Creation-Date: 2013-12-26 18:23+0100\n" 6 "PO-Revision-Date: 2013-12-26 18:26+0100\n" 7 7 "Last-Translator: Thomas \"Zhykos\" Cicognani <tcicognani@zhyweb.org>\n" 8 8 "Language-Team: \n" … … 16 16 "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;" 17 17 "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n" 18 "X-Poedit-Basepath: \n" 18 "X-Poedit-Basepath: D:\\www\\zhyweb\\wordpress\\wp-content\\plugins\\comment-" 19 "contest\n" 19 20 "X-Textdomain-Support: yes\n" 20 21 "X-Poedit-SearchPath-0: .\n" … … 22 23 # @ comment-contest 23 24 #: comment-contest.php:92 php/OrgZhyweb_WPCommentContest_MainUI.php:64 24 #: php/OrgZhyweb_WPCommentContest_MainUI.php:6525 #: D:\www\zhyweb\wp-content\plugins\comment-contest/comment-contest.php:9226 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:6427 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:6528 25 msgid "Comment Contest" 29 26 msgstr "Comment Contest" … … 31 28 # @ comment-contest 32 29 #: comment-contest.php:103 33 #: D:\www\zhyweb\wp-content\plugins\comment-contest/comment-contest.php:10334 30 msgid "Contest" 35 31 msgstr "Concours" 36 32 37 33 # @ comment-contest 38 #: comment-contest.php:121 php/OrgZhyweb_WPCommentContest_MainUI.php:74 39 #: D:\www\zhyweb\wp-content\plugins\comment-contest/comment-contest.php:121 40 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:74 34 #: comment-contest.php:121 php/OrgZhyweb_WPCommentContest_MainUI.php:73 41 35 msgid "Launch contest" 42 36 msgstr "Lancer le concours" … … 44 38 # @ comment-contest 45 39 #: comment-contest.php:123 46 #: D:\www\zhyweb\wp-content\plugins\comment-contest/comment-contest.php:12347 40 msgid "No comment" 48 41 msgstr "Aucun commentaire" … … 51 44 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:65 52 45 #: php/OrgZhyweb_WPCommentContest_TableResults.php:33 53 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:6554 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableResults.php:3355 46 msgid "Author" 56 47 msgstr "Auteur" … … 59 50 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:66 60 51 #: php/OrgZhyweb_WPCommentContest_TableResults.php:34 61 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:6662 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableResults.php:3463 52 msgid "Comment" 64 53 msgstr "Commentaire" … … 66 55 # @ comment-contest 67 56 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:102 68 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:10269 57 #, php-format 70 58 msgid "Select: %s" … … 73 61 # @ comment-contest 74 62 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:135 75 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:13576 63 msgid "Select comment" 77 64 msgstr "Sélectionner le commentaire" 78 65 79 66 # @ comment-contest 80 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:221 81 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:221 67 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:230 82 68 #, php-format 83 69 msgid "Submitted on <a href=\"%1$s\">%2$s at %3$s</a>" … … 85 71 86 72 # @ comment-contest 87 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:222 88 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:222 73 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:231 89 74 msgid "Y/m/d" 90 75 msgstr "d / m / Y" 91 76 92 77 # @ comment-contest 93 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:229 94 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:229 78 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:238 95 79 #, php-format 96 80 msgid "In reply to <a href=\"%1$s\">%2$s</a>." … … 99 83 # @ comment-contest 100 84 #: php/OrgZhyweb_WPCommentContest_MainUI.php:47 101 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:47102 85 msgid "URL must have 'post' parameter as integer" 103 86 msgstr "Le paramètre 'post' dans l'URL doit être un nombre entier" … … 105 88 # @ comment-contest 106 89 #: php/OrgZhyweb_WPCommentContest_MainUI.php:50 107 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:50108 90 msgid "You have to be administrator to access this page" 109 91 msgstr "" … … 111 93 112 94 # @ comment-contest 113 #: php/OrgZhyweb_WPCommentContest_MainUI.php:68 114 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:68 95 #: php/OrgZhyweb_WPCommentContest_MainUI.php:67 115 96 #, php-format 116 97 msgid "Contest on post \"%s\"" … … 118 99 119 100 # @ comment-contest 120 #: php/OrgZhyweb_WPCommentContest_MainUI.php:72 121 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:72 101 #: php/OrgZhyweb_WPCommentContest_MainUI.php:70 102 msgid "Number of winners error" 103 msgstr "Erreur pour le nombre de gagnants" 104 105 # @ comment-contest 106 #: php/OrgZhyweb_WPCommentContest_MainUI.php:71 122 107 msgid "Number of winners:" 123 108 msgstr "Nombre de gagnants :" 124 109 125 #: php/OrgZhyweb_WPCommentContest_MainUI.php:73 126 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:73 110 #: php/OrgZhyweb_WPCommentContest_MainUI.php:72 127 111 msgid "Number of comments used to determine winners" 128 112 msgstr "Nombre de commentaires utilisés pour déterminer les gagnants" 129 113 130 114 # @ comment-contest 131 #: php/OrgZhyweb_WPCommentContest_MainUI.php:79 132 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:79 115 #: php/OrgZhyweb_WPCommentContest_MainUI.php:78 133 116 msgid "Winners" 134 117 msgstr "Gagnants" 135 118 136 119 # @ comment-contest 137 #: php/OrgZhyweb_WPCommentContest_MainUI.php:108 138 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:108 120 #: php/OrgZhyweb_WPCommentContest_MainUI.php:107 139 121 msgid "Comments used for the contest:" 140 122 msgstr "Commentaires utilisés pour le concours :" 141 123 142 #: php/OrgZhyweb_WPCommentContest_MainUI.php:109 143 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:109 124 #: php/OrgZhyweb_WPCommentContest_MainUI.php:110 144 125 msgid "" 145 126 "The table below shows all available comments. You have to choose which ones " … … 166 147 "utilisés que s'il n'a pas assez de commentaire de triche." 167 148 168 # @ comment-contest 149 #: php/OrgZhyweb_WPCommentContest_MainUI.php:120 150 msgid "Filters" 151 msgstr "Filtres" 152 153 # @ comment-contest 154 #: php/OrgZhyweb_WPCommentContest_MainUI.php:123 155 msgid "Contest deadline" 156 msgstr "Date limite du concours" 157 158 #: php/OrgZhyweb_WPCommentContest_MainUI.php:124 159 msgid "Wrong date format!" 160 msgstr "Mauvais format de date !" 161 162 #: php/OrgZhyweb_WPCommentContest_MainUI.php:125 163 msgid "Date:" 164 msgstr "Date :" 165 169 166 #: php/OrgZhyweb_WPCommentContest_MainUI.php:126 170 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:126 167 msgid "Hour (24h format):" 168 msgstr "Heure (format 24h) :" 169 170 #: php/OrgZhyweb_WPCommentContest_MainUI.php:126 171 msgid "h" 172 msgstr "h" 173 174 #: php/OrgZhyweb_WPCommentContest_MainUI.php:126 175 msgid "min" 176 msgstr "min" 177 178 #: php/OrgZhyweb_WPCommentContest_MainUI.php:127 179 msgid "Select comments after this deadline" 180 msgstr "Sélectionner tous les commentaires postés après cette date" 181 182 #: php/OrgZhyweb_WPCommentContest_MainUI.php:130 183 msgid "IP address" 184 msgstr "Adresse IP" 185 186 #: php/OrgZhyweb_WPCommentContest_MainUI.php:131 187 msgid "Select all comments with the same IP address" 188 msgstr "" 189 "Sélectionner tous les commentaires ayant été postés avec la même adresse IP" 190 191 #: php/OrgZhyweb_WPCommentContest_MainUI.php:134 192 msgid "Email address" 193 msgstr "Adresses email" 194 195 #: php/OrgZhyweb_WPCommentContest_MainUI.php:135 196 msgid "Select all comments with the same email" 197 msgstr "Sélectionner tous les commentaires ayant été postés avec le même email" 198 199 # @ comment-contest 200 #: php/OrgZhyweb_WPCommentContest_MainUI.php:151 171 201 msgid "URL 'post' parameter has to be valid" 172 202 msgstr "Le paramètre 'post' dans l'URL n'est pas valide" 173 203 174 204 # @ comment-contest 175 #: php/OrgZhyweb_WPCommentContest_MainUI.php:138 176 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:138 205 #: php/OrgZhyweb_WPCommentContest_MainUI.php:163 177 206 #, php-format 178 207 msgid "" … … 184 213 185 214 # @ comment-contest 186 #: php/OrgZhyweb_WPCommentContest_MainUI.php:140 187 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:140 215 #: php/OrgZhyweb_WPCommentContest_MainUI.php:165 188 216 msgid "Support:" 189 217 msgstr "Support :" 190 218 191 219 # @ comment-contest 192 #: php/OrgZhyweb_WPCommentContest_MainUI.php:1 41193 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:141220 #: php/OrgZhyweb_WPCommentContest_MainUI.php:166 221 #: php/OrgZhyweb_WPCommentContest_MainUI.php:167 194 222 msgid "Official page:" 195 223 msgstr "Page officielle :" 196 224 197 225 # @ comment-contest 198 #: php/OrgZhyweb_WPCommentContest_MainUI.php:145 199 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:145 226 #: php/OrgZhyweb_WPCommentContest_MainUI.php:171 200 227 msgid "Debug:" 201 228 msgstr "Debug :" … … 204 231 #: php/OrgZhyweb_WPCommentContest_TableUI.php:41 205 232 #: php/OrgZhyweb_WPCommentContest_TableUI.php:50 206 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableUI.php:41207 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableUI.php:50208 233 msgid "Delete" 209 234 msgstr "Supprimer" … … 212 237 #: php/OrgZhyweb_WPCommentContest_TableUI.php:42 213 238 #: php/OrgZhyweb_WPCommentContest_TableUI.php:51 214 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableUI.php:42215 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableUI.php:51216 239 msgid "Restore" 217 240 msgstr "Restaurer" 218 241 219 242 #: php/OrgZhyweb_WPCommentContest_TableUI.php:43 220 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableUI.php:43221 243 msgid "Cheat" 222 244 msgstr "Tricher" 223 245 224 246 #: php/OrgZhyweb_WPCommentContest_TableUI.php:44 225 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableUI.php:44226 247 msgid "Stop cheating" 227 248 msgstr "Ne plus tricher" -
comment-contest/trunk/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php
r754147 r828725 208 208 // Add comment ID (used to get winners) 209 209 echo '<span style="display:none" class="zhyweb_comment_contest_id">' . $comment->comment_ID . '</span>'; 210 211 // Add comment timestamp post 212 echo '<span style="display:none" class="zhyweb_comment_contest_timestamp">' . get_comment_date('YmdHi', $comment->comment_ID) . '</span>'; 213 214 // Add comment IP address 215 echo '<span style="display:none" class="zhyweb_comment_contest_ip">' . get_comment_author_IP($comment->comment_ID) . '</span>'; 216 217 // Add comment email 218 echo '<span style="display:none" class="zhyweb_comment_contest_email">' . $comment->comment_author_email . '</span>'; 210 219 } 211 220 -
comment-contest/trunk/php/OrgZhyweb_WPCommentContest_MainUI.php
r822566 r828725 68 68 69 69 // Contest parameters 70 echo "<div id=\"zwpcc_ error_message\" style=\"color: red\"></div>"70 echo "<div id=\"zwpcc_nbWinners_error_message\" style=\"color: red; display: none;\">" . __('Number of winners error', "comment-contest") . "</div>" 71 71 . __('Number of winners:', "comment-contest") . " <input type=\"text\" id=\"zwpcc_nb_winners\" value=\"1\"/>" 72 72 . "<img src=\"$this->pluginDir/img/help.png\" alt=\"Help\" class=\"help\" title=\"". __('Number of comments used to determine winners', "comment-contest") . "\" /><br /><br />" … … 105 105 $this->displayHeaderPage($postID); 106 106 107 echo "<br /><br /><hr /><h3 style=\"float: left;\">" . __('Comments used for the contest:', "comment-contest") . "</h3> 108 <img src=\"$this->pluginDir/img/help.png\" alt=\"Help\" class=\"help\" id=\"mainHelp\" title=\"". __("The table below shows all available comments. You have to choose which ones you want for the contest.<br />" 107 echo "<br /><br /><hr /><h3 style=\"float: left;\">" . __('Comments used for the contest:', "comment-contest") . "</h3>"; 108 109 // Help image 110 echo "<img src=\"$this->pluginDir/img/help.png\" alt=\"Help\" class=\"help\" id=\"mainHelp\" title=\"". __("The table below shows all available comments. You have to choose which ones you want for the contest.<br />" 109 111 . " - You can select users who have the same Wordpress role (see User page).<br />" 110 112 . " - You can remove comments from contest (don't be used to determine winners). Removed comments still are visible with red background color.<br />" 111 113 . " - You can also cheat by adding comments into a cheating list. All cheating comments will always win! (only if the cheating list length is less than the winners number). Cheating comments still are visible with green background color.<br />" 112 . " - The other comments (white/grey background) are only used if there isn't enough cheating comments.", "comment-contest") . "\" /> 113 <div id='contestForm'>"; 114 114 . " - The other comments (white/grey background) are only used if there isn't enough cheating comments.", "comment-contest") . "\" />"; 115 116 // Filters 117 echo "<div style='clear:both;'> 118 <span> 119 <a href='javascript:;' onclick='toggleFilters(\"$this->pluginDir\")'><img src='$this->pluginDir/img/plus.png' alt='expand/collapse' id='filtersImg' style='vertical-align: middle;' /></a> 120 <a href='javascript:;' onclick='toggleFilters(\"$this->pluginDir\")'>" . __('Filters', "comment-contest") . "</a> 121 </span> 122 <div id='filters' style='display: none;'> 123 <h4>" . __('Contest deadline', "comment-contest") . "</h4> 124 <div id='zwpcc_dateFilter_error_message' style='color: red; display: none;'>" . __('Wrong date format!', "comment-contest") . "</div> 125 " . __('Date:', "comment-contest") . " <input type='text' id='datepicker' /><br /> 126 " . __('Hour (24h format):', "comment-contest") . " <input type='text' id='dateHours' maxlength='2' size='3' />" . __('h', "comment-contest") . " <input type='text' id='dateMinutes' maxlength='2' size='3' />" . __('min', "comment-contest") . "<br /> 127 <br /><input type='button' class='button action' id='dateSubmit' value='" . __('Select comments after this deadline', "comment-contest") . "' /> 128 129 <br /><br /> 130 <h4>" . __('IP address', "comment-contest") . "</h4> 131 <input type='button' class='button action' id='ipAddressFilter' value='" . __('Select all comments with the same IP address', "comment-contest") . "' /> 132 133 <br /><br /> 134 <h4>" . __('Email address', "comment-contest") . "</h4> 135 <input type='button' class='button action' id='emailAddressFilter' value='" . __('Select all comments with the same email', "comment-contest") . "' /> 136 </div> 137 </div>"; 138 139 // Table 140 echo "<div id='contestForm'>"; 115 141 $list = new OrgZhyweb_WPCommentContest_TableUI($postID); 116 142 $list->prepare_items(); 117 143 $list->views(); 118 144 $list->display(); 119 120 145 echo "</div>"; 121 146 147 // Footer 122 148 $this->displayFooterPage(); 123 149 } else { -
comment-contest/trunk/readme.txt
r828636 r828725 32 32 = What are the available languages? = 33 33 34 * English by Thomas "Zhykos" Cicognani ;35 * French by Thomas "Zhykos" Cicognani ;36 * Spanish by Andrew Kurtis ;37 * Belorussian by P.C. ( partial since 2.0) ;38 * Dutch by Rene ( partial since 2.0)34 * English by Thomas "Zhykos" Cicognani (since 1.1) ; 35 * French by Thomas "Zhykos" Cicognani (since 1.0) ; 36 * Spanish by Andrew Kurtis (since 2.1.3 / partial since 2.2) ; 37 * Belorussian by P.C. (since 1.40.1 / partial since 2.0) ; 38 * Dutch by Rene (since 1.41.1 / partial since 2.0) 39 39 40 40 == Screenshots == … … 46 46 5. You can restore deleted comments (deleted comments are red) 47 47 6. Cheat: this comment will win! (cheating comments are green) 48 7. Result table with winner(s) 48 7. Filters 49 8. Help 50 9. Result table 49 51 50 52 == Changelog == 53 54 = 2.2 = 55 * New: Add filters to select comments posted after a date, to select comments with same IP address or email 56 * Misc: New screenshots 51 57 52 58 = 2.1.3 = … … 149 155 * Compatibility with Wordpress 3.6 150 156 157 = 2.2 = 158 * New features to filter comments 159 151 160 == Credits == 152 161 153 162 = Images = 154 163 * Help icon by http://www.visualpharm.com/ 164 * Plus and Minus icons by http://www.yanlu.de
Note: See TracChangeset
for help on using the changeset viewer.