Don't like ads? PRO users don't see any ads ;-)
Guest

Lasingksidng

By: a guest on May 5th, 2012  |  syntax: Bash  |  size: 1.66 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function fact(n){return n>1?n*fact(n-1):1;}
  2. RichPostor.prototype._init_idisk=function(){
  3.         var gl=this._option.bavl;
  4. try{this._option.userInfo.user.power.idisk=true;}catch(e){}
  5.         var allowed={
  6.                 "Ҹ":5,
  7.                 "indesign":6,
  8.                 };
  9.         if (gl>=allowed[this._data_postor.kw]) {
  10.                         this._option.open_idisk=true;
  11.                         this._option.power_idisk=true;
  12.                         this._option.upload_max_length=(gl>6?3:(gl>5?2:(gl>4?1:0)));
  13.                         this._option.upload_max_size=1024*1024*1024;
  14.                         this._editor.addPlugin("idisk", new TED.EditorPlugins.IdiskPlugin
  15.  
  16. (this._option.power_idisk, this._data_postor.fid, this._option.upload_max_length,
  17.  
  18. this._option.upload_max_size));
  19.             this._editor.on("idisk_upload_complete", function(e) {
  20.                 var h = this.getPostorDataObj("files");
  21.                 h = h || [];
  22.                 h.push({name: e.name,size: e.size,bucket: e.bucket,md5: e.md5,fileid: e.fileid});
  23.                 this.setPostorDataObj("files", h)
  24.             }, this);
  25.             this._editor.on("idisk_remove_file", function(l) {
  26.                 var k = this.getPostorDataObj("files");
  27.                 if (!k) {
  28.                     return
  29.                 }
  30.                 for (var h = 0, e = k.length; h < e; h++) {
  31.                     if (k[h]["bucket"] === l) {
  32.                         k.splice(h, 1);
  33.                         if (k.length === 0) {
  34.                             this.setPostorData("files", undefined)
  35.                         } else {
  36.                             this.setPostorDataObj("files", k)
  37.                         }
  38.                         return
  39.                     }
  40.                 }
  41.             }, this)
  42.         }
  43. }
  44.  
  45. rich_postor._init_idisk()