[ Index ]

PHP Cross Reference of MyBB

title

Body

[close]

/jscripts/ -> post.js (source)

   1  var Post = {
   2      init: function()
   3      {
   4      },
   5  
   6      loadMultiQuoted: function()
   7      {
   8          if(use_xmlhttprequest == 1)
   9          {
  10              tid = document.input.tid.value;
  11              this.spinner = new ActivityIndicator("body", {image: imagepath + "/spinner_big.gif"});
  12              new Ajax.Request('xmlhttp.php?action=get_multiquoted&tid='+tid, {method: 'get', onComplete: function(request) { Post.multiQuotedLoaded(request); }});
  13              return false;
  14          }
  15          else
  16          {
  17              return true;
  18          }
  19      },
  20  
  21      loadMultiQuotedAll: function()
  22      {
  23          if(use_xmlhttprequest == 1)
  24          {
  25              this.spinner = new ActivityIndicator("body", {image: imagepath + "/spinner_big.gif"});
  26              new Ajax.Request('xmlhttp.php?action=get_multiquoted&load_all=1', {method: 'get', onComplete: function(request) { Post.multiQuotedLoaded(request); }});
  27              return false;
  28          }
  29          else
  30          {
  31              return true;
  32          }
  33      },
  34  
  35      multiQuotedLoaded: function(request)
  36      {
  37          if(request.responseText.match(/<error>(.*)<\/error>/))
  38          {
  39              message = request.responseText.match(/<error>(.*)<\/error>/);
  40  
  41              if(!message[1])
  42              {
  43                  message[1] = "An unknown error occurred.";
  44              }
  45              if(this.spinner)
  46              {
  47                  this.spinner.destroy();
  48                  this.spinner = '';
  49              }
  50              alert('There was an error fetching the posts.\n\n'+message[1]);
  51          }
  52          else if(request.responseText)
  53          {
  54              var id = 'message';
  55              if(typeof clickableEditor != 'undefined')
  56              {
  57                  id = clickableEditor.textarea;
  58              }
  59              if($(id).value)
  60              {
  61                  $(id).value += "\n";
  62              }
  63              $(id).value += request.responseText;
  64          }
  65          $('multiquote_unloaded').hide();
  66          document.input.quoted_ids.value = 'all';
  67          if(this.spinner)
  68          {
  69              this.spinner.destroy();
  70              this.spinner = '';
  71          }
  72      },
  73  
  74      clearMultiQuoted: function()
  75      {
  76          $('multiquote_unloaded').hide();
  77          Cookie.unset('multiquote');
  78      },
  79  
  80      removeAttachment: function(aid)
  81      {
  82          if(confirm(removeattach_confirm) == true)
  83          {
  84              document.input.attachmentaid.value = aid;
  85              document.input.attachmentact.value = "remove";
  86          }
  87          else
  88          {
  89              document.input.attachmentaid.value = 0;
  90              document.input.attachmentact.value = "";
  91              return false;
  92          }
  93      },
  94  
  95      attachmentAction: function(aid,action)
  96      {
  97          document.input.attachmentaid.value = aid;
  98          document.input.attachmentact.value = action;
  99      }
 100  };
 101  Event.observe(document, 'dom:loaded', Post.init);


Generated: Tue Oct 8 19:19:50 2013 Cross-referenced by PHPXref 0.7.1