From 376fd10331ccc94c7d44df167a9f50c2ae31561c Mon Sep 17 00:00:00 2001 From: Paulo Veiga Date: Thu, 9 Jul 2009 20:06:08 +0000 Subject: [PATCH] - Almost IE 8 working :) --- trunk/core-js/src/main/javascript/Utils.js | 60 +++++++------------ trunk/web2d/src/main/javascript/Elipse.js | 38 ++++++------ trunk/web2d/src/main/javascript/Toolkit.js | 38 ++++++------ .../main/javascript/peer/svg/ElipsePeer.js | 41 ++++++------- .../main/javascript/peer/vml/ElementPeer.js | 58 +++++++++++------- .../main/javascript/peer/vml/ElipsePeer.js | 38 ++++++------ .../src/main/javascript/peer/vml/RectPeer.js | 38 ++++++------ .../wise-webapp/src/main/webapp/js/editor.js | 12 ++++ .../src/main/webapp/js/embedded.js | 4 +- .../src/main/webapp/jsp/mindmapEditor.jsp | 7 +-- 10 files changed, 167 insertions(+), 167 deletions(-) diff --git a/trunk/core-js/src/main/javascript/Utils.js b/trunk/core-js/src/main/javascript/Utils.js index 1666db89..9c3fc142 100644 --- a/trunk/core-js/src/main/javascript/Utils.js +++ b/trunk/core-js/src/main/javascript/Utils.js @@ -1,21 +1,21 @@ /* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You under the Apache License, Version 2.0 -* (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -* $Id: file 64488 2006-03-10 17:32:09Z paulo $ -*/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * $Id: file 64488 2006-03-10 17:32:09Z paulo $ + */ core.Utils = { @@ -35,14 +35,15 @@ core.Utils = * A function used to extend one class with another * * @param {Object} subClass - * The inheriting class, or subclass + * The inheriting class, or subclass * @param {Object} baseClass - * The class from which to inherit + * The class from which to inherit */ objects = {}; objects.extend = function(subClass, baseClass) { function inheritance() { } + inheritance.prototype = baseClass.prototype; subClass.prototype = new inheritance(); @@ -212,28 +213,7 @@ core.Utils.createDocumentFromText = function(/*string*/str, /*string?*/mimetype) domDoc.loadXML(str); return domDoc; // DOMDocument - } else { - //dojo.debug("toXml didn't work?"); } - } else { - // var _document = dojo.doc(); - // if(_document.createElement){ - // // FIXME: this may change all tags to uppercase! - // var tmp = _document.createElement("xml"); - // tmp.innerHTML = str; - // if(_document.implementation && _document.implementation.createDocument){ - // var xmlDoc = _document.implementation.createDocument("foo", "", null); - // for(var i = 0; i < tmp.childNodes.length; i++) { - // xmlDoc.importNode(tmp.childNodes.item(i), true); - // } - // return xmlDoc; // DOMDocument - // } - // // FIXME: probably not a good idea to have to return an HTML fragment - // // FIXME: the tmp.doc.firstChild is as tested from IE, so it may not - // // work that way across the board - // return ((tmp.document)&& - // (tmp.document.firstChild ? tmp.document.firstChild : tmp)); // DOMDocument - // } } return null; }; diff --git a/trunk/web2d/src/main/javascript/Elipse.js b/trunk/web2d/src/main/javascript/Elipse.js index 73f0f278..09680e7f 100644 --- a/trunk/web2d/src/main/javascript/Elipse.js +++ b/trunk/web2d/src/main/javascript/Elipse.js @@ -1,22 +1,22 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You under the Apache License, Version 2.0 -* (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -* $Id: file 64488 2006-03-10 17:32:09Z paulo $ -*/ - +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +* $Id: file 64488 2006-03-10 17:32:09Z paulo $ +*/ + web2d.Elipse = function(attributes) { var peer = web2d.peer.Toolkit.createElipse(); diff --git a/trunk/web2d/src/main/javascript/Toolkit.js b/trunk/web2d/src/main/javascript/Toolkit.js index 27cdf9fc..b3a1d02a 100644 --- a/trunk/web2d/src/main/javascript/Toolkit.js +++ b/trunk/web2d/src/main/javascript/Toolkit.js @@ -1,21 +1,21 @@ /* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You under the Apache License, Version 2.0 -* (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -* $Id: file 64488 2006-03-10 17:32:09Z paulo $ -*/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * $Id: file 64488 2006-03-10 17:32:09Z paulo $ + */ web2d.peer.ToolkitVML = { @@ -24,10 +24,10 @@ web2d.peer.ToolkitVML = var domDocument = window.document; //ownerDocument; // Add VML includes and namespace - domDocument.namespaces.add("v", "urn:schemas-microsoft-com:vml", "#default#VML"); + domDocument.namespaces.add("v", "urn:schemas-microsoft-com:vml"); var style = domDocument.createStyleSheet(); - style.addRule('v\\:*', "behavior: url(#default#VML);"); + style.addRule("v\\:*", "behavior:url(#default#VML); display:inline-block"); }, createWorkspace: function(element) { diff --git a/trunk/web2d/src/main/javascript/peer/svg/ElipsePeer.js b/trunk/web2d/src/main/javascript/peer/svg/ElipsePeer.js index 2cfe666f..12998bf3 100644 --- a/trunk/web2d/src/main/javascript/peer/svg/ElipsePeer.js +++ b/trunk/web2d/src/main/javascript/peer/svg/ElipsePeer.js @@ -1,22 +1,22 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You under the Apache License, Version 2.0 -* (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -* $Id: file 64488 2006-03-10 17:32:09Z paulo $ -*/ - +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +* $Id: file 64488 2006-03-10 17:32:09Z paulo $ +*/ + web2d.peer.svg.ElipsePeer = function() { var svgElement = window.document.createElementNS(this.svgNamespace, 'ellipse'); @@ -62,9 +62,6 @@ web2d.peer.svg.ElipsePeer.prototype.setPosition = function(cx, cy) web2d.peer.svg.ElipsePeer.prototype.getPosition = function() { -// var x = this._native.getAttribute('cx'); -// var y = this._native.getAttribute('cy'); -// return {x:parseInt(x),y:parseInt(y)}; return this._position; }; diff --git a/trunk/web2d/src/main/javascript/peer/vml/ElementPeer.js b/trunk/web2d/src/main/javascript/peer/vml/ElementPeer.js index 4d3a32a6..98db75d5 100644 --- a/trunk/web2d/src/main/javascript/peer/vml/ElementPeer.js +++ b/trunk/web2d/src/main/javascript/peer/vml/ElementPeer.js @@ -1,22 +1,22 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You under the Apache License, Version 2.0 -* (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -* $Id: file 64488 2006-03-10 17:32:09Z paulo $ -*/ - +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +* $Id: file 64488 2006-03-10 17:32:09Z paulo $ +*/ + web2d.peer.vml.ElementPeer = function(vmlElement) { this._native = vmlElement; @@ -157,10 +157,24 @@ web2d.peer.vml.ElementPeer.prototype.appendChild = function(elementPeer) // Add native element .. this._native.appendChild(elementPeer._native); + elementPeer._appededToParent(); + // Broadcast events ... web2d.peer.utils.EventUtils.broadcastChangeEvent(this, "onChangeCoordSize"); }; + +// IE 8 hack ... +web2d.peer.vml.ElementPeer.prototype._appededToParent = function() +{ + var fillElem = this.getVMLFill(); + this._native.appendChild(fillElem); + + var strokeElem = this.getVMLStroke(); + this._native.appendChild(strokeElem); +} + + web2d.peer.vml.ElementPeer.prototype.getSize = function() { return { @@ -194,7 +208,6 @@ web2d.peer.vml.ElementPeer.prototype.getVMLFill = function() if (!this._vmlFill) { this._vmlFill = window.document.createElement('v:fill'); - this._native.appendChild(this._vmlFill); } return this._vmlFill; }; @@ -204,12 +217,12 @@ web2d.peer.vml.ElementPeer.prototype.setFill = function(color, opacity) var vmlFill = this.getVMLFill(); if (core.Utils.isDefined(color)) { - vmlFill.setAttribute('color', color); + vmlFill.color = color; } if (core.Utils.isDefined(opacity)) { - vmlFill.setAttribute('opacity', opacity); + vmlFill.opacitopacity; } }; @@ -230,7 +243,6 @@ web2d.peer.vml.ElementPeer.prototype.getVMLStroke = function() if (!this._vmlStroke) { this._vmlStroke = window.document.createElement('v:stroke'); - this._native.appendChild(this._vmlStroke); } return this._vmlStroke; }; diff --git a/trunk/web2d/src/main/javascript/peer/vml/ElipsePeer.js b/trunk/web2d/src/main/javascript/peer/vml/ElipsePeer.js index 0902bc8b..c3290fe5 100644 --- a/trunk/web2d/src/main/javascript/peer/vml/ElipsePeer.js +++ b/trunk/web2d/src/main/javascript/peer/vml/ElipsePeer.js @@ -1,22 +1,22 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You under the Apache License, Version 2.0 -* (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -* $Id: file 64488 2006-03-10 17:32:09Z paulo $ -*/ - +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +* $Id: file 64488 2006-03-10 17:32:09Z paulo $ +*/ + web2d.peer.vml.ElipsePeer = function() { var vmlElement = window.document.createElement('v:oval'); diff --git a/trunk/web2d/src/main/javascript/peer/vml/RectPeer.js b/trunk/web2d/src/main/javascript/peer/vml/RectPeer.js index d04fa650..dbf24f75 100644 --- a/trunk/web2d/src/main/javascript/peer/vml/RectPeer.js +++ b/trunk/web2d/src/main/javascript/peer/vml/RectPeer.js @@ -1,22 +1,22 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You under the Apache License, Version 2.0 -* (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -* $Id: file 64488 2006-03-10 17:32:09Z paulo $ -*/ - +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +* $Id: file 64488 2006-03-10 17:32:09Z paulo $ +*/ + /** * http://www.w3.org/TR/NOTE-VML#_Toc416858381 * VML arcsize number "0.2" diff --git a/trunk/wise-webapp/src/main/webapp/js/editor.js b/trunk/wise-webapp/src/main/webapp/js/editor.js index 9221ad01..223ca768 100644 --- a/trunk/wise-webapp/src/main/webapp/js/editor.js +++ b/trunk/wise-webapp/src/main/webapp/js/editor.js @@ -21,6 +21,7 @@ function afterCoreLoading() { +// Uncomment for debug ... if (core.UserAgent.isVMLSupported()) { $import("../js/mindplot.vml.js"); @@ -29,6 +30,17 @@ function afterCoreLoading() $import("../js/mindplot.svg.js"); } + +// if (core.UserAgent.isVMLSupported()) +// { +// $import("../js/mindplot.vml-min.js"); +// } else +// { +// $import("../js/mindplot.svg-min.js"); +// +// } + + }; afterCoreLoading(); diff --git a/trunk/wise-webapp/src/main/webapp/js/embedded.js b/trunk/wise-webapp/src/main/webapp/js/embedded.js index 9d03ebaa..b66d61ae 100644 --- a/trunk/wise-webapp/src/main/webapp/js/embedded.js +++ b/trunk/wise-webapp/src/main/webapp/js/embedded.js @@ -21,10 +21,10 @@ function afterCoreLoading() { if (core.UserAgent.isVMLSupported()) { - $import("../js/mindplot.vml.js"); + $import("../js/mindplot.vml-min.js"); } else { - $import("../js/mindplot.svg.js"); + $import("../js/mindplot.svg-min.js"); } }; diff --git a/trunk/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp b/trunk/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp index b331fed7..4dc23664 100644 --- a/trunk/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp +++ b/trunk/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp @@ -12,10 +12,9 @@ - - <spring:message code="SITE.TITLE"/> - - ${mindmap.title} - + + + <spring:message code="SITE.TITLE"/> - ${mindmap.title}