Changeset 46116

Show
Ignore:
Timestamp:
05/16/08 04:38:48 (2 months ago)
Author:
ronalfy
Message:

Attemping to fix Ie bugs. It seems anything under 1 1/2 minutes can't be edited.

Location:
wp-ajax-edit-comments/trunk/2.0/wp-ajax-edit-comments
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • wp-ajax-edit-comments/trunk/2.0/wp-ajax-edit-comments/js/comment-editor.js.php

    r46113 r46116  
    4545      $j("#comment-options").attr("class", cookieValue); 
    4646    } 
     47     
    4748    //The "more options" button 
    4849      $j("#comment-options h3").bind("click", function() {  
     
    7677    s.timeout = 30000; 
    7778      //Change the edit text and events 
     79    $j("#status").show(); 
    7880    $j("#status").attr("class", "success"); 
    79     $j("#message").html("<?php _e('Loading...', $WPrapAjaxEditComments->localizationName) ?>"); 
     81  $j("#message").html("<?php _e('Loading...', $WPrapAjaxEditComments->localizationName) ?>"); 
    8082       
    8183    s.success = function(r) { 
  • wp-ajax-edit-comments/trunk/2.0/wp-ajax-edit-comments/js/wp-ajax-edit-comments.js.php

    r46113 r46116  
    8585      data.action = 'gettimeleft'; 
    8686      data.success = function(r) { 
    87             if (r == "-1") { 
    88             minutes = 0; 
    89           seconds = 0; 
    90         } else if (r == "1") { 
    91             return; 
    92         } 
    9387            var res = wpAjax.parseAjaxResponse(r, data.response,data.element); 
    9488        jQuery.each( res.responses, function() { 
    95             //todo - check for errors 
     89            if (this.what == "error" || this.what == "success") { 
     90            return; 
     91          } 
    9692            if (this.what == "minutes") { 
    9793            minutes = parseInt(this.data); 
     
    115111  //Parameters - timer (obj with timer data) 
    116112  function get_time_left_timer(timer) { 
     113  //todo in ie6 and ie7, anything under minute and 1/2 can't be edited. 
    117114      clearTimeout(timers[timer.cid]); 
    118115    seconds = timer.seconds - 1; 
     
    120117    element = timer.element; 
    121118    //Check to see if the time has run out 
    122             if (minutes ==0 && seconds == 0) {  
     119            if (minutes <=0 && seconds <= 0) {  
    123120                  $j("#edit" + timer.cid).unbind(); 
    124121      element.remove(); 
     
    142139      //This try statement is for the iFrame 
    143140      if (document.getElementById('TB_iframeContent') != undefined) { 
     141            //todo - does not work in ie 
    144142        $j("#timer" + timer.cid, document.getElementById('TB_iframeContent').contentDocument).html("&nbsp;(" + text + ")");; 
    145143      } 
  • wp-ajax-edit-comments/trunk/2.0/wp-ajax-edit-comments/wp-ajax-edit-comments.php

    r46113 r46116  
    546546                  //Get the Timestamp 
    547547                  $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                  } 
    549556                  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                        ));                
    551562                  } 
    552563                  //Get the time elapsed since making the comment