diff --git a/examples/codec.html b/examples/codec.html index 60f0f2035..a3a00f03e 100644 --- a/examples/codec.html +++ b/examples/codec.html @@ -84,13 +84,7 @@ var left = 0; var bw = 16; var bh = 16; - - if (mxClient.IS_QUIRKS) - { - bw -= 1; - bh -= 1; - } - + function addButton(label, funct) { var btn = document.createElement('div'); diff --git a/examples/dynamictoolbar.html b/examples/dynamictoolbar.html index 115dc4759..cd7531d1e 100644 --- a/examples/dynamictoolbar.html +++ b/examples/dynamictoolbar.html @@ -63,15 +63,7 @@ container.style.background = 'url("editors/images/grid.gif")'; document.body.appendChild(container); - - // Workaround for Internet Explorer ignoring certain styles - if (mxClient.IS_QUIRKS) - { - document.body.style.overflow = 'hidden'; - new mxDivResizer(tbContainer); - new mxDivResizer(container); - } - + // Creates the model and the graph inside the container // using the fastest rendering available on the browser var model = new mxGraphModel(); diff --git a/examples/events.html b/examples/events.html index 19fb4762d..b2646087d 100644 --- a/examples/events.html +++ b/examples/events.html @@ -51,13 +51,6 @@ // Disables built-in context menu mxEvent.disableContextMenu(container); - // Workaround for Internet Explorer ignoring certain styles - if (mxClient.IS_QUIRKS) - { - document.body.style.overflow = 'hidden'; - new mxDivResizer(container); - } - document.body.appendChild(container); // Creates the graph inside the DOM node. diff --git a/examples/fileio.html b/examples/fileio.html index 0c71a3970..17b0ecc1c 100644 --- a/examples/fileio.html +++ b/examples/fileio.html @@ -118,12 +118,6 @@ mxUtils.alert('Show properties for cell '+(cell.customId || cell.getId())); } }; - - if (mxClient.IS_QUIRKS) - { - document.body.style.overflow = 'hidden'; - new mxDivResizer(container); - } } }; diff --git a/examples/grapheditor/www/js/Dialogs.js b/examples/grapheditor/www/js/Dialogs.js index 9531a7f95..094a81153 100644 --- a/examples/grapheditor/www/js/Dialogs.js +++ b/examples/grapheditor/www/js/Dialogs.js @@ -1728,7 +1728,7 @@ var LinkDialog = function(editorUi, initialValue, btnLabel, fn) { linkInput.focus(); - if (mxClient.IS_GC || mxClient.IS_FF || document.documentMode >= 5 || mxClient.IS_QUIRKS) + if (mxClient.IS_GC || mxClient.IS_FF) { linkInput.select(); } @@ -2010,20 +2010,10 @@ var LayersWindow = function(editorUi, x, y, w, h) ldiv.style.borderStyle = 'solid'; ldiv.style.display = 'block'; ldiv.style.whiteSpace = 'nowrap'; - - if (mxClient.IS_QUIRKS) - { - ldiv.style.filter = 'none'; - } - + var link = document.createElement('a'); link.className = 'geButton'; - - if (mxClient.IS_QUIRKS) - { - link.style.filter = 'none'; - } - + var removeLink = link.cloneNode(); removeLink.innerHTML = '
'; diff --git a/examples/grapheditor/www/js/Editor.js b/examples/grapheditor/www/js/Editor.js index e486dfdcf..1b821ecb2 100644 --- a/examples/grapheditor/www/js/Editor.js +++ b/examples/grapheditor/www/js/Editor.js @@ -800,13 +800,8 @@ function Dialog(editorUi, elt, w, h, modal, closable, onClose, noScroll, transpa var dh = ds.height; var left = Math.max(1, Math.round((ds.width - w - 64) / 2)); var top = Math.max(1, Math.round((dh - h - editorUi.footerHeight) / 3)); - - // Keeps window size inside available space - if (!mxClient.IS_QUIRKS) - { - elt.style.maxHeight = '100%'; - } - + elt.style.maxHeight = '100%'; + w = (document.body != null) ? Math.min(w, document.body.scrollWidth - 64) : w; h = Math.min(h, dh - 64); @@ -826,11 +821,6 @@ function Dialog(editorUi, elt, w, h, modal, closable, onClose, noScroll, transpa this.bg.style.zIndex = this.zIndex - 2; mxUtils.setOpacity(this.bg, this.bgOpacity); - - if (mxClient.IS_QUIRKS) - { - new mxDivResizer(this.bg); - } } var origin = mxUtils.getDocumentScrollOrigin(document); @@ -2001,7 +1991,7 @@ var FilenameDialog = function(editorUi, filename, buttonText, fn, label, validat nameInput.focus(); - if (mxClient.IS_GC || mxClient.IS_FF || document.documentMode >= 5 || mxClient.IS_QUIRKS) + if (mxClient.IS_GC || mxClient.IS_FF) { nameInput.select(); } @@ -2320,7 +2310,7 @@ FilenameDialog.createFileTypes = function(editorUi, nameInput, types) // Shadow filter causes problems in outline window in quirks mode. IE8 standards // also has known rendering issues inside mxWindow but not using shadow is worse. - this.backgroundPageShape.isShadow = !mxClient.IS_QUIRKS; + this.backgroundPageShape.isShadow = true; this.backgroundPageShape.dialect = mxConstants.DIALECT_STRICTHTML; this.backgroundPageShape.init(graph.container); diff --git a/examples/grapheditor/www/js/EditorUi.js b/examples/grapheditor/www/js/EditorUi.js index ef6c16851..cf360bf25 100644 --- a/examples/grapheditor/www/js/EditorUi.js +++ b/examples/grapheditor/www/js/EditorUi.js @@ -1788,7 +1788,7 @@ EditorUi.prototype.initCanvas = function() var st = graph.container.scrollTop; var sl = graph.container.scrollLeft; - var sb = (mxClient.IS_QUIRKS || document.documentMode >= 8) ? 20 : 14; + var sb = 14; if (document.documentMode == 8 || document.documentMode == 9) { @@ -3615,7 +3615,7 @@ EditorUi.prototype.refresh = function(sizeDidChange) tmp += this.toolbarHeight; } - if (tmp > 0 && !mxClient.IS_QUIRKS) + if (tmp > 0) { tmp += 1; } diff --git a/examples/grapheditor/www/js/Format.js b/examples/grapheditor/www/js/Format.js index 98795a783..fba35bd00 100644 --- a/examples/grapheditor/www/js/Format.js +++ b/examples/grapheditor/www/js/Format.js @@ -385,8 +385,8 @@ Format.prototype.refresh = function() label.style.fontSize = '13px'; label.style.borderWidth = '0px 0px 1px 1px'; label.style.borderStyle = 'solid'; - label.style.display = (mxClient.IS_QUIRKS) ? 'inline' : 'inline-block'; - label.style.height = (mxClient.IS_QUIRKS) ? '34px' : '25px'; + label.style.display = 'inline-block'; + label.style.height = '25px'; label.style.overflow = 'hidden'; label.style.width = '100%'; this.container.appendChild(div); @@ -805,11 +805,7 @@ BaseFormatPanel.prototype.createStepper = function(input, update, step, height, step = (step != null) ? step : 1; height = (height != null) ? height : 8; - if (mxClient.IS_QUIRKS) - { - height = height - 2; - } - else if (mxClient.IS_MT || document.documentMode >= 8) + if (mxClient.IS_MT || document.documentMode >= 8) { height = height + 1; } @@ -887,12 +883,6 @@ BaseFormatPanel.prototype.createStepper = function(input, update, step, height, mxEvent.addGestureListeners(stepper, function(evt) { - // Workaround for lost current selection in page because of focus in IE - if (mxClient.IS_QUIRKS || document.documentMode == 8) - { - currentSelection = document.selection.createRange(); - } - mxEvent.consume(evt); }, null, @@ -930,7 +920,7 @@ BaseFormatPanel.prototype.createOption = function(label, isCheckedFn, setChecked div.style.whiteSpace = 'nowrap'; div.style.overflow = 'hidden'; div.style.width = '200px'; - div.style.height = (mxClient.IS_QUIRKS) ? '27px' : '18px'; + div.style.height = '18px'; var cb = document.createElement('input'); cb.setAttribute('type', 'checkbox'); @@ -1099,7 +1089,7 @@ BaseFormatPanel.prototype.createColorOption = function(label, getColorFn, setCol div.style.whiteSpace = 'nowrap'; div.style.overflow = 'hidden'; div.style.width = '200px'; - div.style.height = (mxClient.IS_QUIRKS) ? '27px' : '18px'; + div.style.height = '18px'; var cb = document.createElement('input'); cb.setAttribute('type', 'checkbox'); @@ -1124,17 +1114,11 @@ BaseFormatPanel.prototype.createColorOption = function(label, getColorFn, setCol { applying = true; color = (/(^#?[a-zA-Z0-9]*$)/.test(color)) ? color : defaultColor; - btn.innerHTML = '
'; - - // Fine-tuning in Firefox, quirks mode and IE8 standards - if (mxClient.IS_QUIRKS || document.documentMode == 8) - { - btn.firstChild.style.margin = '0px'; - } - + if (color != null && color != mxConstants.NONE) { cb.setAttribute('checked', 'checked'); @@ -1181,7 +1165,7 @@ BaseFormatPanel.prototype.createColorOption = function(label, getColorFn, setCol btn.style.position = 'absolute'; btn.style.marginTop = '-4px'; - btn.style.right = (mxClient.IS_QUIRKS) ? '0px' : '20px'; + btn.style.right = '20px'; btn.style.height = '22px'; btn.className = 'geColorBtn'; btn.style.display = (cb.checked || hideCheckbox) ? '' : 'none'; @@ -1293,7 +1277,7 @@ BaseFormatPanel.prototype.addArrow = function(elt, height) height = (height != null) ? height : 10; var arrow = document.createElement('div'); - arrow.style.display = (mxClient.IS_QUIRKS) ? 'inline' : 'inline-block'; + arrow.style.display = 'inline-block'; arrow.style.padding = '6px'; arrow.style.paddingRight = '4px'; @@ -1325,7 +1309,7 @@ BaseFormatPanel.prototype.addArrow = function(elt, height) symbol.style.paddingRight = '6px'; symbol.style.marginLeft = '4px'; symbol.style.marginTop = '-1px'; - symbol.style.display = (mxClient.IS_QUIRKS) ? 'inline' : 'inline-block'; + symbol.style.display = 'inline-block'; mxUtils.setOpacity(symbol, 60); } @@ -1911,12 +1895,7 @@ ArrangePanel.prototype.addAlign = function(div) stylePanel.style.paddingLeft = '0px'; stylePanel.style.borderWidth = '0px'; stylePanel.className = 'geToolbarContainer'; - - if (mxClient.IS_QUIRKS) - { - div.style.height = '60px'; - } - + var left = this.editorUi.toolbar.addButton('geSprite-alignleft', mxResources.get('left'), function() { graph.alignCells(mxConstants.ALIGN_LEFT); }, stylePanel); var center = this.editorUi.toolbar.addButton('geSprite-aligncenter', mxResources.get('center'), @@ -2778,11 +2757,6 @@ TextFormatPanel.prototype.addFont = function(container) stylePanel.style.marginLeft = '-2px'; stylePanel.style.borderWidth = '0px'; stylePanel.className = 'geToolbarContainer'; - - if (mxClient.IS_QUIRKS) - { - stylePanel.style.display = 'block'; - } if (graph.cellEditor.isContentEditing()) { @@ -2830,12 +2804,7 @@ TextFormatPanel.prototype.addFont = function(container) fontStyleItems[2].setAttribute('title', mxResources.get('underline') + ' (' + this.editorUi.actions.get('underline').shortcut + ')'); var verticalItem = this.editorUi.toolbar.addItems(['vertical'], stylePanel2, true)[0]; - - if (mxClient.IS_QUIRKS) - { - mxUtils.br(container); - } - + container.appendChild(stylePanel2); this.styleButtons(fontStyleItems); @@ -2901,12 +2870,7 @@ TextFormatPanel.prototype.addFont = function(container) callFn(this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN], [mxConstants.ALIGN_BOTTOM])), stylePanel3); this.styleButtons([top, middle, bottom]); - - if (mxClient.IS_QUIRKS) - { - mxUtils.br(container); - } - + container.appendChild(stylePanel3); // Hack for updating UI state below based on current text selection @@ -2979,13 +2943,7 @@ TextFormatPanel.prototype.addFont = function(container) }, tmp)]; this.styleButtons(btns); btns[btns.length - 2].style.marginLeft = '9px'; - - if (mxClient.IS_QUIRKS) - { - mxUtils.br(container); - tmp.style.height = '40'; - } - + container.appendChild(tmp); } else @@ -3109,15 +3067,10 @@ TextFormatPanel.prototype.addFont = function(container) var input = document.createElement('input'); input.style.textAlign = 'right'; input.style.marginTop = '4px'; - - if (!mxClient.IS_QUIRKS) - { - input.style.position = 'absolute'; - input.style.right = '32px'; - } - + input.style.position = 'absolute'; + input.style.right = '32px'; input.style.width = '40px'; - input.style.height = (mxClient.IS_QUIRKS) ? '21px' : '17px'; + input.style.height = '17px'; stylePanel2.appendChild(input); // Workaround for font size 4 if no text is selected is update font size below @@ -3258,12 +3211,8 @@ TextFormatPanel.prototype.addFont = function(container) var stepper = this.createStepper(input, inputUpdate, 1, 10, true, Menus.prototype.defaultFontSize); stepper.style.display = input.style.display; stepper.style.marginTop = '4px'; - - if (!mxClient.IS_QUIRKS) - { - stepper.style.right = '20px'; - } - + stepper.style.right = '20px'; + stylePanel2.appendChild(stepper); var arrow = fontMenu.getElementsByTagName('div')[0]; @@ -3574,11 +3523,6 @@ TextFormatPanel.prototype.addFont = function(container) wrapper2.appendChild(insertPanel); container.appendChild(wrapper2); - if (mxClient.IS_QUIRKS) - { - wrapper2.style.height = '70'; - } - var tablePanel = stylePanel.cloneNode(false); tablePanel.style.paddingLeft = '0px'; @@ -3681,12 +3625,6 @@ TextFormatPanel.prototype.addFont = function(container) wrapper3.style.paddingBottom = '10px'; wrapper3.appendChild(this.createTitle(mxResources.get('table'))); wrapper3.appendChild(tablePanel); - - if (mxClient.IS_QUIRKS) - { - mxUtils.br(container); - wrapper3.style.height = '70'; - } var tablePanel2 = stylePanel.cloneNode(false); tablePanel2.style.paddingLeft = '0px'; @@ -3807,12 +3745,6 @@ TextFormatPanel.prototype.addFont = function(container) this.styleButtons(btns); btns[2].style.marginRight = '9px'; - if (mxClient.IS_QUIRKS) - { - mxUtils.br(wrapper3); - mxUtils.br(wrapper3); - } - wrapper3.appendChild(tablePanel2); container.appendChild(wrapper3); @@ -4473,7 +4405,7 @@ StyleFormatPanel.prototype.addFill = function(container) var gradientSelect = document.createElement('select'); gradientSelect.style.position = 'absolute'; gradientSelect.style.marginTop = '-2px'; - gradientSelect.style.right = (mxClient.IS_QUIRKS) ? '52px' : '72px'; + gradientSelect.style.right = '72px'; gradientSelect.style.width = '70px'; var fillStyleSelect = gradientSelect.cloneNode(false); @@ -4822,36 +4754,22 @@ StyleFormatPanel.prototype.addStroke = function(container) altStepper.style.marginTop = '2px'; altStylePanel.appendChild(altStepper); - if (!mxClient.IS_QUIRKS) - { - input.style.position = 'absolute'; - input.style.height = '15px'; - input.style.left = '141px'; - stepper.style.left = '190px'; + input.style.position = 'absolute'; + input.style.height = '15px'; + input.style.left = '141px'; + stepper.style.left = '190px'; + + altInput.style.position = 'absolute'; + altInput.style.left = '141px'; + altInput.style.height = '15px'; + altStepper.style.left = '190px'; - altInput.style.position = 'absolute'; - altInput.style.left = '141px'; - altInput.style.height = '15px'; - altStepper.style.left = '190px'; - } - else - { - input.style.height = '17px'; - altInput.style.height = '17px'; - } - mxEvent.addListener(input, 'blur', update); mxEvent.addListener(input, 'change', update); mxEvent.addListener(altInput, 'blur', altUpdate); mxEvent.addListener(altInput, 'change', altUpdate); - - if (mxClient.IS_QUIRKS) - { - mxUtils.br(stylePanel2); - mxUtils.br(stylePanel2); - } - + var edgeStyle = this.editorUi.toolbar.addMenuFunctionInContainer(stylePanel2, 'geSprite-orthogonal', mxResources.get('waypoints'), false, mxUtils.bind(this, function(menu) { if (ss.style.shape != 'arrow') @@ -5089,22 +5007,10 @@ StyleFormatPanel.prototype.addStroke = function(container) if (ss.edges.length == graph.getSelectionCount()) { container.appendChild(stylePanel2); - - if (mxClient.IS_QUIRKS) - { - mxUtils.br(container); - mxUtils.br(container); - } - container.appendChild(arrowPanel); } else if (ss.vertices.length == graph.getSelectionCount()) { - if (mxClient.IS_QUIRKS) - { - mxUtils.br(container); - } - container.appendChild(perimeterPanel); } @@ -5454,11 +5360,6 @@ StyleFormatPanel.prototype.addEffects = function(div) var table = document.createElement('table'); - if (mxClient.IS_QUIRKS) - { - table.style.fontSize = '1em'; - } - table.style.width = '100%'; table.style.fontWeight = 'bold'; table.style.paddingRight = '20px'; @@ -5593,12 +5494,6 @@ DiagramStylePanel.prototype.addView = function(div) div.style.paddingTop = '8px'; var table = document.createElement('table'); - - if (mxClient.IS_QUIRKS) - { - table.style.fontSize = '1em'; - } - table.style.width = '100%'; table.style.fontWeight = 'bold'; @@ -6261,7 +6156,7 @@ DiagramFormatPanel.prototype.addView = function(div) btn.style.marginTop = '-4px'; btn.style.paddingBottom = (document.documentMode == 11 || mxClient.IS_MT) ? '0px' : '2px'; btn.style.height = '22px'; - btn.style.right = (mxClient.IS_QUIRKS) ? '52px' : '72px'; + btn.style.right = '72px'; btn.style.width = '56px'; bg.appendChild(btn); diff --git a/examples/grapheditor/www/js/Graph.js b/examples/grapheditor/www/js/Graph.js index 508637f0a..df3f445e3 100644 --- a/examples/grapheditor/www/js/Graph.js +++ b/examples/grapheditor/www/js/Graph.js @@ -9734,32 +9734,29 @@ if (typeof mxVertexHandler != 'undefined') // Handles paste from Word, Excel etc by removing styles, classnames and unused nodes // LATER: Fix undo/redo for paste - if (!mxClient.IS_QUIRKS && document.documentMode !== 7 && document.documentMode !== 8) + mxEvent.addListener(this.textarea, 'paste', mxUtils.bind(this, function(evt) { - mxEvent.addListener(this.textarea, 'paste', mxUtils.bind(this, function(evt) + var clone = reference(this.textarea, this.textarea.cloneNode(true)); + + window.setTimeout(mxUtils.bind(this, function() { - var clone = reference(this.textarea, this.textarea.cloneNode(true)); - - window.setTimeout(mxUtils.bind(this, function() + if (this.textarea != null) { - if (this.textarea != null) + // Paste from Word or Excel + if (this.textarea.innerHTML.indexOf('') >= 0 || + this.textarea.innerHTML.indexOf('