Index: openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/plugins/inlinepopups/jscripts/mcwindows.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/plugins/inlinepopups/jscripts/Attic/mcwindows.js,v diff -u -N --- openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/plugins/inlinepopups/jscripts/mcwindows.js 25 Jan 2008 21:44:04 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,453 +0,0 @@ -/** - * $Id: mcwindows.js,v 1.1 2008/01/25 21:44:04 daveb Exp $ - * - * Moxiecode DHTML Windows script. - * - * @author Moxiecode - * @copyright Copyright � 2004, Moxiecode Systems AB, All rights reserved. - */ - -// Windows handler -function MCWindows() { - this.settings = new Array(); - this.windows = new Array(); - this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); - this.isGecko = navigator.userAgent.indexOf('Gecko') != -1; - this.isSafari = navigator.userAgent.indexOf('Safari') != -1; - this.isMac = navigator.userAgent.indexOf('Mac') != -1; - this.isMSIE5_0 = this.isMSIE && (navigator.userAgent.indexOf('MSIE 5.0') != -1); - this.action = "none"; - this.selectedWindow = null; - this.zindex = 100; - this.mouseDownScreenX = 0; - this.mouseDownScreenY = 0; - this.mouseDownLayerX = 0; - this.mouseDownLayerY = 0; - this.mouseDownWidth = 0; - this.mouseDownHeight = 0; -}; - -MCWindows.prototype.init = function(settings) { - this.settings = settings; - - if (this.isMSIE) - this.addEvent(document, "mousemove", mcWindows.eventDispatcher); - else - this.addEvent(window, "mousemove", mcWindows.eventDispatcher); - - this.addEvent(document, "mouseup", mcWindows.eventDispatcher); -}; - -MCWindows.prototype.getParam = function(name, default_value) { - var value = null; - - value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name]; - - // Fix bool values - if (value == "true" || value == "false") - return (value == "true"); - - return value; -}; - -MCWindows.prototype.eventDispatcher = function(e) { - e = typeof(e) == "undefined" ? window.event : e; - - if (mcWindows.selectedWindow == null) - return; - - // Switch focus - if (mcWindows.isGecko && e.type == "mousedown") { - var elm = e.currentTarget; - - for (var n in mcWindows.windows) { - var win = mcWindows.windows[n]; - if (typeof(win) == 'function') - continue; - - if (win.headElement == elm || win.resizeElement == elm) { - win.focus(); - break; - } - } - } - - switch (e.type) { - case "mousemove": - mcWindows.selectedWindow.onMouseMove(e); - break; - - case "mouseup": - mcWindows.selectedWindow.onMouseUp(e); - break; - - case "mousedown": - mcWindows.selectedWindow.onMouseDown(e); - break; - - case "focus": - mcWindows.selectedWindow.onFocus(e); - break; - } -} - -MCWindows.prototype.addEvent = function(obj, name, handler) { - if (this.isMSIE) - obj.attachEvent("on" + name, handler); - else - obj.addEventListener(name, handler, true); -}; - -MCWindows.prototype.cancelEvent = function(e) { - if (this.isMSIE) { - e.returnValue = false; - e.cancelBubble = true; - } else - e.preventDefault(); -}; - -MCWindows.prototype.parseFeatures = function(opts) { - // Cleanup the options - opts = opts.toLowerCase(); - opts = opts.replace(/;/g, ","); - opts = opts.replace(/[^0-9a-z=,]/g, ""); - - var optionChunks = opts.split(','); - var options = new Array(); - - options['left'] = 10; - options['top'] = 10; - options['width'] = 300; - options['height'] = 300; - options['resizable'] = true; - options['minimizable'] = true; - options['maximizable'] = true; - options['close'] = true; - options['movable'] = true; - - if (opts == "") - return options; - - for (var i=0; i'; - - html += '
'; - html += '
'; - html += '
'; -// html += ' '; -// html += ' '; - html += '
'; - html += '
'; - html += '
'; - html += '
'; - html += '
'; - html += '
'; - html += '
'; - - html += ''; - html += ''; - - // Create iframe - this.createFloatingIFrame(id, features['left'], features['top'], features['width'], features['height'], html); -}; - -// Gets called when wrapper iframe is initialized -MCWindows.prototype.onLoad = function(name) { - var win = mcWindows.windows[name]; - var id = "mcWindow_" + name; - var wrapperIframe = window.frames[id + "_iframe"].frames[0]; - var wrapperDoc = window.frames[id + "_iframe"].document; - var doc = window.frames[id + "_iframe"].document; - var winDiv = document.getElementById("mcWindow_" + name + "_div"); - var realIframe = window.frames[id + "_iframe"].frames[0]; - - // Set window data - win.id = "mcWindow_" + name + "_iframe"; - win.winElement = winDiv; - win.bodyElement = doc.getElementById(id + '_body'); - win.iframeElement = doc.getElementById(id + '_iframe'); - win.headElement = doc.getElementById(id + '_head'); - win.titleElement = doc.getElementById(id + '_title'); - win.resizeElement = doc.getElementById(id + '_resize'); - win.containerElement = doc.getElementById(id + '_container'); - win.left = win.features['left']; - win.top = win.features['top']; - win.frame = window.frames[id + '_iframe'].frames[0]; - win.wrapperFrame = window.frames[id + '_iframe']; - win.wrapperIFrameElement = document.getElementById(id + "_iframe"); - - // Add event handlers - mcWindows.addEvent(win.headElement, "mousedown", mcWindows.eventDispatcher); - mcWindows.addEvent(win.resizeElement, "mousedown", mcWindows.eventDispatcher); - - if (mcWindows.isMSIE) { - mcWindows.addEvent(realIframe.document, "mousemove", mcWindows.eventDispatcher); - mcWindows.addEvent(realIframe.document, "mouseup", mcWindows.eventDispatcher); - } else { - mcWindows.addEvent(realIframe, "mousemove", mcWindows.eventDispatcher); - mcWindows.addEvent(realIframe, "mouseup", mcWindows.eventDispatcher); - mcWindows.addEvent(realIframe, "focus", mcWindows.eventDispatcher); - } - - for (var i=0; i