- Almost IE 8 working :)

This commit is contained in:
Paulo Veiga 2009-07-09 20:06:08 +00:00
parent 6ccc2f7650
commit 376fd10331
10 changed files with 167 additions and 167 deletions

View File

@ -43,6 +43,7 @@ objects = {};
objects.extend = function(subClass, baseClass) { objects.extend = function(subClass, baseClass) {
function inheritance() { function inheritance() {
} }
inheritance.prototype = baseClass.prototype; inheritance.prototype = baseClass.prototype;
subClass.prototype = new inheritance(); subClass.prototype = new inheritance();
@ -212,28 +213,7 @@ core.Utils.createDocumentFromText = function(/*string*/str, /*string?*/mimetype)
domDoc.loadXML(str); domDoc.loadXML(str);
return domDoc; return domDoc;
// DOMDocument // 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; return null;
}; };

View File

@ -24,10 +24,10 @@ web2d.peer.ToolkitVML =
var domDocument = window.document; var domDocument = window.document;
//ownerDocument; //ownerDocument;
// Add VML includes and namespace // 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(); var style = domDocument.createStyleSheet();
style.addRule('v\\:*', "behavior: url(#default#VML);"); style.addRule("v\\:*", "behavior:url(#default#VML); display:inline-block");
}, },
createWorkspace: function(element) createWorkspace: function(element)
{ {

View File

@ -62,9 +62,6 @@ web2d.peer.svg.ElipsePeer.prototype.setPosition = function(cx, cy)
web2d.peer.svg.ElipsePeer.prototype.getPosition = function() 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; return this._position;
}; };

View File

@ -157,10 +157,24 @@ web2d.peer.vml.ElementPeer.prototype.appendChild = function(elementPeer)
// Add native element .. // Add native element ..
this._native.appendChild(elementPeer._native); this._native.appendChild(elementPeer._native);
elementPeer._appededToParent();
// Broadcast events ... // Broadcast events ...
web2d.peer.utils.EventUtils.broadcastChangeEvent(this, "onChangeCoordSize"); 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() web2d.peer.vml.ElementPeer.prototype.getSize = function()
{ {
return { return {
@ -194,7 +208,6 @@ web2d.peer.vml.ElementPeer.prototype.getVMLFill = function()
if (!this._vmlFill) if (!this._vmlFill)
{ {
this._vmlFill = window.document.createElement('v:fill'); this._vmlFill = window.document.createElement('v:fill');
this._native.appendChild(this._vmlFill);
} }
return this._vmlFill; return this._vmlFill;
}; };
@ -204,12 +217,12 @@ web2d.peer.vml.ElementPeer.prototype.setFill = function(color, opacity)
var vmlFill = this.getVMLFill(); var vmlFill = this.getVMLFill();
if (core.Utils.isDefined(color)) if (core.Utils.isDefined(color))
{ {
vmlFill.setAttribute('color', color); vmlFill.color = color;
} }
if (core.Utils.isDefined(opacity)) 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) if (!this._vmlStroke)
{ {
this._vmlStroke = window.document.createElement('v:stroke'); this._vmlStroke = window.document.createElement('v:stroke');
this._native.appendChild(this._vmlStroke);
} }
return this._vmlStroke; return this._vmlStroke;
}; };

View File

@ -21,6 +21,7 @@
function afterCoreLoading() function afterCoreLoading()
{ {
// Uncomment for debug ...
if (core.UserAgent.isVMLSupported()) if (core.UserAgent.isVMLSupported())
{ {
$import("../js/mindplot.vml.js"); $import("../js/mindplot.vml.js");
@ -29,6 +30,17 @@ function afterCoreLoading()
$import("../js/mindplot.svg.js"); $import("../js/mindplot.svg.js");
} }
// if (core.UserAgent.isVMLSupported())
// {
// $import("../js/mindplot.vml-min.js");
// } else
// {
// $import("../js/mindplot.svg-min.js");
//
// }
}; };
afterCoreLoading(); afterCoreLoading();

View File

@ -21,10 +21,10 @@ function afterCoreLoading()
{ {
if (core.UserAgent.isVMLSupported()) if (core.UserAgent.isVMLSupported())
{ {
$import("../js/mindplot.vml.js"); $import("../js/mindplot.vml-min.js");
} else } else
{ {
$import("../js/mindplot.svg.js"); $import("../js/mindplot.svg-min.js");
} }
}; };

View File

@ -12,10 +12,9 @@
</c:url> </c:url>
<html> <html>
<head> <head>
<title> <!-- Internet Explorer 8 Hack -->
<spring:message code="SITE.TITLE"/> <meta http-equiv="Content-type" value="text/html;charset=UTF-8">
- ${mindmap.title} </title> <title><spring:message code="SITE.TITLE"/> - ${mindmap.title} </title>
<meta http-equiv="Content-type" value="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../css/editor.css"> <link rel="stylesheet" type="text/css" href="../css/editor.css">
<link rel="stylesheet" type="text/css" href="../css/bubble.css"> <link rel="stylesheet" type="text/css" href="../css/bubble.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/thirdparty.css"> <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/thirdparty.css">