Changeset 46116
- Timestamp:
- 05/16/08 04:38:48 (2 months ago)
- Location:
- wp-ajax-edit-comments/trunk/2.0/wp-ajax-edit-comments
- Files:
-
- 3 modified
-
js/comment-editor.js.php (modified) (2 diffs)
-
js/wp-ajax-edit-comments.js.php (modified) (4 diffs)
-
wp-ajax-edit-comments.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-ajax-edit-comments/trunk/2.0/wp-ajax-edit-comments/js/comment-editor.js.php
r46113 r46116 45 45 $j("#comment-options").attr("class", cookieValue); 46 46 } 47 47 48 //The "more options" button 48 49 $j("#comment-options h3").bind("click", function() { … … 76 77 s.timeout = 30000; 77 78 //Change the edit text and events 79 $j("#status").show(); 78 80 $j("#status").attr("class", "success"); 79 $j("#message").html("<?php _e('Loading...', $WPrapAjaxEditComments->localizationName) ?>");81 $j("#message").html("<?php _e('Loading...', $WPrapAjaxEditComments->localizationName) ?>"); 80 82 81 83 s.success = function(r) { -
wp-ajax-edit-comments/trunk/2.0/wp-ajax-edit-comments/js/wp-ajax-edit-comments.js.php
r46113 r46116 85 85 data.action = 'gettimeleft'; 86 86 data.success = function(r) { 87 if (r == "-1") {88 minutes = 0;89 seconds = 0;90 } else if (r == "1") {91 return;92 }93 87 var res = wpAjax.parseAjaxResponse(r, data.response,data.element); 94 88 jQuery.each( res.responses, function() { 95 //todo - check for errors 89 if (this.what == "error" || this.what == "success") { 90 return; 91 } 96 92 if (this.what == "minutes") { 97 93 minutes = parseInt(this.data); … … 115 111 //Parameters - timer (obj with timer data) 116 112 function get_time_left_timer(timer) { 113 //todo in ie6 and ie7, anything under minute and 1/2 can't be edited. 117 114 clearTimeout(timers[timer.cid]); 118 115 seconds = timer.seconds - 1; … … 120 117 element = timer.element; 121 118 //Check to see if the time has run out 122 if (minutes ==0 && seconds == 0) {119 if (minutes <=0 && seconds <= 0) { 123 120 $j("#edit" + timer.cid).unbind(); 124 121 element.remove(); … … 142 139 //This try statement is for the iFrame 143 140 if (document.getElementById('TB_iframeContent') != undefined) { 141 //todo - does not work in ie 144 142 $j("#timer" + timer.cid, document.getElementById('TB_iframeContent').contentDocument).html(" (" + text + ")");; 145 143 } -
wp-ajax-edit-comments/trunk/2.0/wp-ajax-edit-comments/wp-ajax-edit-comments.php
r46113 r46116 546 546 //Get the Timestamp 547 547 $comment = $wpdb->get_row($query, ARRAY_A); 548 if (!$comment) { return "-1"; } 548 if (!$comment) { 549 $response->add( array( 550 'what' => 'error', 551 'id' => $commentID, 552 'data' => "-1" 553 )); 554 $response->send(); 555 } 549 556 if ($this->can_indefinitely_edit($comment['user_id'])) { 550 return "1"; 557 $response->add( array( 558 'what' => 'success', 559 'id' => $commentID, 560 'data' => "1" 561 )); 551 562 } 552 563 //Get the time elapsed since making the comment
