[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/mambots/editors/tinymce/jscripts/tiny_mce/ -> tiny_mce_gzip.js (source)

   1  var tinyMCE_GZ = {
   2      settings : {
   3          plugins : 'style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras',
   4          themes : 'simple,advanced',
   5          languages : 'en',
   6          disk_cache : false,
   7          page_name : 'tiny_mce_gzip.php',
   8          debug : false
   9      },
  10  
  11      init : function(s) {
  12          var n, d = document, nl, i, b = '', sr, db;
  13  
  14          this.isIE = (navigator.appName == "Microsoft Internet Explorer");
  15          this.isOpera = navigator.userAgent.indexOf('Opera') != -1;
  16  
  17          for (n in s)
  18              this.settings[n] = s[n];
  19  
  20          for (i=0, nl = d.getElementsByTagName('base'); i<nl.length; i++) {
  21              if (nl[i].href)
  22                  b = nl[i].href;
  23          }
  24  
  25          for (i=0, nl = d.getElementsByTagName('script'); i<nl.length; i++) {
  26              if (nl[i].src && nl[i].src.indexOf('tiny_mce_gzip') != -1) {
  27                  sr = nl[i].src;
  28                  sr = sr.substring(0, sr.lastIndexOf('/'));
  29  
  30                  if (b != '' && b.indexOf('://') == -1)
  31                      b += sr;
  32                  else
  33                      b = sr;
  34              }
  35          }
  36  
  37          db = document.location.href;
  38  
  39          if (db.indexOf('?') != -1)
  40              db = db.substring(0, db.indexOf('?'));
  41  
  42          db = db.substring(0, db.lastIndexOf('/'));
  43  
  44          if (b.indexOf('://') == -1 && b.charAt(0) != '/')
  45              b = db + "/" + b;
  46  
  47          this.baseURL = b + '/';
  48          this.load(this.settings.page_name);
  49      },
  50  
  51      load : function(v) {
  52          var s = this.settings, h, d = document, sp2;
  53  
  54          v += '?js=true&plugins=' + escape(s.plugins);
  55          v += '&themes=' + escape(s.themes);
  56          v += '&languages=' + escape(s.languages);
  57          v += '&diskcache=' + (s.disk_cache ? 'true' : 'false');
  58          v += this.checkCompress() ? '' : '&compress=false';
  59  
  60          this.loadFile(this.baseURL + v);
  61      },
  62  
  63      checkCompress : function() {
  64          var sp2, ver, na = navigator, ua = navigator.userAgent;
  65  
  66          // Non IE browsers are fine

  67          if (!this.isIE)
  68              return 1;
  69  
  70          sp2 = na.appMinorVersion.indexOf('SP2') != -1;
  71          ver = parseFloat(ua.match(/MSIE\s+([0-9\.]+)/)[1]);
  72  
  73          // IE 6.0+ with SP2 seems fine

  74          if (ver >= 6 && sp2)
  75              return 1;
  76  
  77          // IE 7.0+ seems fine

  78          if (ver >= 7)
  79              return 1;
  80  
  81          // All others might fail

  82          return 0;
  83      },
  84  
  85      loadFile : function(u) {
  86          if (this.settings['debug'])
  87              alert('JS: ' + u);
  88  
  89          document.write('<script type="text/javascript" src="' + u + '"></script>');
  90      },
  91  
  92      start : function() {
  93          var s = this.settings, p = TinyMCE_Engine.prototype;
  94  
  95          p.__loadScript = p.loadScript;
  96          p.__importThemeLanguagePack = p.importThemeLanguagePack;
  97          p.__importPluginLanguagePack = p.importPluginLanguagePack;
  98          p.__loadNextScript = p.loadNextScript;
  99          p.loadScript = p.importThemeLanguagePack = p.importPluginLanguagePack = p.loadNextScript = function() {};
 100          tinyMCE.baseURL = this.baseURL.substring(0, this.baseURL.length - 1);
 101          tinyMCE.settings = {};
 102          tinyMCE.srcMode = '';
 103      },
 104  
 105      end : function() {
 106          var s = this.settings, l = tinyMCE.loadedFiles, la, i, p = TinyMCE_Engine.prototype;
 107  
 108          this.addFiles(s.plugins, 'plugins', 'editor_plugin.js');
 109          this.addFiles(s.themes, 'themes', 'editor_template.js');
 110  
 111          la = s.languages.replace(/\s+/, '').split(',')
 112          for (i=0; i<la.length; i++)
 113              l[l.length] = this.baseURL + 'langs/' + la[i] + '.js';
 114  
 115          p.loadScript = p.__loadScript;
 116          p.importThemeLanguagePack = p.__importThemeLanguagePack;
 117          p.importPluginLanguagePack = p.__importPluginLanguagePack;
 118          p.loadNextScript = p.__loadNextScript;
 119      },
 120  
 121      addFiles : function(f, c, e) {
 122          var i, a, s = this.settings, l = tinyMCE.loadedFiles, la, x;
 123  
 124          a = f.replace(/\s+/, '').split(',');
 125          for (i=0; i<a.length; i++) {
 126              if (a[i]) {
 127                  l[l.length] = this.baseURL + c + '/' +  a[i] + '/' + e;
 128  
 129                  la = s.languages.replace(/\s+/, '').split(',')
 130                  for (x=0; x<la.length; x++)
 131                      l[l.length] = this.baseURL + c + '/' +  a[i] + '/langs/' + la[x] + '.js';
 132              }
 133          }
 134      }
 135  };


Généré le : Wed Nov 21 14:43:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics