[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/libraries/jquery/ckeditor/ -> ckeditor_basic.js (source)

   1  /*

   2  Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.

   3  For licensing, see LICENSE.html or http://ckeditor.com/license

   4  */
   5  
   6  (function(){
   7      if(window.CKEDITOR&&window.CKEDITOR.dom)return;
   8      if(!window.CKEDITOR)window.CKEDITOR=(function(){
   9          var a={
  10              timestamp:'C3HA5RM',
  11              version:'3.6.3',
  12              revision:'7474',
  13              rnd:Math.floor(Math.random()*900)+100,
  14              _:{},
  15              status:'unloaded',
  16              basePath:(function(){
  17                  var d=window.CKEDITOR_BASEPATH||'';
  18                  if(!d){
  19                      var e=document.getElementsByTagName('script');
  20                      for(var f=0;f<e.length;f++){
  21                          var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);
  22                          if(g){
  23                              d=g[1];
  24                              break;
  25                          }
  26                      }
  27                      }
  28                  if(d.indexOf(':/')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;
  29              if(!d)throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';
  30              return d;
  31          })(),
  32          getUrl:function(d){
  33          if(d.indexOf(':/')==-1&&d.indexOf('/')!==0)d=this.basePath+d;
  34          if(this.timestamp&&d.charAt(d.length-1)!='/'&&!/[&?]t=/.test(d))d+=(d.indexOf('?')>=0?'&':'?')+'t='+this.timestamp;
  35          return d;
  36      }
  37      },b=window.CKEDITOR_GETURL;
  38      if(b){
  39          var c=a.getUrl;
  40          a.getUrl=function(d){
  41              return b.call(a,d)||c.call(a,d);
  42          };
  43      
  44  }
  45  return a;
  46  })();
  47  var a=CKEDITOR;
  48  if(!a.event){
  49      a.event=function(){};
  50      
  51      a.event.implementOn=function(b){
  52          var c=a.event.prototype;
  53          for(var d in c){
  54              if(b[d]==undefined)b[d]=c[d];
  55          }
  56          };
  57          
  58  a.event.prototype=(function(){
  59      var b=function(d){
  60          var e=d.getPrivate&&d.getPrivate()||d._||(d._={});
  61          return e.events||(e.events={});
  62      },c=function(d){
  63          this.name=d;
  64          this.listeners=[];
  65      };
  66      
  67      c.prototype={
  68          getListenerIndex:function(d){
  69              for(var e=0,f=this.listeners;e<f.length;e++){
  70                  if(f[e].fn==d)return e;
  71              }
  72              return-1;
  73          }
  74      };
  75      
  76  return{
  77      on:function(d,e,f,g,h){
  78          var i=b(this),j=i[d]||(i[d]=new c(d));
  79          if(j.getListenerIndex(e)<0){
  80              var k=j.listeners;
  81              if(!f)f=this;
  82              if(isNaN(h))h=10;
  83              var l=this,m=function(o,p,q,r){
  84                  var s={
  85                      name:d,
  86                      sender:this,
  87                      editor:o,
  88                      data:p,
  89                      listenerData:g,
  90                      stop:q,
  91                      cancel:r,
  92                      removeListener:function(){
  93                          l.removeListener(d,e);
  94                      }
  95                  };
  96                  
  97              e.call(f,s);
  98              return s.data;
  99          };
 100          
 101          m.fn=e;
 102          m.priority=h;
 103          for(var n=k.length-1;n>=0;n--){
 104              if(k[n].priority<=h){
 105                  k.splice(n+1,0,m);
 106                  return;
 107              }
 108          }
 109          k.unshift(m);
 110  }
 111  },
 112  fire:(function(){
 113      var d=false,e=function(){
 114          d=true;
 115      },f=false,g=function(){
 116          f=true;
 117      };
 118      
 119      return function(h,i,j){
 120          var k=b(this)[h],l=d,m=f;
 121          d=f=false;
 122          if(k){
 123              var n=k.listeners;
 124              if(n.length){
 125                  n=n.slice(0);
 126                  for(var o=0;o<n.length;o++){
 127                      var p=n[o].call(this,j,i,e,g);
 128                      if(typeof p!='undefined')i=p;
 129                      if(d||f)break;
 130                  }
 131                  }
 132              }
 133      var q=f||(typeof i=='undefined'?false:i);
 134      d=l;
 135      f=m;
 136      return q;
 137  };
 138  
 139  })(),
 140  fireOnce:function(d,e,f){
 141      var g=this.fire(d,e,f);
 142      delete b(this)[d];
 143      return g;
 144  },
 145  removeListener:function(d,e){
 146      var f=b(this)[d];
 147      if(f){
 148          var g=f.getListenerIndex(e);
 149          if(g>=0)f.listeners.splice(g,1);
 150      }
 151  },
 152  hasListeners:function(d){
 153      var e=b(this)[d];
 154      return e&&e.listeners.length>0;
 155  }
 156  };
 157  
 158  })();
 159  }
 160  if(!a.editor){
 161      a.ELEMENT_MODE_NONE=0;
 162      a.ELEMENT_MODE_REPLACE=1;
 163      a.ELEMENT_MODE_APPENDTO=2;
 164      a.editor=function(b,c,d,e){
 165          var f=this;
 166          f._={
 167              instanceConfig:b,
 168              element:c,
 169              data:e
 170          };
 171          
 172          f.elementMode=d||0;
 173          a.event.call(f);
 174          f._init();
 175      };
 176      
 177      a.editor.replace=function(b,c){
 178          var d=b;
 179          if(typeof d!='object'){
 180              d=document.getElementById(b);
 181              if(d&&d.tagName.toLowerCase() in {
 182                  style:1,
 183                  script:1,
 184                  base:1,
 185                  link:1,
 186                  meta:1,
 187                  title:1
 188              })d=null;
 189              if(!d){
 190                  var e=0,f=document.getElementsByName(b);
 191                  while((d=f[e++])&&d.tagName.toLowerCase()!='textarea'){}
 192              }
 193              if(!d)throw '[CKEDITOR.editor.replace] The element with id or name "'+b+'" was not found.';
 194      }
 195      d.style.visibility='hidden';
 196      return new a.editor(c,d,1);
 197  };
 198  
 199  a.editor.appendTo=function(b,c,d){
 200      var e=b;
 201      if(typeof e!='object'){
 202          e=document.getElementById(b);
 203          if(!e)throw '[CKEDITOR.editor.appendTo] The element with id "'+b+'" was not found.';
 204      }
 205      return new a.editor(c,e,2,d);
 206  };
 207  
 208  a.editor.prototype={
 209      _init:function(){
 210          var b=a.editor._pending||(a.editor._pending=[]);
 211          b.push(this);
 212      },
 213      fire:function(b,c){
 214          return a.event.prototype.fire.call(this,b,c,this);
 215      },
 216      fireOnce:function(b,c){
 217          return a.event.prototype.fireOnce.call(this,b,c,this);
 218      }
 219  };
 220  
 221  a.event.implementOn(a.editor.prototype,true);
 222  }
 223  if(!a.env)a.env=(function(){
 224      var b=navigator.userAgent.toLowerCase(),c=window.opera,d={
 225          ie:/*@cc_on!@*/false,
 226          opera:!!c&&c.version,
 227          webkit:b.indexOf(' applewebkit/')>-1,
 228          air:b.indexOf(' adobeair/')>-1,
 229          mac:b.indexOf('macintosh')>-1,
 230          quirks:document.compatMode=='BackCompat',
 231          mobile:b.indexOf('mobile')>-1,
 232          iOS:/(ipad|iphone|ipod)/.test(b),
 233          isCustomDomain:function(){
 234              if(!this.ie)return false;
 235              var g=document.domain,h=window.location.hostname;
 236              return g!=h&&g!='['+h+']';
 237          },
 238          secure:location.protocol=='https:'
 239          };
 240          
 241      d.gecko=navigator.product=='Gecko'&&!d.webkit&&!d.opera;
 242      var e=0;
 243      if(d.ie){
 244          e=parseFloat(b.match(/msie (\d+)/)[1]);
 245          d.ie8=!!document.documentMode;
 246          d.ie8Compat=document.documentMode==8;
 247          d.ie9Compat=document.documentMode==9;
 248          d.ie7Compat=e==7&&!document.documentMode||document.documentMode==7;
 249          d.ie6Compat=e<7||d.quirks;
 250      }
 251      if(d.gecko){
 252          var f=b.match(/rv:([\d\.]+)/);
 253          if(f){
 254              f=f[1].split('.');
 255              e=f[0]*10000+(f[1]||0)*100+ +(f[2]||0);
 256          }
 257      }
 258      if(d.opera)e=parseFloat(c.version());
 259      if(d.air)e=parseFloat(b.match(/ adobeair\/(\d+)/)[1]);
 260      if(d.webkit)e=parseFloat(b.match(/ applewebkit\/(\d+)/)[1]);
 261      d.version=e;
 262      d.isCompatible=d.iOS&&e>=534||!d.mobile&&(d.ie&&e>=6||d.gecko&&e>=10801||d.opera&&e>=9.5||d.air&&e>=1||d.webkit&&e>=522||false);
 263      d.cssClass='cke_browser_'+(d.ie?'ie':d.gecko?'gecko':d.opera?'opera':d.webkit?'webkit':'unknown');
 264      if(d.quirks)d.cssClass+=' cke_browser_quirks';
 265      if(d.ie){
 266          d.cssClass+=' cke_browser_ie'+(d.version<7?'6':d.version>=8?document.documentMode:'7');
 267          if(d.quirks)d.cssClass+=' cke_browser_iequirks';
 268      }
 269      if(d.gecko&&e<10900)d.cssClass+=' cke_browser_gecko18';
 270      if(d.air)d.cssClass+=' cke_browser_air';
 271      return d;
 272  })();
 273  var b=a.env;
 274  var c=b.ie;
 275  if(a.status=='unloaded')(function(){
 276      a.event.implementOn(a);
 277      a.loadFullCore=function(){
 278          if(a.status!='basic_ready'){
 279              a.loadFullCore._load=1;
 280              return;
 281          }
 282          delete a.loadFullCore;
 283          var e=document.createElement('script');
 284          e.type='text/javascript';
 285          e.src=a.basePath+'ckeditor.js';
 286          document.getElementsByTagName('head')[0].appendChild(e);
 287      };
 288      
 289      a.loadFullCoreTimeout=0;
 290      a.replaceClass='ckeditor';
 291      a.replaceByClassEnabled=1;
 292      var d=function(e,f,g,h){
 293          if(b.isCompatible){
 294              if(a.loadFullCore)a.loadFullCore();
 295              var i=g(e,f,h);
 296              a.add(i);
 297              return i;
 298          }
 299          return null;
 300      };
 301      
 302      a.replace=function(e,f){
 303          return d(e,f,a.editor.replace);
 304      };
 305      
 306      a.appendTo=function(e,f,g){
 307          return d(e,f,a.editor.appendTo,g);
 308      };
 309      
 310      a.add=function(e){
 311          var f=this._.pending||(this._.pending=[]);
 312          f.push(e);
 313      };
 314      
 315      a.replaceAll=function(){
 316          var e=document.getElementsByTagName('textarea');
 317          for(var f=0;f<e.length;f++){
 318              var g=null,h=e[f];
 319              if(!h.name&&!h.id)continue;
 320              if(typeof arguments[0]=='string'){
 321                  var i=new RegExp('(?:^|\\s)'+arguments[0]+'(?:$|\\s)');
 322                  if(!i.test(h.className))continue;
 323              }else if(typeof arguments[0]=='function'){
 324                  g={};
 325                  
 326                  if(arguments[0](h,g)===false)continue;
 327              }
 328              this.replace(h,g);
 329          }
 330          };
 331  (function(){
 332      var e=function(){
 333          var f=a.loadFullCore,g=a.loadFullCoreTimeout;
 334          if(a.replaceByClassEnabled)a.replaceAll(a.replaceClass);
 335          a.status='basic_ready';
 336          if(f&&f._load)f();
 337          else if(g)setTimeout(function(){
 338              if(a.loadFullCore)a.loadFullCore();
 339          },g*1000);
 340      };
 341      
 342      if(window.addEventListener)window.addEventListener('load',e,false);
 343      else if(window.attachEvent)window.attachEvent('onload',e);
 344  })();
 345      a.status='basic_loaded';
 346      })();
 347  })();


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1