[ 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/plugins/inlinepopups/ -> editor_plugin_src.js (source)

   1  /**

   2   * $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $

   3   *

   4   * Moxiecode DHTML Windows script.

   5   *

   6   * @author Moxiecode

   7   * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.

   8   */
   9  
  10  // Patch openWindow, closeWindow TinyMCE functions

  11  
  12  var TinyMCE_InlinePopupsPlugin = {
  13      getInfo : function() {
  14          return {
  15              longname : 'Inline Popups',
  16              author : 'Moxiecode Systems AB',
  17              authorurl : 'http://tinymce.moxiecode.com',
  18              infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_inlinepopups.html',
  19              version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
  20          };
  21      }
  22  };
  23  
  24  tinyMCE.addPlugin("inlinepopups", TinyMCE_InlinePopupsPlugin);
  25  
  26  // Patch openWindow, closeWindow TinyMCE functions

  27  
  28  TinyMCE_Engine.prototype.orgOpenWindow = TinyMCE_Engine.prototype.openWindow;
  29  
  30  TinyMCE_Engine.prototype.openWindow = function(template, args) {
  31      // Does the caller support inline

  32      if (args['inline'] != "yes" || tinyMCE.isOpera || tinyMCE.getParam("plugins").indexOf('inlinepopups') == -1) {
  33          mcWindows.selectedWindow = null;
  34          args['mce_inside_iframe'] = false;
  35          this.orgOpenWindow(template, args);
  36          return;
  37      }
  38  
  39      var url, resizable, scrollbars;
  40  
  41      args['mce_inside_iframe'] = true;
  42      tinyMCE.windowArgs = args;
  43  
  44      if (template['file'].charAt(0) != '/' && template['file'].indexOf('://') == -1)
  45          url = tinyMCE.baseURL + "/themes/" + tinyMCE.getParam("theme") + "/" + template['file'];
  46      else
  47          url = template['file'];
  48  
  49      if (!(width = parseInt(template['width'])))
  50          width = 320;
  51  
  52      if (!(height = parseInt(template['height'])))
  53          height = 200;
  54  
  55      resizable = (args && args['resizable']) ? args['resizable'] : "no";
  56      scrollbars = (args && args['scrollbars']) ? args['scrollbars'] : "no";
  57  
  58      height += 18;
  59  
  60      // Replace all args as variables in URL

  61      for (var name in args) {
  62          if (typeof(args[name]) == 'function')
  63              continue;
  64  
  65          url = tinyMCE.replaceVar(url, name, escape(args[name]));
  66      }
  67  
  68      var elm = document.getElementById(this.selectedInstance.editorId + '_parent');
  69      var pos = tinyMCE.getAbsPosition(elm);
  70  
  71      // Center div in editor area

  72      pos.absLeft += Math.round((elm.firstChild.clientWidth / 2) - (width / 2));
  73      pos.absTop += Math.round((elm.firstChild.clientHeight / 2) - (height / 2));
  74  
  75      mcWindows.open(url, mcWindows.idCounter++, "modal=yes,width=" + width+ ",height=" + height + ",resizable=" + resizable + ",scrollbars=" + scrollbars + ",statusbar=" + resizable + ",left=" + pos.absLeft + ",top=" + pos.absTop);
  76  };
  77  
  78  TinyMCE_Engine.prototype.orgCloseWindow = TinyMCE_Engine.prototype.closeWindow;
  79  
  80  TinyMCE_Engine.prototype.closeWindow = function(win) {
  81      if (mcWindows.selectedWindow != null)
  82          mcWindows.selectedWindow.close();
  83      else
  84          this.orgCloseWindow(win);
  85  };
  86  
  87  TinyMCE_Engine.prototype.setWindowTitle = function(win_ref, title) {
  88      for (var n in mcWindows.windows) {
  89          var win = mcWindows.windows[n];
  90          if (typeof(win) == 'function')
  91              continue;
  92  
  93          if (win_ref.name == win.id + "_iframe")
  94              window.frames[win.id + "_iframe"].document.getElementById(win.id + '_title').innerHTML = title;
  95      }
  96  };
  97  
  98  // * * * * * TinyMCE_Windows classes below

  99  
 100  // Windows handler

 101  function TinyMCE_Windows() {
 102      this.settings = new Array();
 103      this.windows = new Array();
 104      this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
 105      this.isGecko = navigator.userAgent.indexOf('Gecko') != -1;
 106      this.isSafari = navigator.userAgent.indexOf('Safari') != -1;
 107      this.isMac = navigator.userAgent.indexOf('Mac') != -1;
 108      this.isMSIE5_0 = this.isMSIE && (navigator.userAgent.indexOf('MSIE 5.0') != -1);
 109      this.action = "none";
 110      this.selectedWindow = null;
 111      this.lastSelectedWindow = null;
 112      this.zindex = 100;
 113      this.mouseDownScreenX = 0;
 114      this.mouseDownScreenY = 0;
 115      this.mouseDownLayerX = 0;
 116      this.mouseDownLayerY = 0;
 117      this.mouseDownWidth = 0;
 118      this.mouseDownHeight = 0;
 119      this.idCounter = 0;
 120  };
 121  
 122  TinyMCE_Windows.prototype.init = function(settings) {
 123      this.settings = settings;
 124  
 125      if (this.isMSIE)
 126          this.addEvent(document, "mousemove", mcWindows.eventDispatcher);
 127      else
 128          this.addEvent(window, "mousemove", mcWindows.eventDispatcher);
 129  
 130      this.addEvent(document, "mouseup", mcWindows.eventDispatcher);
 131  
 132      this.doc = document;
 133  };
 134  
 135  TinyMCE_Windows.prototype.getParam = function(name, default_value) {
 136      var value = null;
 137  
 138      value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
 139  
 140      // Fix bool values

 141      if (value == "true" || value == "false")
 142          return (value == "true");
 143  
 144      return value;
 145  };
 146  
 147  TinyMCE_Windows.prototype.eventDispatcher = function(e) {
 148      e = typeof(e) == "undefined" ? window.event : e;
 149  
 150      if (mcWindows.selectedWindow == null)
 151          return;
 152  
 153      // Switch focus

 154      if (mcWindows.isGecko && e.type == "mousedown") {
 155          var elm = e.currentTarget;
 156  
 157          for (var n in mcWindows.windows) {
 158              var win = mcWindows.windows[n];
 159  
 160              if (win.headElement == elm || win.resizeElement == elm) {
 161                  win.focus();
 162                  break;
 163              }
 164          }
 165      }
 166  
 167      switch (e.type) {
 168          case "mousemove":
 169              mcWindows.selectedWindow.onMouseMove(e);
 170              break;
 171  
 172          case "mouseup":
 173              mcWindows.selectedWindow.onMouseUp(e);
 174              break;
 175  
 176          case "mousedown":
 177              mcWindows.selectedWindow.onMouseDown(e);
 178              break;
 179  
 180          case "focus":
 181              mcWindows.selectedWindow.onFocus(e);
 182              break;
 183      }
 184  };
 185  
 186  TinyMCE_Windows.prototype.addEvent = function(obj, name, handler) {
 187      if (this.isMSIE)
 188          obj.attachEvent("on" + name, handler);
 189      else
 190          obj.addEventListener(name, handler, true);
 191  };
 192  
 193  TinyMCE_Windows.prototype.cancelEvent = function(e) {
 194      if (this.isMSIE) {
 195          e.returnValue = false;
 196          e.cancelBubble = true;
 197      } else
 198          e.preventDefault();
 199  };
 200  
 201  TinyMCE_Windows.prototype.parseFeatures = function(opts) {
 202      // Cleanup the options

 203      opts = opts.toLowerCase();
 204      opts = opts.replace(/;/g, ",");
 205      opts = opts.replace(/[^0-9a-z=,]/g, "");
 206  
 207      var optionChunks = opts.split(',');
 208      var options = new Array();
 209  
 210      options['left'] = "10";
 211      options['top'] = "10";
 212      options['width'] = "300";
 213      options['height'] = "300";
 214      options['resizable'] = "yes";
 215      options['minimizable'] = "yes";
 216      options['maximizable'] = "yes";
 217      options['close'] = "yes";
 218      options['movable'] = "yes";
 219      options['statusbar'] = "yes";
 220      options['scrollbars'] = "auto";
 221      options['modal'] = "no";
 222  
 223      if (opts == "")
 224          return options;
 225  
 226      for (var i=0; i<optionChunks.length; i++) {
 227          var parts = optionChunks[i].split('=');
 228  
 229          if (parts.length == 2)
 230              options[parts[0]] = parts[1];
 231      }
 232  
 233      options['left'] = parseInt(options['left']);
 234      options['top'] = parseInt(options['top']);
 235      options['width'] = parseInt(options['width']);
 236      options['height'] = parseInt(options['height']);
 237  
 238      return options;
 239  };
 240  
 241  TinyMCE_Windows.prototype.open = function(url, name, features) {
 242      this.lastSelectedWindow = this.selectedWindow;
 243  
 244      var win = new TinyMCE_Window();
 245      var winDiv, html = "", id;
 246      var imgPath = this.getParam("images_path");
 247  
 248      features = this.parseFeatures(features);
 249  
 250      // Create div

 251      id = "mcWindow_" + name;
 252      win.deltaHeight = 18;
 253  
 254      if (features['statusbar'] == "yes") {
 255          win.deltaHeight += 13;
 256  
 257          if (this.isMSIE)
 258              win.deltaHeight += 1;
 259      }
 260  
 261      width = parseInt(features['width']);
 262      height = parseInt(features['height'])-win.deltaHeight;
 263  
 264      if (this.isMSIE)
 265          width -= 2;
 266  
 267      // Setup first part of window

 268      win.id = id;
 269      win.url = url;
 270      win.name = name;
 271      win.features = features;
 272      this.windows[name] = win;
 273  
 274      iframeWidth = width;
 275      iframeHeight = height;
 276  
 277      // Create inner content

 278      html += '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
 279      html += '<html>';
 280      html += '<head>';
 281      html += '<title>Wrapper iframe</title>';
 282      html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
 283      html += '<link href="' + this.getParam("css_file") + '" rel="stylesheet" type="text/css" />';
 284      html += '</head>';
 285      html += '<body onload="parent.mcWindows.onLoad(\'' + name + '\');">';
 286  
 287      html += '<div id="' + id + '_container" class="mceWindow">';
 288      html += '<div id="' + id + '_head" class="mceWindowHead" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
 289      html += '  <div id="' + id + '_title" class="mceWindowTitle"';
 290      html += '  onselectstart="return false;" unselectable="on" style="-moz-user-select: none !important;"></div>';
 291      html += '    <div class="mceWindowHeadTools">';
 292      html += '      <a href="javascript:parent.mcWindows.windows[\'' + name + '\'].close();" target="_self" onmousedown="return false;" class="mceWindowClose"><img border="0" src="' + imgPath + '/window_close.gif" /></a>';
 293  //    html += '      <a href="javascript:mcWindows.windows[\'' + name + '\'].maximize();" target="_self" onmousedown="return false;" class="mceWindowMaximize"></a>';

 294  //    html += '      <a href="javascript:mcWindows.windows[\'' + name + '\'].minimize();" target="_self" onmousedown="return false;" class="mceWindowMinimize"></a>';

 295      html += '    </div>';
 296      html += '</div><div id="' + id + '_body" class="mceWindowBody" style="width: ' + width + 'px; height: ' + height + 'px;">';
 297      html += '<iframe id="' + id + '_iframe" name="' + id + '_iframe" frameborder="0" width="' + iframeWidth + '" height="' + iframeHeight + '" src="' + url + '" class="mceWindowBodyIframe" scrolling="' + features['scrollbars'] + '"></iframe></div>';
 298  
 299      if (features['statusbar'] == "yes") {
 300          html += '<div id="' + id + '_statusbar" class="mceWindowStatusbar" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
 301  
 302          if (features['resizable'] == "yes") {
 303              if (this.isGecko)
 304                  html += '<div id="' + id + '_resize" class="mceWindowResize"><div style="background-image: url(\'' + imgPath + '/window_resize.gif\'); width: 12px; height: 12px;"></div></div>';
 305              else
 306                  html += '<div id="' + id + '_resize" class="mceWindowResize"><img onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();" border="0" src="' + imgPath + '/window_resize.gif" /></div>';
 307          }
 308  
 309          html += '</div>';
 310      }
 311  
 312      html += '</div>';
 313  
 314      html += '</body>';
 315      html += '</html>';
 316  
 317      // Create iframe

 318      this.createFloatingIFrame(id, features['left'], features['top'], features['width'], features['height'], html);
 319  };
 320  
 321  // Blocks the document events by placing a image over the whole document

 322  TinyMCE_Windows.prototype.setDocumentLock = function(state) {
 323      if (state) {
 324          var elm = document.getElementById('mcWindowEventBlocker');
 325          if (elm == null) {
 326              elm = document.createElement("div");
 327  
 328              elm.id = "mcWindowEventBlocker";
 329              elm.style.position = "absolute";
 330              elm.style.left = "0";
 331              elm.style.top = "0";
 332  
 333              document.body.appendChild(elm);
 334          }
 335  
 336          elm.style.display = "none";
 337  
 338          var imgPath = this.getParam("images_path");
 339          var width = document.body.clientWidth;
 340          var height = document.body.clientHeight;
 341  
 342          elm.style.width = width;
 343          elm.style.height = height;
 344          elm.innerHTML = '<img src="' + imgPath + '/spacer.gif" width="' + width + '" height="' + height + '" />';
 345  
 346          elm.style.zIndex = mcWindows.zindex-1;
 347          elm.style.display = "block";
 348      } else {
 349          var elm = document.getElementById('mcWindowEventBlocker');
 350  
 351          if (mcWindows.windows.length == 0)
 352              elm.parentNode.removeChild(elm);
 353          else
 354              elm.style.zIndex = mcWindows.zindex-1;
 355      }
 356  };
 357  
 358  // Gets called when wrapper iframe is initialized

 359  TinyMCE_Windows.prototype.onLoad = function(name) {
 360      var win = mcWindows.windows[name];
 361      var id = "mcWindow_" + name;
 362      var wrapperIframe = window.frames[id + "_iframe"].frames[0];
 363      var wrapperDoc = window.frames[id + "_iframe"].document;
 364      var doc = window.frames[id + "_iframe"].document;
 365      var winDiv = document.getElementById("mcWindow_" + name + "_div");
 366      var realIframe = window.frames[id + "_iframe"].frames[0];
 367  
 368      // Set window data

 369      win.id = "mcWindow_" + name;
 370      win.winElement = winDiv;
 371      win.bodyElement = doc.getElementById(id + '_body');
 372      win.iframeElement = doc.getElementById(id + '_iframe');
 373      win.headElement = doc.getElementById(id + '_head');
 374      win.titleElement = doc.getElementById(id + '_title');
 375      win.resizeElement = doc.getElementById(id + '_resize');
 376      win.containerElement = doc.getElementById(id + '_container');
 377      win.left = win.features['left'];
 378      win.top = win.features['top'];
 379      win.frame = window.frames[id + '_iframe'].frames[0];
 380      win.wrapperFrame = window.frames[id + '_iframe'];
 381      win.wrapperIFrameElement = document.getElementById(id + "_iframe");
 382  
 383      // Add event handlers

 384      mcWindows.addEvent(win.headElement, "mousedown", mcWindows.eventDispatcher);
 385  
 386      if (win.resizeElement != null)
 387          mcWindows.addEvent(win.resizeElement, "mousedown", mcWindows.eventDispatcher);
 388  
 389      if (mcWindows.isMSIE) {
 390          mcWindows.addEvent(realIframe.document, "mousemove", mcWindows.eventDispatcher);
 391          mcWindows.addEvent(realIframe.document, "mouseup", mcWindows.eventDispatcher);
 392      } else {
 393          mcWindows.addEvent(realIframe, "mousemove", mcWindows.eventDispatcher);
 394          mcWindows.addEvent(realIframe, "mouseup", mcWindows.eventDispatcher);
 395          mcWindows.addEvent(realIframe, "focus", mcWindows.eventDispatcher);
 396      }
 397  
 398      for (var i=0; i<window.frames.length; i++) {
 399          if (!window.frames[i]._hasMouseHandlers) {
 400              if (mcWindows.isMSIE) {
 401                  mcWindows.addEvent(window.frames[i].document, "mousemove", mcWindows.eventDispatcher);
 402                  mcWindows.addEvent(window.frames[i].document, "mouseup", mcWindows.eventDispatcher);
 403              } else {
 404                  mcWindows.addEvent(window.frames[i], "mousemove", mcWindows.eventDispatcher);
 405                  mcWindows.addEvent(window.frames[i], "mouseup", mcWindows.eventDispatcher);
 406              }
 407  
 408              window.frames[i]._hasMouseHandlers = true;
 409          }
 410      }
 411  
 412      if (mcWindows.isMSIE) {
 413          mcWindows.addEvent(win.frame.document, "mousemove", mcWindows.eventDispatcher);
 414          mcWindows.addEvent(win.frame.document, "mouseup", mcWindows.eventDispatcher);
 415      } else {
 416          mcWindows.addEvent(win.frame, "mousemove", mcWindows.eventDispatcher);
 417          mcWindows.addEvent(win.frame, "mouseup", mcWindows.eventDispatcher);
 418          mcWindows.addEvent(win.frame, "focus", mcWindows.eventDispatcher);
 419      }
 420  
 421      // Dispatch open window event

 422      var func = this.getParam("on_open_window", "");
 423      if (func != "")
 424          eval(func + "(win);");
 425  
 426      win.focus();
 427  
 428      if (win.features['modal'] == "yes")
 429          mcWindows.setDocumentLock(true);
 430  };
 431  
 432  TinyMCE_Windows.prototype.createFloatingIFrame = function(id_prefix, left, top, width, height, html) {
 433      var iframe = document.createElement("iframe");
 434      var div = document.createElement("div"), doc;
 435  
 436      width = parseInt(width);
 437      height = parseInt(height)+1;
 438  
 439      // Create wrapper div

 440      div.setAttribute("id", id_prefix + "_div");
 441      div.setAttribute("width", width);
 442      div.setAttribute("height", (height));
 443      div.style.position = "absolute";
 444      div.style.left = left + "px";
 445      div.style.top = top + "px";
 446      div.style.width = width + "px";
 447      div.style.height = (height) + "px";
 448      div.style.backgroundColor = "white";
 449      div.style.display = "none";
 450  
 451      if (this.isGecko) {
 452          iframeWidth = width + 2;
 453          iframeHeight = height + 2;
 454      } else {
 455          iframeWidth = width;
 456          iframeHeight = height + 1;
 457      }
 458  
 459      // Create iframe

 460      iframe.setAttribute("id", id_prefix + "_iframe");
 461      iframe.setAttribute("name", id_prefix + "_iframe");
 462      iframe.setAttribute("border", "0");
 463      iframe.setAttribute("frameBorder", "0");
 464      iframe.setAttribute("marginWidth", "0");
 465      iframe.setAttribute("marginHeight", "0");
 466      iframe.setAttribute("leftMargin", "0");
 467      iframe.setAttribute("topMargin", "0");
 468      iframe.setAttribute("width", iframeWidth);
 469      iframe.setAttribute("height", iframeHeight);
 470  //    iframe.setAttribute("src", "../jscripts/tiny_mce/blank.htm");

 471      // iframe.setAttribute("allowtransparency", "false");

 472      iframe.setAttribute("scrolling", "no");
 473      iframe.style.width = iframeWidth + "px";
 474      iframe.style.height = iframeHeight + "px";
 475      iframe.style.backgroundColor = "white";
 476      div.appendChild(iframe);
 477  
 478      document.body.appendChild(div);
 479  
 480      // Fixed MSIE 5.0 issue

 481      div.innerHTML = div.innerHTML;
 482  
 483      if (this.isSafari) {
 484          // Give Safari some time to setup

 485          window.setTimeout(function() {
 486              var doc = window.frames[id_prefix + '_iframe'].document;
 487              doc.open();
 488              doc.write(html);
 489              doc.close();
 490          }, 10);
 491      } else {
 492          doc = window.frames[id_prefix + '_iframe'].window.document;
 493          doc.open();
 494          doc.write(html);
 495          doc.close();
 496      }
 497  
 498      div.style.display = "block";
 499  
 500      return div;
 501  };
 502  
 503  // Window instance

 504  function TinyMCE_Window() {
 505  };
 506  
 507  TinyMCE_Window.prototype.focus = function() {
 508      if (this != mcWindows.selectedWindow) {
 509          this.winElement.style.zIndex = ++mcWindows.zindex;
 510          mcWindows.lastSelectedWindow = mcWindows.selectedWindow;
 511          mcWindows.selectedWindow = this;
 512      }
 513  };
 514  
 515  TinyMCE_Window.prototype.minimize = function() {
 516  };
 517  
 518  TinyMCE_Window.prototype.maximize = function() {
 519      
 520  };
 521  
 522  TinyMCE_Window.prototype.startResize = function() {
 523      mcWindows.action = "resize";
 524  };
 525  
 526  TinyMCE_Window.prototype.startMove = function(e) {
 527      mcWindows.action = "move";
 528  };
 529  
 530  TinyMCE_Window.prototype.close = function() {
 531      if (this.frame && this.frame['tinyMCEPopup'])
 532          this.frame['tinyMCEPopup'].restoreSelection();
 533  
 534      if (mcWindows.lastSelectedWindow != null)
 535          mcWindows.lastSelectedWindow.focus();
 536  
 537      var mcWindowsNew = new Array();
 538      for (var n in mcWindows.windows) {
 539          var win = mcWindows.windows[n];
 540          if (typeof(win) == 'function')
 541              continue;
 542  
 543          if (win.name != this.name)
 544              mcWindowsNew[n] = win;
 545      }
 546  
 547      mcWindows.windows = mcWindowsNew;
 548  
 549  //    alert(mcWindows.doc.getElementById(this.id + "_iframe"));

 550  
 551      var e = mcWindows.doc.getElementById(this.id + "_iframe");
 552      e.parentNode.removeChild(e);
 553  
 554      var e = mcWindows.doc.getElementById(this.id + "_div");
 555      e.parentNode.removeChild(e);
 556  
 557      mcWindows.setDocumentLock(false);
 558  };
 559  
 560  TinyMCE_Window.prototype.onMouseMove = function(e) {
 561      var scrollX = 0;//this.doc.body.scrollLeft;

 562      var scrollY = 0;//this.doc.body.scrollTop;

 563  
 564      // Calculate real X, Y

 565      var dx = e.screenX - mcWindows.mouseDownScreenX;
 566      var dy = e.screenY - mcWindows.mouseDownScreenY;
 567  
 568      switch (mcWindows.action) {
 569          case "resize":
 570              width = mcWindows.mouseDownWidth + (e.screenX - mcWindows.mouseDownScreenX);
 571              height = mcWindows.mouseDownHeight + (e.screenY - mcWindows.mouseDownScreenY);
 572  
 573              width = width < 100 ? 100 : width;
 574              height = height < 100 ? 100 : height;
 575  
 576              this.wrapperIFrameElement.style.width = width+2;
 577              this.wrapperIFrameElement.style.height = height+2;
 578              this.wrapperIFrameElement.width = width+2;
 579              this.wrapperIFrameElement.height = height+2;
 580              this.winElement.style.width = width;
 581              this.winElement.style.height = height;
 582  
 583              height = height - this.deltaHeight;
 584  
 585              this.containerElement.style.width = width;
 586  
 587              this.iframeElement.style.width = width;
 588              this.iframeElement.style.height = height;
 589              this.bodyElement.style.width = width;
 590              this.bodyElement.style.height = height;
 591              this.headElement.style.width = width;
 592              //this.statusElement.style.width = width;

 593  
 594              mcWindows.cancelEvent(e);
 595              break;
 596  
 597          case "move":
 598              this.left = mcWindows.mouseDownLayerX + (e.screenX - mcWindows.mouseDownScreenX);
 599              this.top = mcWindows.mouseDownLayerY + (e.screenY - mcWindows.mouseDownScreenY);
 600              this.winElement.style.left = this.left + "px";
 601              this.winElement.style.top = this.top + "px";
 602  
 603              mcWindows.cancelEvent(e);
 604              break;
 605      }
 606  };
 607  
 608  function debug(msg) {
 609      document.getElementById('debug').value += msg + "\n";
 610  }
 611  
 612  TinyMCE_Window.prototype.onMouseUp = function(e) {
 613      mcWindows.action = "none";
 614  };
 615  
 616  TinyMCE_Window.prototype.onFocus = function(e) {
 617      // Gecko only handler

 618      var winRef = e.currentTarget;
 619  
 620      for (var n in mcWindows.windows) {
 621          var win = mcWindows.windows[n];
 622          if (typeof(win) == 'function')
 623              continue;
 624  
 625          if (winRef.name == win.id + "_iframe") {
 626              win.focus();
 627              return;
 628          }
 629      }
 630  };
 631  
 632  TinyMCE_Window.prototype.onMouseDown = function(e) {
 633      var elm = mcWindows.isMSIE ? this.wrapperFrame.event.srcElement : e.target;
 634  
 635      var scrollX = 0;//this.doc.body.scrollLeft;

 636      var scrollY = 0;//this.doc.body.scrollTop;

 637  
 638      mcWindows.mouseDownScreenX = e.screenX;
 639      mcWindows.mouseDownScreenY = e.screenY;
 640      mcWindows.mouseDownLayerX = this.left;
 641      mcWindows.mouseDownLayerY = this.top;
 642      mcWindows.mouseDownWidth = parseInt(this.winElement.style.width);
 643      mcWindows.mouseDownHeight = parseInt(this.winElement.style.height);
 644  
 645      if (this.resizeElement != null && elm == this.resizeElement.firstChild)
 646          this.startResize(e);
 647      else
 648          this.startMove(e);
 649  
 650      mcWindows.cancelEvent(e);
 651  };
 652  
 653  // Global instance

 654  var mcWindows = new TinyMCE_Windows();
 655  
 656  // Initialize windows

 657  mcWindows.init({
 658      images_path : tinyMCE.baseURL + "/plugins/inlinepopups/images",
 659      css_file : tinyMCE.baseURL + "/plugins/inlinepopups/css/inlinepopup.css"
 660  });


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