Normalize line endings VIVO-101

This commit is contained in:
Brian Caruso 2013-07-18 15:19:53 -04:00
parent b097a4d754
commit 54f79f2ea7
587 changed files with 91501 additions and 91501 deletions

View file

@ -8,64 +8,64 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.AccordionContainer");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.AccordionPane");
dojo.widget.defineWidget(
"dojo.widget.AccordionContainer",
dojo.widget.HtmlWidget,
{
widgetType: "AccordionContainer",
isContainer: true,
labelNodeClass: "",
containerNodeClass: "",
allowCollapse: false,
addChild: function(widget, overrideContainerNode, pos, ref, insertIndex){
if (widget.widgetType != "AccordionPane") {
var wrapper=dojo.widget.createWidget("AccordionPane",{label: widget.label, open: widget.open, labelNodeClass: this.labelNodeClass, containerNodeClass: this.containerNodeClass, allowCollapse: this.allowCollapse });
wrapper.addChild(widget);
this.addWidgetAsDirectChild(wrapper);
this.registerChild(wrapper);
wrapper.setSizes();
return wrapper;
} else {
dojo.html.addClass(widget.containerNode, this.containerNodeClass);
dojo.html.addClass(widget.labelNode, this.labelNodeClass);
this.addWidgetAsDirectChild(widget);
this.registerChild(widget);
widget.setSizes();
return widget;
}
},
postCreate: function() {
var tmpChildren = this.children;
this.children=[];
dojo.html.removeChildren(this.domNode);
dojo.lang.forEach(tmpChildren, dojo.lang.hitch(this,"addChild"));
},
removeChild: function(widget) {
dojo.widget.AccordionContainer.superclass.removeChild.call(this, widget);
if(this.children[0]){
this.children[0].setSizes();
}
},
onResized: function(){
this.children[0].setSizes();
}
}
);
// These arguments can be specified for the children of a Accordion
// Since any widget can be specified as a child, mix them
// into the base widget class. (This is a hack, but it's effective.)
dojo.lang.extend(dojo.widget.Widget, {
label: "",
open: false
});
dojo.provide("dojo.widget.AccordionContainer");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.AccordionPane");
dojo.widget.defineWidget(
"dojo.widget.AccordionContainer",
dojo.widget.HtmlWidget,
{
widgetType: "AccordionContainer",
isContainer: true,
labelNodeClass: "",
containerNodeClass: "",
allowCollapse: false,
addChild: function(widget, overrideContainerNode, pos, ref, insertIndex){
if (widget.widgetType != "AccordionPane") {
var wrapper=dojo.widget.createWidget("AccordionPane",{label: widget.label, open: widget.open, labelNodeClass: this.labelNodeClass, containerNodeClass: this.containerNodeClass, allowCollapse: this.allowCollapse });
wrapper.addChild(widget);
this.addWidgetAsDirectChild(wrapper);
this.registerChild(wrapper);
wrapper.setSizes();
return wrapper;
} else {
dojo.html.addClass(widget.containerNode, this.containerNodeClass);
dojo.html.addClass(widget.labelNode, this.labelNodeClass);
this.addWidgetAsDirectChild(widget);
this.registerChild(widget);
widget.setSizes();
return widget;
}
},
postCreate: function() {
var tmpChildren = this.children;
this.children=[];
dojo.html.removeChildren(this.domNode);
dojo.lang.forEach(tmpChildren, dojo.lang.hitch(this,"addChild"));
},
removeChild: function(widget) {
dojo.widget.AccordionContainer.superclass.removeChild.call(this, widget);
if(this.children[0]){
this.children[0].setSizes();
}
},
onResized: function(){
this.children[0].setSizes();
}
}
);
// These arguments can be specified for the children of a Accordion
// Since any widget can be specified as a child, mix them
// into the base widget class. (This is a hack, but it's effective.)
dojo.lang.extend(dojo.widget.Widget, {
label: "",
open: false
});

View file

@ -8,26 +8,26 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.Button2");
dojo.require("dojo.widget.Button");
dojo.require("dojo.widget.*");
dojo.widget.tags.addParseTreeHandler("dojo:button2");
dojo.widget.tags.addParseTreeHandler("dojo:dropdownbutton2");
dojo.widget.tags.addParseTreeHandler("dojo:combobutton2");
dojo.deprecated("dojo.widget.Button2", "Use dojo.widget.Button instead", "0.4");
dojo.requireAfterIf("html", "dojo.widget.html.Button2");
dojo.widget.Button2 = function(){}
dojo.inherits(dojo.widget.Button2, dojo.widget.Button);
dojo.lang.extend(dojo.widget.Button2, { widgetType: "Button2" });
dojo.widget.DropDownButton2 = function(){}
dojo.inherits(dojo.widget.DropDownButton2, dojo.widget.DropDownButton);
dojo.lang.extend(dojo.widget.DropDownButton2, { widgetType: "DropDownButton2" });
dojo.widget.ComboButton2 = function(){}
dojo.inherits(dojo.widget.ComboButton2, dojo.widget.ComboButton);
dojo.lang.extend(dojo.widget.ComboButton2, { widgetType: "ComboButton2" });
dojo.provide("dojo.widget.Button2");
dojo.require("dojo.widget.Button");
dojo.require("dojo.widget.*");
dojo.widget.tags.addParseTreeHandler("dojo:button2");
dojo.widget.tags.addParseTreeHandler("dojo:dropdownbutton2");
dojo.widget.tags.addParseTreeHandler("dojo:combobutton2");
dojo.deprecated("dojo.widget.Button2", "Use dojo.widget.Button instead", "0.4");
dojo.requireAfterIf("html", "dojo.widget.html.Button2");
dojo.widget.Button2 = function(){}
dojo.inherits(dojo.widget.Button2, dojo.widget.Button);
dojo.lang.extend(dojo.widget.Button2, { widgetType: "Button2" });
dojo.widget.DropDownButton2 = function(){}
dojo.inherits(dojo.widget.DropDownButton2, dojo.widget.DropDownButton);
dojo.lang.extend(dojo.widget.DropDownButton2, { widgetType: "DropDownButton2" });
dojo.widget.ComboButton2 = function(){}
dojo.inherits(dojo.widget.ComboButton2, dojo.widget.ComboButton);
dojo.lang.extend(dojo.widget.ComboButton2, { widgetType: "ComboButton2" });

View file

@ -8,15 +8,15 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.DebugConsole");
dojo.require("dojo.widget.Widget");
dojo.widget.DebugConsole= function(){
dojo.widget.Widget.call(this);
this.widgetType = "DebugConsole";
this.isContainer = true;
}
dojo.inherits(dojo.widget.DebugConsole, dojo.widget.Widget);
dojo.widget.tags.addParseTreeHandler("dojo:debugconsole");
dojo.requireAfterIf("html", "dojo.widget.html.DebugConsole");
dojo.provide("dojo.widget.DebugConsole");
dojo.require("dojo.widget.Widget");
dojo.widget.DebugConsole= function(){
dojo.widget.Widget.call(this);
this.widgetType = "DebugConsole";
this.isContainer = true;
}
dojo.inherits(dojo.widget.DebugConsole, dojo.widget.Widget);
dojo.widget.tags.addParseTreeHandler("dojo:debugconsole");
dojo.requireAfterIf("html", "dojo.widget.html.DebugConsole");

View file

@ -8,298 +8,298 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.FloatingPane");
dojo.provide("dojo.widget.html.FloatingPane");
//
// this widget provides a window-like floating pane
//
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.Manager");
dojo.require("dojo.html");
dojo.require("dojo.html.shadow");
dojo.require("dojo.style");
dojo.require("dojo.dom");
dojo.require("dojo.html.layout");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.dnd.HtmlDragMove");
dojo.require("dojo.dnd.HtmlDragMoveSource");
dojo.require("dojo.dnd.HtmlDragMoveObject");
dojo.require("dojo.widget.ResizeHandle");
dojo.widget.html.FloatingPane = function(){
dojo.widget.html.ContentPane.call(this);
}
dojo.inherits(dojo.widget.html.FloatingPane, dojo.widget.html.ContentPane);
dojo.lang.extend(dojo.widget.html.FloatingPane, {
widgetType: "FloatingPane",
// Constructor arguments
title: '',
iconSrc: '',
hasShadow: false,
constrainToContainer: false,
taskBarId: "",
resizable: true,
titleBarDisplay: "fancy",
windowState: "normal",
displayCloseAction: false,
displayMinimizeAction: false,
displayMaximizeAction: false,
maxTaskBarConnectAttempts: 5,
taskBarConnectAttempts: 0,
templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlFloatingPane.html"),
templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlFloatingPane.css"),
drag: null,
fillInTemplate: function(args, frag){
// Copy style info from input node to output node
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
// necessary for safari, khtml (for computing width/height)
document.body.appendChild(this.domNode);
// if display:none then state=minimized, otherwise state=normal
if(!this.isShowing()){
this.windowState="minimized";
}
// <img src=""> can hang IE! better get rid of it
if(this.iconSrc==""){
dojo.dom.removeNode(this.titleBarIcon);
}else{
this.titleBarIcon.src = this.iconSrc.toString();// dojo.uri.Uri obj req. toString()
}
if(this.titleBarDisplay!="none"){
this.titleBar.style.display="";
dojo.html.disableSelection(this.titleBar);
this.titleBarIcon.style.display = (this.iconSrc=="" ? "none" : "");
this.minimizeAction.style.display = (this.displayMinimizeAction ? "" : "none");
this.maximizeAction.style.display=
(this.displayMaximizeAction && this.windowState!="maximized" ? "" : "none");
this.restoreAction.style.display=
(this.displayMaximizeAction && this.windowState=="maximized" ? "" : "none");
this.closeAction.style.display= (this.displayCloseAction ? "" : "none");
this.drag = new dojo.dnd.HtmlDragMoveSource(this.domNode);
if (this.constrainToContainer) {
this.drag.constrainTo();
}
this.drag.setDragHandle(this.titleBar);
var self = this;
dojo.event.topic.subscribe("dragMove",
function (info){
if (info.source.domNode == self.domNode){
dojo.event.topic.publish('floatingPaneMove', { source: self } );
}
}
);
}
if(this.resizable){
this.resizeBar.style.display="";
var rh = dojo.widget.createWidget("ResizeHandle", {targetElmId: this.widgetId, id:this.widgetId+"_resize"});
this.resizeBar.appendChild(rh.domNode);
}
// add a drop shadow
if(this.hasShadow){
this.shadow=new dojo.html.shadow(this.domNode);
}
// Prevent IE bleed-through problem
this.bgIframe = new dojo.html.BackgroundIframe(this.domNode);
if( this.taskBarId ){
this.taskBarSetup();
}
if (dojo.hostenv.post_load_) {
this.setInitialWindowState();
} else {
dojo.addOnLoad(this, "setInitialWindowState");
}
// counteract body.appendChild above
document.body.removeChild(this.domNode);
dojo.widget.html.FloatingPane.superclass.fillInTemplate.call(this, args, frag);
},
postCreate: function(){
if(this.isShowing()){
this.width=-1; // force resize
this.resizeTo(dojo.style.getOuterWidth(this.domNode), dojo.style.getOuterHeight(this.domNode));
}
},
maximizeWindow: function(evt) {
this.previous={
width: dojo.style.getOuterWidth(this.domNode) || this.width,
height: dojo.style.getOuterHeight(this.domNode) || this.height,
left: this.domNode.style.left,
top: this.domNode.style.top,
bottom: this.domNode.style.bottom,
right: this.domNode.style.right
};
this.domNode.style.left =
dojo.style.getPixelValue(this.domNode.parentNode, "padding-left", true) + "px";
this.domNode.style.top =
dojo.style.getPixelValue(this.domNode.parentNode, "padding-top", true) + "px";
if ((this.domNode.parentNode.nodeName.toLowerCase() == 'body')) {
this.resizeTo(
dojo.html.getViewportWidth()-dojo.style.getPaddingWidth(document.body),
dojo.html.getViewportHeight()-dojo.style.getPaddingHeight(document.body)
);
} else {
this.resizeTo(
dojo.style.getContentWidth(this.domNode.parentNode),
dojo.style.getContentHeight(this.domNode.parentNode)
);
}
this.maximizeAction.style.display="none";
this.restoreAction.style.display="";
this.windowState="maximized";
},
minimizeWindow: function(evt) {
this.hide();
this.windowState = "minimized";
},
restoreWindow: function(evt) {
if (this.windowState=="minimized") {
this.show()
} else {
for(var attr in this.previous){
this.domNode.style[attr] = this.previous[attr];
}
this.resizeTo(this.previous.width, this.previous.height);
this.previous=null;
this.restoreAction.style.display="none";
this.maximizeAction.style.display=this.displayMaximizeAction ? "" : "none";
}
this.windowState="normal";
},
closeWindow: function(evt) {
dojo.dom.removeNode(this.domNode);
this.destroy();
},
onMouseDown: function(evt) {
this.bringToTop();
},
bringToTop: function() {
var floatingPanes= dojo.widget.manager.getWidgetsByType(this.widgetType);
var windows = [];
for (var x=0; x<floatingPanes.length; x++) {
if (this.widgetId != floatingPanes[x].widgetId) {
windows.push(floatingPanes[x]);
}
}
windows.sort(function(a,b) {
return a.domNode.style.zIndex - b.domNode.style.zIndex;
});
windows.push(this);
var floatingPaneStartingZ = 100;
for (x=0; x<windows.length;x++) {
windows[x].domNode.style.zIndex = floatingPaneStartingZ + x;
}
},
setInitialWindowState: function() {
if (this.windowState == "maximized") {
this.maximizeWindow();
this.show();
return;
}
if (this.windowState=="normal") {
this.show();
return;
}
if (this.windowState=="minimized") {
this.hide();
return;
}
this.windowState="minimized";
},
// add icon to task bar, connected to me
taskBarSetup: function() {
var taskbar = dojo.widget.getWidgetById(this.taskBarId);
if (!taskbar){
if (this.taskBarConnectAttempts < this.maxTaskBarConnectAttempts) {
dojo.lang.setTimeout(this, this.taskBarSetup, 50);
this.taskBarConnectAttempts++;
} else {
dojo.debug("Unable to connect to the taskBar");
}
return;
}
taskbar.addChild(this);
},
show: function(){
dojo.widget.html.FloatingPane.superclass.show.apply(this, arguments);
this.bringToTop();
},
onShow: function(){
dojo.widget.html.FloatingPane.superclass.onShow.call(this);
this.resizeTo(dojo.style.getOuterWidth(this.domNode), dojo.style.getOuterHeight(this.domNode));
},
// This is called when the user adjusts the size of the floating pane
resizeTo: function(w, h){
dojo.style.setOuterWidth(this.domNode, w);
dojo.style.setOuterHeight(this.domNode, h);
dojo.html.layout(this.domNode,
[
{domNode: this.titleBar, layoutAlign: "top"},
{domNode: this.resizeBar, layoutAlign: "bottom"},
{domNode: this.containerNode, layoutAlign: "client"}
] );
// If any of the children have layoutAlign specified, obey it
dojo.html.layout(this.containerNode, this.children, "top-bottom");
this.bgIframe.onResized();
if(this.shadow){ this.shadow.size(w, h); }
this.onResized();
},
checkSize: function() {
// checkSize() is called when the user has resized the browser window,
// but that doesn't affect this widget (or this widget's children)
// so it can be safely ignored...
// TODO: unless we are maximized. then we should resize ourself.
}
});
dojo.widget.tags.addParseTreeHandler("dojo:FloatingPane");
dojo.provide("dojo.widget.FloatingPane");
dojo.provide("dojo.widget.html.FloatingPane");
//
// this widget provides a window-like floating pane
//
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.Manager");
dojo.require("dojo.html");
dojo.require("dojo.html.shadow");
dojo.require("dojo.style");
dojo.require("dojo.dom");
dojo.require("dojo.html.layout");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.dnd.HtmlDragMove");
dojo.require("dojo.dnd.HtmlDragMoveSource");
dojo.require("dojo.dnd.HtmlDragMoveObject");
dojo.require("dojo.widget.ResizeHandle");
dojo.widget.html.FloatingPane = function(){
dojo.widget.html.ContentPane.call(this);
}
dojo.inherits(dojo.widget.html.FloatingPane, dojo.widget.html.ContentPane);
dojo.lang.extend(dojo.widget.html.FloatingPane, {
widgetType: "FloatingPane",
// Constructor arguments
title: '',
iconSrc: '',
hasShadow: false,
constrainToContainer: false,
taskBarId: "",
resizable: true,
titleBarDisplay: "fancy",
windowState: "normal",
displayCloseAction: false,
displayMinimizeAction: false,
displayMaximizeAction: false,
maxTaskBarConnectAttempts: 5,
taskBarConnectAttempts: 0,
templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlFloatingPane.html"),
templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlFloatingPane.css"),
drag: null,
fillInTemplate: function(args, frag){
// Copy style info from input node to output node
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
// necessary for safari, khtml (for computing width/height)
document.body.appendChild(this.domNode);
// if display:none then state=minimized, otherwise state=normal
if(!this.isShowing()){
this.windowState="minimized";
}
// <img src=""> can hang IE! better get rid of it
if(this.iconSrc==""){
dojo.dom.removeNode(this.titleBarIcon);
}else{
this.titleBarIcon.src = this.iconSrc.toString();// dojo.uri.Uri obj req. toString()
}
if(this.titleBarDisplay!="none"){
this.titleBar.style.display="";
dojo.html.disableSelection(this.titleBar);
this.titleBarIcon.style.display = (this.iconSrc=="" ? "none" : "");
this.minimizeAction.style.display = (this.displayMinimizeAction ? "" : "none");
this.maximizeAction.style.display=
(this.displayMaximizeAction && this.windowState!="maximized" ? "" : "none");
this.restoreAction.style.display=
(this.displayMaximizeAction && this.windowState=="maximized" ? "" : "none");
this.closeAction.style.display= (this.displayCloseAction ? "" : "none");
this.drag = new dojo.dnd.HtmlDragMoveSource(this.domNode);
if (this.constrainToContainer) {
this.drag.constrainTo();
}
this.drag.setDragHandle(this.titleBar);
var self = this;
dojo.event.topic.subscribe("dragMove",
function (info){
if (info.source.domNode == self.domNode){
dojo.event.topic.publish('floatingPaneMove', { source: self } );
}
}
);
}
if(this.resizable){
this.resizeBar.style.display="";
var rh = dojo.widget.createWidget("ResizeHandle", {targetElmId: this.widgetId, id:this.widgetId+"_resize"});
this.resizeBar.appendChild(rh.domNode);
}
// add a drop shadow
if(this.hasShadow){
this.shadow=new dojo.html.shadow(this.domNode);
}
// Prevent IE bleed-through problem
this.bgIframe = new dojo.html.BackgroundIframe(this.domNode);
if( this.taskBarId ){
this.taskBarSetup();
}
if (dojo.hostenv.post_load_) {
this.setInitialWindowState();
} else {
dojo.addOnLoad(this, "setInitialWindowState");
}
// counteract body.appendChild above
document.body.removeChild(this.domNode);
dojo.widget.html.FloatingPane.superclass.fillInTemplate.call(this, args, frag);
},
postCreate: function(){
if(this.isShowing()){
this.width=-1; // force resize
this.resizeTo(dojo.style.getOuterWidth(this.domNode), dojo.style.getOuterHeight(this.domNode));
}
},
maximizeWindow: function(evt) {
this.previous={
width: dojo.style.getOuterWidth(this.domNode) || this.width,
height: dojo.style.getOuterHeight(this.domNode) || this.height,
left: this.domNode.style.left,
top: this.domNode.style.top,
bottom: this.domNode.style.bottom,
right: this.domNode.style.right
};
this.domNode.style.left =
dojo.style.getPixelValue(this.domNode.parentNode, "padding-left", true) + "px";
this.domNode.style.top =
dojo.style.getPixelValue(this.domNode.parentNode, "padding-top", true) + "px";
if ((this.domNode.parentNode.nodeName.toLowerCase() == 'body')) {
this.resizeTo(
dojo.html.getViewportWidth()-dojo.style.getPaddingWidth(document.body),
dojo.html.getViewportHeight()-dojo.style.getPaddingHeight(document.body)
);
} else {
this.resizeTo(
dojo.style.getContentWidth(this.domNode.parentNode),
dojo.style.getContentHeight(this.domNode.parentNode)
);
}
this.maximizeAction.style.display="none";
this.restoreAction.style.display="";
this.windowState="maximized";
},
minimizeWindow: function(evt) {
this.hide();
this.windowState = "minimized";
},
restoreWindow: function(evt) {
if (this.windowState=="minimized") {
this.show()
} else {
for(var attr in this.previous){
this.domNode.style[attr] = this.previous[attr];
}
this.resizeTo(this.previous.width, this.previous.height);
this.previous=null;
this.restoreAction.style.display="none";
this.maximizeAction.style.display=this.displayMaximizeAction ? "" : "none";
}
this.windowState="normal";
},
closeWindow: function(evt) {
dojo.dom.removeNode(this.domNode);
this.destroy();
},
onMouseDown: function(evt) {
this.bringToTop();
},
bringToTop: function() {
var floatingPanes= dojo.widget.manager.getWidgetsByType(this.widgetType);
var windows = [];
for (var x=0; x<floatingPanes.length; x++) {
if (this.widgetId != floatingPanes[x].widgetId) {
windows.push(floatingPanes[x]);
}
}
windows.sort(function(a,b) {
return a.domNode.style.zIndex - b.domNode.style.zIndex;
});
windows.push(this);
var floatingPaneStartingZ = 100;
for (x=0; x<windows.length;x++) {
windows[x].domNode.style.zIndex = floatingPaneStartingZ + x;
}
},
setInitialWindowState: function() {
if (this.windowState == "maximized") {
this.maximizeWindow();
this.show();
return;
}
if (this.windowState=="normal") {
this.show();
return;
}
if (this.windowState=="minimized") {
this.hide();
return;
}
this.windowState="minimized";
},
// add icon to task bar, connected to me
taskBarSetup: function() {
var taskbar = dojo.widget.getWidgetById(this.taskBarId);
if (!taskbar){
if (this.taskBarConnectAttempts < this.maxTaskBarConnectAttempts) {
dojo.lang.setTimeout(this, this.taskBarSetup, 50);
this.taskBarConnectAttempts++;
} else {
dojo.debug("Unable to connect to the taskBar");
}
return;
}
taskbar.addChild(this);
},
show: function(){
dojo.widget.html.FloatingPane.superclass.show.apply(this, arguments);
this.bringToTop();
},
onShow: function(){
dojo.widget.html.FloatingPane.superclass.onShow.call(this);
this.resizeTo(dojo.style.getOuterWidth(this.domNode), dojo.style.getOuterHeight(this.domNode));
},
// This is called when the user adjusts the size of the floating pane
resizeTo: function(w, h){
dojo.style.setOuterWidth(this.domNode, w);
dojo.style.setOuterHeight(this.domNode, h);
dojo.html.layout(this.domNode,
[
{domNode: this.titleBar, layoutAlign: "top"},
{domNode: this.resizeBar, layoutAlign: "bottom"},
{domNode: this.containerNode, layoutAlign: "client"}
] );
// If any of the children have layoutAlign specified, obey it
dojo.html.layout(this.containerNode, this.children, "top-bottom");
this.bgIframe.onResized();
if(this.shadow){ this.shadow.size(w, h); }
this.onResized();
},
checkSize: function() {
// checkSize() is called when the user has resized the browser window,
// but that doesn't affect this widget (or this widget's children)
// so it can be safely ignored...
// TODO: unless we are maximized. then we should resize ourself.
}
});
dojo.widget.tags.addParseTreeHandler("dojo:FloatingPane");

View file

@ -8,37 +8,37 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.GoogleMap");
dojo.provide("dojo.widget.GoogleMap.Controls");
dojo.require("dojo.widget.*");
dojo.widget.tags.addParseTreeHandler("dojo:googlemap");
dojo.widget.GoogleMap=function(){
// summary
// base class for the Google Map widget
dojo.widget.Widget.call(this);
this.widgetType="GoogleMap";
this.isContainer=false;
}
dojo.inherits(dojo.widget.GoogleMap, dojo.widget.Widget);
dojo.widget.GoogleMap.Controls={
LargeMap:"largemap",
SmallMap:"smallmap",
SmallZoom:"smallzoom",
Scale:"scale",
MapType:"maptype",
Overview:"overview",
get:function(s){
for(var p in this){
if(typeof(this[p])=="string"
&& this[p]==s
){
return p;
}
}
return null;
}
};
dojo.requireAfterIf("html", "dojo.widget.html.GoogleMap");
dojo.provide("dojo.widget.GoogleMap");
dojo.provide("dojo.widget.GoogleMap.Controls");
dojo.require("dojo.widget.*");
dojo.widget.tags.addParseTreeHandler("dojo:googlemap");
dojo.widget.GoogleMap=function(){
// summary
// base class for the Google Map widget
dojo.widget.Widget.call(this);
this.widgetType="GoogleMap";
this.isContainer=false;
}
dojo.inherits(dojo.widget.GoogleMap, dojo.widget.Widget);
dojo.widget.GoogleMap.Controls={
LargeMap:"largemap",
SmallMap:"smallmap",
SmallZoom:"smallzoom",
Scale:"scale",
MapType:"maptype",
Overview:"overview",
get:function(s){
for(var p in this){
if(typeof(this[p])=="string"
&& this[p]==s
){
return p;
}
}
return null;
}
};
dojo.requireAfterIf("html", "dojo.widget.html.GoogleMap");

View file

@ -8,69 +8,69 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.Select");
dojo.provide("dojo.widget.html.Select");
dojo.require("dojo.widget.html.ComboBox");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.html.stabile");
/*
* The Select widget is an enhanced version of HTML's <select> tag.
*
* Similar features:
* - There is a drop down list of possible values.
* - You can only enter a value from the drop down list. (You can't enter an arbitrary value.)
* - The value submitted with the form is the hidden value (ex: CA),
not the displayed value a.k.a. label (ex: California)
*
* Enhancements over plain HTML version:
* - If you type in some text then it will filter down the list of possible values in the drop down list.
* - List can be specified either as a static list or via a javascript function (that can get the list from a server)
*/
dojo.widget.defineWidget(
"dojo.widget.html.Select",
dojo.widget.html.ComboBox,
{
widgetType: "Select",
forceValidOption: true,
setValue: function(value) {
this.comboBoxValue.value = value;
dojo.widget.html.stabile.setState(this.widgetId, this.getState(), true);
},
setLabel: function(value){
// FIXME, not sure what to do here!
this.comboBoxSelectionValue.value = value;
if (this.textInputNode.value != value) { // prevent mucking up of selection
this.textInputNode.value = value;
}
},
getLabel: function(){
return this.comboBoxSelectionValue.value;
},
getState: function() {
return {
value: this.getValue(),
label: this.getLabel()
};
},
onKeyUp: function(evt){
this.setLabel(this.textInputNode.value);
},
setState: function(state) {
this.setValue(state.value);
this.setLabel(state.label);
},
setAllValues: function(value1, value2){
this.setValue(value2);
this.setLabel(value1);
}
});
dojo.provide("dojo.widget.Select");
dojo.provide("dojo.widget.html.Select");
dojo.require("dojo.widget.html.ComboBox");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.html.stabile");
/*
* The Select widget is an enhanced version of HTML's <select> tag.
*
* Similar features:
* - There is a drop down list of possible values.
* - You can only enter a value from the drop down list. (You can't enter an arbitrary value.)
* - The value submitted with the form is the hidden value (ex: CA),
not the displayed value a.k.a. label (ex: California)
*
* Enhancements over plain HTML version:
* - If you type in some text then it will filter down the list of possible values in the drop down list.
* - List can be specified either as a static list or via a javascript function (that can get the list from a server)
*/
dojo.widget.defineWidget(
"dojo.widget.html.Select",
dojo.widget.html.ComboBox,
{
widgetType: "Select",
forceValidOption: true,
setValue: function(value) {
this.comboBoxValue.value = value;
dojo.widget.html.stabile.setState(this.widgetId, this.getState(), true);
},
setLabel: function(value){
// FIXME, not sure what to do here!
this.comboBoxSelectionValue.value = value;
if (this.textInputNode.value != value) { // prevent mucking up of selection
this.textInputNode.value = value;
}
},
getLabel: function(){
return this.comboBoxSelectionValue.value;
},
getState: function() {
return {
value: this.getValue(),
label: this.getLabel()
};
},
onKeyUp: function(evt){
this.setLabel(this.textInputNode.value);
},
setState: function(state) {
this.setValue(state.value);
this.setLabel(state.label);
},
setAllValues: function(value1, value2){
this.setValue(value2);
this.setLabel(value1);
}
});

View file

@ -8,254 +8,254 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.TabContainer");
dojo.provide("dojo.widget.html.TabContainer");
dojo.provide("dojo.widget.Tab");
dojo.require("dojo.lang.func");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.html");
dojo.require("dojo.style");
dojo.require("dojo.html.layout");
//////////////////////////////////////////
// TabContainer -- a set of Tabs
//////////////////////////////////////////
dojo.widget.html.TabContainer = function() {
dojo.widget.HtmlWidget.call(this);
}
dojo.inherits(dojo.widget.html.TabContainer, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.html.TabContainer, {
widgetType: "TabContainer",
isContainer: true,
// Constructor arguments
labelPosition: "top",
closeButton: "none",
useVisibility: false, // true-->use visibility:hidden instead of display:none
// if false, TabContainers size changes according to size of currently selected tab
doLayout: true,
templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlTabContainer.html"),
templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlTabContainer.css"),
selectedTab: "", // initially selected tab (widgetId)
fillInTemplate: function(args, frag) {
// Copy style info from input node to output node
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
dojo.widget.html.TabContainer.superclass.fillInTemplate.call(this, args, frag);
},
postCreate: function(args, frag) {
// Load all the tabs, creating a label for each one
for(var i=0; i<this.children.length; i++){
this._setupTab(this.children[i]);
}
if (this.closeButton=="pane") {
var div = document.createElement("div");
dojo.html.addClass(div, "dojoTabPanePaneClose");
var self = this;
dojo.event.connect(div, "onclick", function(){ self._runOnCloseTab(self.selectedTabWidget); });
dojo.event.connect(div, "onmouseover", function(){ dojo.html.addClass(div, "dojoTabPanePaneCloseHover"); });
dojo.event.connect(div, "onmouseout", function(){ dojo.html.removeClass(div, "dojoTabPanePaneCloseHover"); });
this.dojoTabLabels.appendChild(div);
}
if(this.doLayout){
dojo.html.addClass(this.dojoTabLabels, "dojoTabLabels-"+this.labelPosition);
} else {
dojo.html.addClass(this.dojoTabLabels, "dojoTabLabels-"+this.labelPosition+"-noLayout");
}
this._doSizing();
// Display the selected tab
if(this.selectedTabWidget){
this.selectTab(this.selectedTabWidget, true);
}
},
addChild: function(child, overrideContainerNode, pos, ref, insertIndex){
this._setupTab(child);
dojo.widget.html.TabContainer.superclass.addChild.call(this,child, overrideContainerNode, pos, ref, insertIndex);
// in case the tab labels have overflowed from one line to two lines
this._doSizing();
},
_setupTab: function(tab){
tab.domNode.style.display="none";
// Create label
tab.div = document.createElement("div");
dojo.widget.wai.setAttr(tab.div, "waiRole", "tab");
dojo.html.addClass(tab.div, "dojoTabPaneTab");
var span = document.createElement("span");
span.innerHTML = tab.label;
dojo.html.disableSelection(span);
if (this.closeButton=="tab") {
var img = document.createElement("div");
dojo.html.addClass(img, "dojoTabPaneTabClose");
var self = this;
dojo.event.connect(img, "onclick", function(evt){ self._runOnCloseTab(tab); dojo.event.browser.stopEvent(evt); });
dojo.event.connect(img, "onmouseover", function(){ dojo.html.addClass(img,"dojoTabPaneTabCloseHover"); });
dojo.event.connect(img, "onmouseout", function(){ dojo.html.removeClass(img,"dojoTabPaneTabCloseHover"); });
span.appendChild(img);
}
tab.div.appendChild(span);
this.dojoTabLabels.appendChild(tab.div);
var self = this;
dojo.event.connect(tab.div, "onclick", function(){ self.selectTab(tab); });
if(!this.selectedTabWidget || this.selectedTab==tab.widgetId || tab.selected){
this.selectedTabWidget = tab;
} else {
this._hideTab(tab);
}
dojo.html.addClass(tab.domNode, "dojoTabPane");
with(tab.domNode.style){
top = dojo.style.getPixelValue(this.containerNode, "padding-top", true);
left = dojo.style.getPixelValue(this.containerNode, "padding-left", true);
}
},
// Configure the content pane to take up all the space except for where the tab labels are
_doSizing: function(){
// position the labels and the container node
var labelAlign=this.labelPosition.replace(/-h/,"");
var children = [
{domNode: this.dojoTabLabels, layoutAlign: labelAlign},
{domNode: this.containerNode, layoutAlign: "client"}
];
if (this.doLayout) {
dojo.html.layout(this.domNode, children);
}
// size the current tab
// TODO: should have ptr to current tab rather than searching
var cw=dojo.style.getContentWidth(this.containerNode);
var ch=dojo.style.getContentHeight(this.containerNode);
dojo.lang.forEach(this.children, function(child){
//if (this.doLayout) {
if(child.selected){
child.resizeTo(cw, ch);
}
//} else {
// child.onResized();
//}
});
},
removeChild: function(tab) {
// remove tab event handlers
dojo.event.disconnect(tab.div, "onclick", function () { });
if (this.closeButton=="tab") {
var img = tab.div.lastChild.lastChild;
if (img) {
dojo.html.removeClass(img, "dojoTabPaneTabClose", function () { });
dojo.event.disconnect(img, "onclick", function () { });
dojo.event.disconnect(img, "onmouseover", function () { });
dojo.event.disconnect(img, "onmouseout", function () { });
}
}
dojo.widget.html.TabContainer.superclass.removeChild.call(this, tab);
dojo.html.removeClass(tab.domNode, "dojoTabPane");
this.dojoTabLabels.removeChild(tab.div);
delete(tab.div);
if (this.selectedTabWidget === tab) {
this.selectedTabWidget = undefined;
if (this.children.length > 0) {
this.selectTab(this.children[0], true);
}
}
// in case the tab labels have overflowed from one line to two lines
this._doSizing();
},
selectTab: function(tab, _noRefresh) {
// Deselect old tab and select new one
if (this.selectedTabWidget) {
this._hideTab(this.selectedTabWidget);
}
this.selectedTabWidget = tab;
this._showTab(tab, _noRefresh);
},
_showTab: function(tab, _noRefresh) {
dojo.html.addClass(tab.div, "current");
tab.selected=true;
if ( this.useVisibility && !dojo.render.html.ie ) {
tab.domNode.style.visibility="visible";
} else {
// make sure we dont refresh onClose and on postCreate
// speeds up things a bit when using refreshOnShow and fixes #646
if(_noRefresh && tab.refreshOnShow){
var tmp = tab.refreshOnShow;
tab.refreshOnShow = false;
tab.show();
tab.refreshOnShow = tmp;
}else{
tab.show();
}
tab.resizeTo(
dojo.style.getContentWidth(this.containerNode),
dojo.style.getContentHeight(this.containerNode)
);
}
},
_hideTab: function(tab) {
dojo.html.removeClass(tab.div, "current");
tab.selected=false;
if( this.useVisibility ){
tab.domNode.style.visibility="hidden";
}else{
tab.hide();
}
},
_runOnCloseTab: function(tab) {
var onc = tab.extraArgs.onClose || tab.extraArgs.onclose;
var fcn = dojo.lang.isFunction(onc) ? onc : window[onc];
var remove = dojo.lang.isFunction(fcn) ? fcn(this,tab) : true;
if(remove) {
this.removeChild(tab);
// makes sure we can clean up executeScripts in ContentPane onUnLoad
tab.destroy();
}
},
onResized: function() {
this._doSizing();
}
});
dojo.widget.tags.addParseTreeHandler("dojo:TabContainer");
// These arguments can be specified for the children of a TabContainer.
// Since any widget can be specified as a TabContainer child, mix them
// into the base widget class. (This is a hack, but it's effective.)
dojo.lang.extend(dojo.widget.Widget, {
label: "",
selected: false // is this tab currently selected?
});
dojo.provide("dojo.widget.TabContainer");
dojo.provide("dojo.widget.html.TabContainer");
dojo.provide("dojo.widget.Tab");
dojo.require("dojo.lang.func");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.html");
dojo.require("dojo.style");
dojo.require("dojo.html.layout");
//////////////////////////////////////////
// TabContainer -- a set of Tabs
//////////////////////////////////////////
dojo.widget.html.TabContainer = function() {
dojo.widget.HtmlWidget.call(this);
}
dojo.inherits(dojo.widget.html.TabContainer, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.html.TabContainer, {
widgetType: "TabContainer",
isContainer: true,
// Constructor arguments
labelPosition: "top",
closeButton: "none",
useVisibility: false, // true-->use visibility:hidden instead of display:none
// if false, TabContainers size changes according to size of currently selected tab
doLayout: true,
templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlTabContainer.html"),
templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlTabContainer.css"),
selectedTab: "", // initially selected tab (widgetId)
fillInTemplate: function(args, frag) {
// Copy style info from input node to output node
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
dojo.widget.html.TabContainer.superclass.fillInTemplate.call(this, args, frag);
},
postCreate: function(args, frag) {
// Load all the tabs, creating a label for each one
for(var i=0; i<this.children.length; i++){
this._setupTab(this.children[i]);
}
if (this.closeButton=="pane") {
var div = document.createElement("div");
dojo.html.addClass(div, "dojoTabPanePaneClose");
var self = this;
dojo.event.connect(div, "onclick", function(){ self._runOnCloseTab(self.selectedTabWidget); });
dojo.event.connect(div, "onmouseover", function(){ dojo.html.addClass(div, "dojoTabPanePaneCloseHover"); });
dojo.event.connect(div, "onmouseout", function(){ dojo.html.removeClass(div, "dojoTabPanePaneCloseHover"); });
this.dojoTabLabels.appendChild(div);
}
if(this.doLayout){
dojo.html.addClass(this.dojoTabLabels, "dojoTabLabels-"+this.labelPosition);
} else {
dojo.html.addClass(this.dojoTabLabels, "dojoTabLabels-"+this.labelPosition+"-noLayout");
}
this._doSizing();
// Display the selected tab
if(this.selectedTabWidget){
this.selectTab(this.selectedTabWidget, true);
}
},
addChild: function(child, overrideContainerNode, pos, ref, insertIndex){
this._setupTab(child);
dojo.widget.html.TabContainer.superclass.addChild.call(this,child, overrideContainerNode, pos, ref, insertIndex);
// in case the tab labels have overflowed from one line to two lines
this._doSizing();
},
_setupTab: function(tab){
tab.domNode.style.display="none";
// Create label
tab.div = document.createElement("div");
dojo.widget.wai.setAttr(tab.div, "waiRole", "tab");
dojo.html.addClass(tab.div, "dojoTabPaneTab");
var span = document.createElement("span");
span.innerHTML = tab.label;
dojo.html.disableSelection(span);
if (this.closeButton=="tab") {
var img = document.createElement("div");
dojo.html.addClass(img, "dojoTabPaneTabClose");
var self = this;
dojo.event.connect(img, "onclick", function(evt){ self._runOnCloseTab(tab); dojo.event.browser.stopEvent(evt); });
dojo.event.connect(img, "onmouseover", function(){ dojo.html.addClass(img,"dojoTabPaneTabCloseHover"); });
dojo.event.connect(img, "onmouseout", function(){ dojo.html.removeClass(img,"dojoTabPaneTabCloseHover"); });
span.appendChild(img);
}
tab.div.appendChild(span);
this.dojoTabLabels.appendChild(tab.div);
var self = this;
dojo.event.connect(tab.div, "onclick", function(){ self.selectTab(tab); });
if(!this.selectedTabWidget || this.selectedTab==tab.widgetId || tab.selected){
this.selectedTabWidget = tab;
} else {
this._hideTab(tab);
}
dojo.html.addClass(tab.domNode, "dojoTabPane");
with(tab.domNode.style){
top = dojo.style.getPixelValue(this.containerNode, "padding-top", true);
left = dojo.style.getPixelValue(this.containerNode, "padding-left", true);
}
},
// Configure the content pane to take up all the space except for where the tab labels are
_doSizing: function(){
// position the labels and the container node
var labelAlign=this.labelPosition.replace(/-h/,"");
var children = [
{domNode: this.dojoTabLabels, layoutAlign: labelAlign},
{domNode: this.containerNode, layoutAlign: "client"}
];
if (this.doLayout) {
dojo.html.layout(this.domNode, children);
}
// size the current tab
// TODO: should have ptr to current tab rather than searching
var cw=dojo.style.getContentWidth(this.containerNode);
var ch=dojo.style.getContentHeight(this.containerNode);
dojo.lang.forEach(this.children, function(child){
//if (this.doLayout) {
if(child.selected){
child.resizeTo(cw, ch);
}
//} else {
// child.onResized();
//}
});
},
removeChild: function(tab) {
// remove tab event handlers
dojo.event.disconnect(tab.div, "onclick", function () { });
if (this.closeButton=="tab") {
var img = tab.div.lastChild.lastChild;
if (img) {
dojo.html.removeClass(img, "dojoTabPaneTabClose", function () { });
dojo.event.disconnect(img, "onclick", function () { });
dojo.event.disconnect(img, "onmouseover", function () { });
dojo.event.disconnect(img, "onmouseout", function () { });
}
}
dojo.widget.html.TabContainer.superclass.removeChild.call(this, tab);
dojo.html.removeClass(tab.domNode, "dojoTabPane");
this.dojoTabLabels.removeChild(tab.div);
delete(tab.div);
if (this.selectedTabWidget === tab) {
this.selectedTabWidget = undefined;
if (this.children.length > 0) {
this.selectTab(this.children[0], true);
}
}
// in case the tab labels have overflowed from one line to two lines
this._doSizing();
},
selectTab: function(tab, _noRefresh) {
// Deselect old tab and select new one
if (this.selectedTabWidget) {
this._hideTab(this.selectedTabWidget);
}
this.selectedTabWidget = tab;
this._showTab(tab, _noRefresh);
},
_showTab: function(tab, _noRefresh) {
dojo.html.addClass(tab.div, "current");
tab.selected=true;
if ( this.useVisibility && !dojo.render.html.ie ) {
tab.domNode.style.visibility="visible";
} else {
// make sure we dont refresh onClose and on postCreate
// speeds up things a bit when using refreshOnShow and fixes #646
if(_noRefresh && tab.refreshOnShow){
var tmp = tab.refreshOnShow;
tab.refreshOnShow = false;
tab.show();
tab.refreshOnShow = tmp;
}else{
tab.show();
}
tab.resizeTo(
dojo.style.getContentWidth(this.containerNode),
dojo.style.getContentHeight(this.containerNode)
);
}
},
_hideTab: function(tab) {
dojo.html.removeClass(tab.div, "current");
tab.selected=false;
if( this.useVisibility ){
tab.domNode.style.visibility="hidden";
}else{
tab.hide();
}
},
_runOnCloseTab: function(tab) {
var onc = tab.extraArgs.onClose || tab.extraArgs.onclose;
var fcn = dojo.lang.isFunction(onc) ? onc : window[onc];
var remove = dojo.lang.isFunction(fcn) ? fcn(this,tab) : true;
if(remove) {
this.removeChild(tab);
// makes sure we can clean up executeScripts in ContentPane onUnLoad
tab.destroy();
}
},
onResized: function() {
this._doSizing();
}
});
dojo.widget.tags.addParseTreeHandler("dojo:TabContainer");
// These arguments can be specified for the children of a TabContainer.
// Since any widget can be specified as a TabContainer child, mix them
// into the base widget class. (This is a hack, but it's effective.)
dojo.lang.extend(dojo.widget.Widget, {
label: "",
selected: false // is this tab currently selected?
});

View file

@ -8,25 +8,25 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.TaskBar");
dojo.provide("dojo.widget.TaskBarItem");
dojo.require("dojo.widget.Widget");
dojo.widget.TaskBar = function(){
dojo.widget.Widget.call(this);
this.widgetType = "TaskBar";
this.isContainer = true;
}
dojo.inherits(dojo.widget.TaskBar, dojo.widget.Widget);
dojo.widget.tags.addParseTreeHandler("dojo:taskbar");
dojo.widget.TaskBarItem = function(){
dojo.widget.Widget.call(this);
this.widgetType = "TaskBarItem";
}
dojo.inherits(dojo.widget.TaskBarItem, dojo.widget.Widget);
dojo.widget.tags.addParseTreeHandler("dojo:taskbaritem");
dojo.requireAfterIf("html", "dojo.widget.html.TaskBar");
dojo.provide("dojo.widget.TaskBar");
dojo.provide("dojo.widget.TaskBarItem");
dojo.require("dojo.widget.Widget");
dojo.widget.TaskBar = function(){
dojo.widget.Widget.call(this);
this.widgetType = "TaskBar";
this.isContainer = true;
}
dojo.inherits(dojo.widget.TaskBar, dojo.widget.Widget);
dojo.widget.tags.addParseTreeHandler("dojo:taskbar");
dojo.widget.TaskBarItem = function(){
dojo.widget.Widget.call(this);
this.widgetType = "TaskBarItem";
}
dojo.inherits(dojo.widget.TaskBarItem, dojo.widget.Widget);
dojo.widget.tags.addParseTreeHandler("dojo:taskbaritem");
dojo.requireAfterIf("html", "dojo.widget.html.TaskBar");

View file

@ -8,33 +8,33 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.Toggler");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
// clicking on this node shows/hides another widget
dojo.widget.Toggler = function(){
dojo.widget.DomWidget.call(this);
}
dojo.inherits(dojo.widget.Toggler, dojo.widget.DomWidget);
dojo.lang.extend(dojo.widget.Toggler, {
widgetType: "Toggler",
// Associated widget
targetId: '',
fillInTemplate: function() {
dojo.event.connect(this.domNode, "onclick", this, "onClick");
},
onClick: function() {
var pane = dojo.widget.byId(this.targetId);
if(!pane){ return; }
pane.explodeSrc = this.domNode;
pane.toggleShowing();
}
});
dojo.widget.tags.addParseTreeHandler("dojo:toggler");
dojo.provide("dojo.widget.Toggler");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
// clicking on this node shows/hides another widget
dojo.widget.Toggler = function(){
dojo.widget.DomWidget.call(this);
}
dojo.inherits(dojo.widget.Toggler, dojo.widget.DomWidget);
dojo.lang.extend(dojo.widget.Toggler, {
widgetType: "Toggler",
// Associated widget
targetId: '',
fillInTemplate: function() {
dojo.event.connect(this.domNode, "onclick", this, "onClick");
},
onClick: function() {
var pane = dojo.widget.byId(this.targetId);
if(!pane){ return; }
pane.explodeSrc = this.domNode;
pane.toggleShowing();
}
});
dojo.widget.tags.addParseTreeHandler("dojo:toggler");

View file

@ -8,7 +8,7 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.Tooltip");
dojo.require("dojo.widget.Widget");
dojo.requireAfterIf("html", "dojo.widget.html.Tooltip");
dojo.provide("dojo.widget.Tooltip");
dojo.require("dojo.widget.Widget");
dojo.requireAfterIf("html", "dojo.widget.html.Tooltip");

File diff suppressed because it is too large Load diff

View file

@ -8,20 +8,20 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.YahooMap");
dojo.provide("dojo.widget.YahooMap.Controls");
dojo.require("dojo.widget.*");
dojo.widget.defineWidget(
"dojo.widget.YahooMap",
dojo.widget.Widget,
{ isContainer: false }
);
dojo.widget.YahooMap.Controls={
MapType:"maptype",
Pan:"pan",
ZoomLong:"zoomlong",
ZoomShort:"zoomshort"
};
dojo.requireAfterIf("html", "dojo.widget.html.YahooMap");
dojo.provide("dojo.widget.YahooMap");
dojo.provide("dojo.widget.YahooMap.Controls");
dojo.require("dojo.widget.*");
dojo.widget.defineWidget(
"dojo.widget.YahooMap",
dojo.widget.Widget,
{ isContainer: false }
);
dojo.widget.YahooMap.Controls={
MapType:"maptype",
Pan:"pan",
ZoomLong:"zoomlong",
ZoomShort:"zoomshort"
};
dojo.requireAfterIf("html", "dojo.widget.html.YahooMap");

View file

@ -8,91 +8,91 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.html.AccordionPane");
dojo.require("dojo.widget.TitlePane");
dojo.widget.html.AccordionPane = function(){
dojo.widget.html.TitlePane.call(this);
this.widgetType = "AccordionPane";
this.open=false;
this.allowCollapse=true;
this.label="";
this.open=false;
this.labelNodeClass="";
this.containerNodeClass="";
}
dojo.inherits(dojo.widget.html.AccordionPane, dojo.widget.html.TitlePane);
dojo.lang.extend(dojo.widget.html.AccordionPane, {
postCreate: function() {
dojo.widget.html.AccordionPane.superclass.postCreate.call(this);
this.domNode.widgetType=this.widgetType;
this.setSizes();
dojo.html.addClass(this.labelNode, this.labelNodeClass);
dojo.html.disableSelection(this.labelNode);
dojo.html.addClass(this.containerNode, this.containerNodeClass);
},
collapse: function() {
//dojo.fx.html.wipeOut(this.containerNode,250);
//var anim = dojo.fx.html.wipe(this.containerNode, 1000, this.containerNode.offsetHeight, 0, null, true);
this.containerNode.style.display="none";
this.open=false;
},
expand: function() {
//dojo.fx.html.wipeIn(this.containerNode,250);
this.containerNode.style.display="block";
//var anim = dojo.fx.html.wipe(this.containerNode, 1000, 0, this.containerNode.scrollHeight, null, true);
this.open=true;
},
getCollapsedHeight: function() {
return dojo.style.getOuterHeight(this.labelNode)+1;
},
setSizes: function() {
var siblings = this.domNode.parentNode.childNodes;
var height=dojo.style.getInnerHeight(this.domNode.parentNode)-this.getCollapsedHeight();
this.siblingWidgets = [];
for (var x=0; x<siblings.length; x++) {
if (siblings[x].widgetType==this.widgetType) {
if (this.domNode != siblings[x]) {
var ap = dojo.widget.byNode(siblings[x]);
this.siblingWidgets.push(ap);
height -= ap.getCollapsedHeight();
}
}
}
for (var x=0; x<this.siblingWidgets.length; x++) {
dojo.style.setOuterHeight(this.siblingWidgets[x].containerNode,height);
}
dojo.style.setOuterHeight(this.containerNode,height);
},
onLabelClick: function() {
this.setSizes();
if (!this.open) {
for (var x=0; x<this.siblingWidgets.length;x++) {
if (this.siblingWidgets[x].open) {
this.siblingWidgets[x].collapse();
}
}
this.expand();
} else {
if (this.allowCollapse) {
this.collapse();
}
}
}
});
dojo.widget.tags.addParseTreeHandler("dojo:AccordionPane");
dojo.provide("dojo.widget.html.AccordionPane");
dojo.require("dojo.widget.TitlePane");
dojo.widget.html.AccordionPane = function(){
dojo.widget.html.TitlePane.call(this);
this.widgetType = "AccordionPane";
this.open=false;
this.allowCollapse=true;
this.label="";
this.open=false;
this.labelNodeClass="";
this.containerNodeClass="";
}
dojo.inherits(dojo.widget.html.AccordionPane, dojo.widget.html.TitlePane);
dojo.lang.extend(dojo.widget.html.AccordionPane, {
postCreate: function() {
dojo.widget.html.AccordionPane.superclass.postCreate.call(this);
this.domNode.widgetType=this.widgetType;
this.setSizes();
dojo.html.addClass(this.labelNode, this.labelNodeClass);
dojo.html.disableSelection(this.labelNode);
dojo.html.addClass(this.containerNode, this.containerNodeClass);
},
collapse: function() {
//dojo.fx.html.wipeOut(this.containerNode,250);
//var anim = dojo.fx.html.wipe(this.containerNode, 1000, this.containerNode.offsetHeight, 0, null, true);
this.containerNode.style.display="none";
this.open=false;
},
expand: function() {
//dojo.fx.html.wipeIn(this.containerNode,250);
this.containerNode.style.display="block";
//var anim = dojo.fx.html.wipe(this.containerNode, 1000, 0, this.containerNode.scrollHeight, null, true);
this.open=true;
},
getCollapsedHeight: function() {
return dojo.style.getOuterHeight(this.labelNode)+1;
},
setSizes: function() {
var siblings = this.domNode.parentNode.childNodes;
var height=dojo.style.getInnerHeight(this.domNode.parentNode)-this.getCollapsedHeight();
this.siblingWidgets = [];
for (var x=0; x<siblings.length; x++) {
if (siblings[x].widgetType==this.widgetType) {
if (this.domNode != siblings[x]) {
var ap = dojo.widget.byNode(siblings[x]);
this.siblingWidgets.push(ap);
height -= ap.getCollapsedHeight();
}
}
}
for (var x=0; x<this.siblingWidgets.length; x++) {
dojo.style.setOuterHeight(this.siblingWidgets[x].containerNode,height);
}
dojo.style.setOuterHeight(this.containerNode,height);
},
onLabelClick: function() {
this.setSizes();
if (!this.open) {
for (var x=0; x<this.siblingWidgets.length;x++) {
if (this.siblingWidgets[x].open) {
this.siblingWidgets[x].collapse();
}
}
this.expand();
} else {
if (this.allowCollapse) {
this.collapse();
}
}
}
});
dojo.widget.tags.addParseTreeHandler("dojo:AccordionPane");

View file

@ -8,18 +8,18 @@
http://dojotoolkit.org/community/licensing.shtml
*/
// this is a stub that will be removed in 0.4, see ../Button2.html for details
dojo.provide("dojo.widget.html.Button2");
dojo.widget.html.Button2 = function(){}
dojo.inherits(dojo.widget.html.Button2, dojo.widget.html.Button);
dojo.lang.extend(dojo.widget.html.Button2, { widgetType: "Button2" });
dojo.widget.html.DropDownButton2 = function(){}
dojo.inherits(dojo.widget.html.DropDownButton2, dojo.widget.html.DropDownButton);
dojo.lang.extend(dojo.widget.html.DropDownButton2, { widgetType: "DropDownButton2" });
dojo.widget.html.ComboButton2 = function(){}
dojo.inherits(dojo.widget.html.ComboButton2, dojo.widget.html.ComboButton);
// this is a stub that will be removed in 0.4, see ../Button2.html for details
dojo.provide("dojo.widget.html.Button2");
dojo.widget.html.Button2 = function(){}
dojo.inherits(dojo.widget.html.Button2, dojo.widget.html.Button);
dojo.lang.extend(dojo.widget.html.Button2, { widgetType: "Button2" });
dojo.widget.html.DropDownButton2 = function(){}
dojo.inherits(dojo.widget.html.DropDownButton2, dojo.widget.html.DropDownButton);
dojo.lang.extend(dojo.widget.html.DropDownButton2, { widgetType: "DropDownButton2" });
dojo.widget.html.ComboButton2 = function(){}
dojo.inherits(dojo.widget.html.ComboButton2, dojo.widget.html.ComboButton);
dojo.lang.extend(dojo.widget.html.ComboButton2, { widgetType: "ComboButton2" });

View file

@ -8,24 +8,24 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.html.DebugConsole");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.FloatingPane");
dojo.widget.html.DebugConsole= function(){
dojo.widget.html.FloatingPane.call(this);
dojo.widget.DebugConsole.call(this);
}
dojo.inherits(dojo.widget.html.DebugConsole, dojo.widget.html.FloatingPane);
dojo.lang.extend(dojo.widget.html.DebugConsole, {
fillInTemplate: function() {
dojo.widget.html.DebugConsole.superclass.fillInTemplate.apply(this, arguments);
this.containerNode.id = "debugConsoleClientPane";
djConfig.isDebug = true;
djConfig.debugContainerId = this.containerNode.id;
}
});
dojo.provide("dojo.widget.html.DebugConsole");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.FloatingPane");
dojo.widget.html.DebugConsole= function(){
dojo.widget.html.FloatingPane.call(this);
dojo.widget.DebugConsole.call(this);
}
dojo.inherits(dojo.widget.html.DebugConsole, dojo.widget.html.FloatingPane);
dojo.lang.extend(dojo.widget.html.DebugConsole, {
fillInTemplate: function() {
dojo.widget.html.DebugConsole.superclass.fillInTemplate.apply(this, arguments);
this.containerNode.id = "debugConsoleClientPane";
djConfig.isDebug = true;
djConfig.debugContainerId = this.containerNode.id;
}
});

View file

@ -8,181 +8,181 @@
http://dojotoolkit.org/community/licensing.shtml
*/
/* TODO:
* - make the dropdown "smart" so it can't get cutoff on bottom of page, sides of page, etc.
*/
dojo.provide("dojo.widget.html.DropdownButton");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.dom");
dojo.require("dojo.style");
dojo.require("dojo.html");
dojo.widget.html.DropdownButton = function() {
// mix in the button properties
dojo.widget.DropdownButton.call(this);
dojo.widget.HtmlWidget.call(this);
}
dojo.inherits(dojo.widget.html.DropdownButton, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.html.DropdownButton, {
// In IE, event handlers on objects inside buttons don't work correctly, so
// we just set onClick on the button itself.
templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlDropDownButtonTemplate.html"),
templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlButtonTemplate.css"),
// attach points
button: null,
table: null,
labelCell: null,
borderCell: null,
arrowCell: null,
arrow: null,
fillInTemplate: function(args, frag) {
// input data (containing the anchor for the button itself, plus the
// thing to display when you push the down arrow)
var input = frag["dojo:"+this.widgetType.toLowerCase()]["nodeRef"];
// Recursively expand widgets inside of the <dojo:dropdownButton>
var parser = new dojo.xml.Parse();
var frag = parser.parseElement(input, null, true);
var ary = dojo.widget.getParser().createComponents(frag);
this.a = dojo.dom.getFirstChildElement(input); // the button contents
this.menu = dojo.dom.getNextSiblingElement(this.a); // the menu under the button
this.disabled = dojo.html.hasClass(this.a, "disabled");
if( this.disabled ) {
dojo.html.addClass(this.button, "dojoDisabled");
this.domNode.setAttribute("disabled", "true");
}
dojo.html.disableSelection(this.a);
this.a.style["text-decoration"]="none";
this.labelCell.appendChild(this.a);
this.arrow.src =
dojo.uri.dojoUri("src/widget/templates/images/dropdownButtonsArrow" +
(this.disabled ? "-disabled" : "") + ".gif");
// Attach menu to body so that it appears above other buttons
this.menu.style.position="absolute";
this.menu.style.display="none";
this.menu.style["z-index"] = 99;
document.body.appendChild(this.menu);
},
postCreate: function() {
if ( dojo.render.html.ie ) {
// Compensate for IE's weird padding of button content, which seems to be relative
// to the length of the content
var contentWidth = dojo.style.getOuterWidth(this.table);
this.labelCell.style["left"] = "-" + (contentWidth / 10) + "px";
this.arrowCell.style["left"] = (contentWidth / 10) + "px";
}
// Make menu at least as wide as the button
var buttonWidth = dojo.style.getOuterWidth(this.button);
var menuWidth = dojo.style.getOuterWidth(this.menu);
if ( buttonWidth > menuWidth ) {
dojo.style.setOuterWidth(this.menu, buttonWidth);
}
},
// If someone clicks anywhere else on the screen (including another menu),
// then close this menu.
onCanvasMouseDown: function(e) {
if( !dojo.dom.isDescendantOf(e.target, this.button) &&
!dojo.dom.isDescendantOf(e.target, this.menu) ) {
this.hideMenu();
}
},
eventWasOverArrow: function(e) {
// want to use dojo.html.overElement() but also need to detect clicks
// on the area between the arrow and the edge of the button
var eventX = e.clientX;
var borderX = dojo.style.totalOffsetLeft(this.borderCell);
return (eventX > borderX );
},
onMouseOver: function(e) {
dojo.html.addClass(this.button, "dojoButtonHover");
dojo.html.removeClass(this.button, "dojoButtonNoHover");
},
onMouseOut: function(e) {
dojo.html.removeClass(this.button, "dojoButtonHover");
dojo.html.addClass(this.button, "dojoButtonNoHover");
},
onClick: function(e) {
if ( this.eventWasOverArrow(e) ) {
this._onClickArrow();
} else {
this._onClickButton();
}
},
// Action when the user presses the button
_onClickButton: function(e) {
if ( this.a ) {
if ( this.a.click ) {
this.a.click();
} else if ( this.a.href ) {
location.href = this.a.href;
}
}
},
// Action when user presses the arrow
_onClickArrow: function() {
if ( this.menu.style.display == "none" ) {
this.showMenu();
} else {
this.hideMenu();
}
},
showMenu: function() {
if ( this.disabled )
return;
// Position it accordingly, relative to screen root (since
// it's attached to document.body)
this.menu.style.left = dojo.style.totalOffsetLeft(this.button) + "px";
this.menu.style.top = dojo.style.totalOffsetTop(this.button) + dojo.style.getOuterHeight(this.button) + "px";
// Display the menu; do this funky code below to stop the menu from extending
// all the way to the right edge of the screen.
// TODO: retest simple display="" to confirm that it doesn't work.
try {
this.menu.style.display="table"; // mozilla
} catch(e) {
this.menu.style.display="block"; // IE
}
// If someone clicks somewhere else on the screen then close the menu
dojo.event.connect(document.documentElement, "onmousedown", this, "onCanvasMouseDown");
// When someone clicks the menu, after the menu handles the event,
// close the menu (be careful not to close the menu too early or else
// the menu will never receive the event.)
dojo.event.connect(this.menu, "onclick", this, "hideMenu");
},
hideMenu: function() {
this.menu.style.display = "none";
dojo.event.disconnect(document.documentElement, "onmousedown", this, "onCanvasMouseDown");
dojo.event.disconnect(this.menu, "onclick", this, "hideMenu");
}
});
/* TODO:
* - make the dropdown "smart" so it can't get cutoff on bottom of page, sides of page, etc.
*/
dojo.provide("dojo.widget.html.DropdownButton");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.dom");
dojo.require("dojo.style");
dojo.require("dojo.html");
dojo.widget.html.DropdownButton = function() {
// mix in the button properties
dojo.widget.DropdownButton.call(this);
dojo.widget.HtmlWidget.call(this);
}
dojo.inherits(dojo.widget.html.DropdownButton, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.html.DropdownButton, {
// In IE, event handlers on objects inside buttons don't work correctly, so
// we just set onClick on the button itself.
templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlDropDownButtonTemplate.html"),
templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlButtonTemplate.css"),
// attach points
button: null,
table: null,
labelCell: null,
borderCell: null,
arrowCell: null,
arrow: null,
fillInTemplate: function(args, frag) {
// input data (containing the anchor for the button itself, plus the
// thing to display when you push the down arrow)
var input = frag["dojo:"+this.widgetType.toLowerCase()]["nodeRef"];
// Recursively expand widgets inside of the <dojo:dropdownButton>
var parser = new dojo.xml.Parse();
var frag = parser.parseElement(input, null, true);
var ary = dojo.widget.getParser().createComponents(frag);
this.a = dojo.dom.getFirstChildElement(input); // the button contents
this.menu = dojo.dom.getNextSiblingElement(this.a); // the menu under the button
this.disabled = dojo.html.hasClass(this.a, "disabled");
if( this.disabled ) {
dojo.html.addClass(this.button, "dojoDisabled");
this.domNode.setAttribute("disabled", "true");
}
dojo.html.disableSelection(this.a);
this.a.style["text-decoration"]="none";
this.labelCell.appendChild(this.a);
this.arrow.src =
dojo.uri.dojoUri("src/widget/templates/images/dropdownButtonsArrow" +
(this.disabled ? "-disabled" : "") + ".gif");
// Attach menu to body so that it appears above other buttons
this.menu.style.position="absolute";
this.menu.style.display="none";
this.menu.style["z-index"] = 99;
document.body.appendChild(this.menu);
},
postCreate: function() {
if ( dojo.render.html.ie ) {
// Compensate for IE's weird padding of button content, which seems to be relative
// to the length of the content
var contentWidth = dojo.style.getOuterWidth(this.table);
this.labelCell.style["left"] = "-" + (contentWidth / 10) + "px";
this.arrowCell.style["left"] = (contentWidth / 10) + "px";
}
// Make menu at least as wide as the button
var buttonWidth = dojo.style.getOuterWidth(this.button);
var menuWidth = dojo.style.getOuterWidth(this.menu);
if ( buttonWidth > menuWidth ) {
dojo.style.setOuterWidth(this.menu, buttonWidth);
}
},
// If someone clicks anywhere else on the screen (including another menu),
// then close this menu.
onCanvasMouseDown: function(e) {
if( !dojo.dom.isDescendantOf(e.target, this.button) &&
!dojo.dom.isDescendantOf(e.target, this.menu) ) {
this.hideMenu();
}
},
eventWasOverArrow: function(e) {
// want to use dojo.html.overElement() but also need to detect clicks
// on the area between the arrow and the edge of the button
var eventX = e.clientX;
var borderX = dojo.style.totalOffsetLeft(this.borderCell);
return (eventX > borderX );
},
onMouseOver: function(e) {
dojo.html.addClass(this.button, "dojoButtonHover");
dojo.html.removeClass(this.button, "dojoButtonNoHover");
},
onMouseOut: function(e) {
dojo.html.removeClass(this.button, "dojoButtonHover");
dojo.html.addClass(this.button, "dojoButtonNoHover");
},
onClick: function(e) {
if ( this.eventWasOverArrow(e) ) {
this._onClickArrow();
} else {
this._onClickButton();
}
},
// Action when the user presses the button
_onClickButton: function(e) {
if ( this.a ) {
if ( this.a.click ) {
this.a.click();
} else if ( this.a.href ) {
location.href = this.a.href;
}
}
},
// Action when user presses the arrow
_onClickArrow: function() {
if ( this.menu.style.display == "none" ) {
this.showMenu();
} else {
this.hideMenu();
}
},
showMenu: function() {
if ( this.disabled )
return;
// Position it accordingly, relative to screen root (since
// it's attached to document.body)
this.menu.style.left = dojo.style.totalOffsetLeft(this.button) + "px";
this.menu.style.top = dojo.style.totalOffsetTop(this.button) + dojo.style.getOuterHeight(this.button) + "px";
// Display the menu; do this funky code below to stop the menu from extending
// all the way to the right edge of the screen.
// TODO: retest simple display="" to confirm that it doesn't work.
try {
this.menu.style.display="table"; // mozilla
} catch(e) {
this.menu.style.display="block"; // IE
}
// If someone clicks somewhere else on the screen then close the menu
dojo.event.connect(document.documentElement, "onmousedown", this, "onCanvasMouseDown");
// When someone clicks the menu, after the menu handles the event,
// close the menu (be careful not to close the menu too early or else
// the menu will never receive the event.)
dojo.event.connect(this.menu, "onclick", this, "hideMenu");
},
hideMenu: function() {
this.menu.style.display = "none";
dojo.event.disconnect(document.documentElement, "onmousedown", this, "onCanvasMouseDown");
dojo.event.disconnect(this.menu, "onclick", this, "hideMenu");
}
});

View file

@ -8,191 +8,191 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.html.GoogleMap");
dojo.require("dojo.event.*");
dojo.require("dojo.html");
dojo.require("dojo.math");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.GoogleMap");
(function(){
var gkey = djConfig["gMapKey"]||djConfig["googleMapKey"];
// the Google API key mechanism sucks. We're hardcoding here for love and affection but I don't like it.
var uri=new dojo.uri.Uri(window.location.href);
if(uri.host=="www.dojotoolkit.org"){
gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hRqjp7ri2mNiOEYqetD3xnFHpt5rBSjszDd1sdufPyQKUTyCf_YxoIxvw";
}
else if(uri.host=="blog.dojotoolkit.org"){
gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hSkep6Av1xaMhVn3yCLkorJeXeLARQ6fammI_P3qSGleTJhoI5_1JmP_Q";
}
else if(uri.host=="archive.dojotoolkit.org"){
gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hTaQpDt0dyGLIHbXMPTzg1kWeAfwRTwZNyrUfbfxYE9yIvRivEjcXoDTg";
}
else if(uri.host=="dojotoolkit.org"){
gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hSaOaO_TgJ5c3mtQFnk5JO2zD5dZBRZk-ieqVs7BORREYNzAERmcJoEjQ";
}
if(!dojo.hostenv.post_load_){
var tag = "<scr"+"ipt src='http://maps.google.com/maps?file=api&amp;v=2&amp;key="+gkey+"'></scri"+"pt>";
if(!dj_global["GMap2"]){ // prevent multi-inclusion
document.write(tag);
}
}else{
dojo.debug("cannot initialize map system after the page has been loaded! Please either manually include the script block provided by Google in your page or require() the GoogleMap widget before onload has fired");
}
})();
dojo.widget.html.GoogleMap=function(){
dojo.widget.HtmlWidget.call(this);
dojo.widget.GoogleMap.call(this);
var gm=dojo.widget.GoogleMap;
this.map=null;
this.data=[];
this.datasrc="";
// FIXME: this is pehraps the stupidest way to specify this enum I can think of
this.controls=[gm.Controls.LargeMap,gm.Controls.Scale,gm.Controls.MapType];
};
dojo.inherits(dojo.widget.html.GoogleMap, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.html.GoogleMap, {
templatePath:null,
templateCssPath:null,
setControls:function(){
var c=dojo.widget.GoogleMap.Controls;
for(var i=0; i<this.controls.length; i++){
var type=this.controls[i];
switch(type){
case c.LargeMap:{
this.map.addControl(new GLargeMapControl());
break;
}
case c.SmallMap:{
this.map.addControl(new GSmallMapControl());
break;
}
case c.SmallZoom:{
this.map.addControl(new GSmallZoomControl());
break;
}
case c.Scale:{
this.map.addControl(new GScaleControl());
break;
}
case c.MapType:{
this.map.addControl(new GMapTypeControl());
break;
}
case c.Overview:{
this.map.addControl(new GOverviewMapControl());
break;
}
default:{
break;
}
}
}
},
findCenter:function(bounds){
var clat=(bounds.getNorthEast().lat()+bounds.getSouthWest().lat())/2;
var clng=(bounds.getNorthEast().lng()+bounds.getSouthWest().lng())/2;
return (new GLatLng(clat,clng));
},
createPinpoint:function(pt,overlay){
var m=new GMarker(pt);
if(overlay){
GEvent.addListener(m,"click",function(){
m.openInfoWindowHtml("<div>"+overlay+"</div>");
});
}
return m;
},
parse:function(table){
this.data=[];
// get the column indices
var h=table.getElementsByTagName("thead")[0];
if(!h){
return;
}
var a=[];
var cols=h.getElementsByTagName("td");
if(cols.length==0){
cols=h.getElementsByTagName("th");
}
for(var i=0; i<cols.length; i++){
var c=cols[i].innerHTML.toLowerCase();
if(c=="long") c="lng";
a.push(c);
}
// parse the data
var b=table.getElementsByTagName("tbody")[0];
if(!b){
return;
}
for(var i=0; i<b.childNodes.length; i++){
if(!(b.childNodes[i].nodeName&&b.childNodes[i].nodeName.toLowerCase()=="tr")){
continue;
}
var cells=b.childNodes[i].getElementsByTagName("td");
var o={};
for(var j=0; j<a.length; j++){
var col=a[j];
if(col=="lat"||col=="lng"){
o[col]=parseFloat(cells[j].innerHTML);
}else{
o[col]=cells[j].innerHTML;
}
}
this.data.push(o);
}
},
render:function(){
var bounds=new GLatLngBounds();
var d=this.data;
var pts=[];
for(var i=0; i<d.length; i++){
bounds.extend(new GLatLng(d[i].lat,d[i].lng));
}
this.map.setCenter(this.findCenter(bounds), this.map.getBoundsZoomLevel(bounds));
for(var i=0; i<this.data.length; i++){
var p=new GLatLng(this.data[i].lat,this.data[i].lng);
var d=this.data[i].description||null;
var m=this.createPinpoint(p,d);
this.map.addOverlay(m);
}
},
initialize:function(args, frag){
if(!GMap2){
dojo.raise("dojo.widget.GoogleMap: The Google Map script must be included (with a proper API key) in order to use this widget.");
}
if(this.datasrc){
this.parse(dojo.byId(this.datasrc));
}
else if(this.domNode.getElementsByTagName("table")[0]){
this.parse(this.domNode.getElementsByTagName("table")[0]);
}
},
postCreate:function(){
// clean the domNode before creating the map.
while(this.domNode.childNodes.length>0){
this.domNode.removeChild(this.domNode.childNodes[0]);
}
this.map=new GMap2(this.domNode);
this.render();
this.setControls();
}
});
dojo.provide("dojo.widget.html.GoogleMap");
dojo.require("dojo.event.*");
dojo.require("dojo.html");
dojo.require("dojo.math");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.GoogleMap");
(function(){
var gkey = djConfig["gMapKey"]||djConfig["googleMapKey"];
// the Google API key mechanism sucks. We're hardcoding here for love and affection but I don't like it.
var uri=new dojo.uri.Uri(window.location.href);
if(uri.host=="www.dojotoolkit.org"){
gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hRqjp7ri2mNiOEYqetD3xnFHpt5rBSjszDd1sdufPyQKUTyCf_YxoIxvw";
}
else if(uri.host=="blog.dojotoolkit.org"){
gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hSkep6Av1xaMhVn3yCLkorJeXeLARQ6fammI_P3qSGleTJhoI5_1JmP_Q";
}
else if(uri.host=="archive.dojotoolkit.org"){
gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hTaQpDt0dyGLIHbXMPTzg1kWeAfwRTwZNyrUfbfxYE9yIvRivEjcXoDTg";
}
else if(uri.host=="dojotoolkit.org"){
gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hSaOaO_TgJ5c3mtQFnk5JO2zD5dZBRZk-ieqVs7BORREYNzAERmcJoEjQ";
}
if(!dojo.hostenv.post_load_){
var tag = "<scr"+"ipt src='http://maps.google.com/maps?file=api&amp;v=2&amp;key="+gkey+"'></scri"+"pt>";
if(!dj_global["GMap2"]){ // prevent multi-inclusion
document.write(tag);
}
}else{
dojo.debug("cannot initialize map system after the page has been loaded! Please either manually include the script block provided by Google in your page or require() the GoogleMap widget before onload has fired");
}
})();
dojo.widget.html.GoogleMap=function(){
dojo.widget.HtmlWidget.call(this);
dojo.widget.GoogleMap.call(this);
var gm=dojo.widget.GoogleMap;
this.map=null;
this.data=[];
this.datasrc="";
// FIXME: this is pehraps the stupidest way to specify this enum I can think of
this.controls=[gm.Controls.LargeMap,gm.Controls.Scale,gm.Controls.MapType];
};
dojo.inherits(dojo.widget.html.GoogleMap, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.html.GoogleMap, {
templatePath:null,
templateCssPath:null,
setControls:function(){
var c=dojo.widget.GoogleMap.Controls;
for(var i=0; i<this.controls.length; i++){
var type=this.controls[i];
switch(type){
case c.LargeMap:{
this.map.addControl(new GLargeMapControl());
break;
}
case c.SmallMap:{
this.map.addControl(new GSmallMapControl());
break;
}
case c.SmallZoom:{
this.map.addControl(new GSmallZoomControl());
break;
}
case c.Scale:{
this.map.addControl(new GScaleControl());
break;
}
case c.MapType:{
this.map.addControl(new GMapTypeControl());
break;
}
case c.Overview:{
this.map.addControl(new GOverviewMapControl());
break;
}
default:{
break;
}
}
}
},
findCenter:function(bounds){
var clat=(bounds.getNorthEast().lat()+bounds.getSouthWest().lat())/2;
var clng=(bounds.getNorthEast().lng()+bounds.getSouthWest().lng())/2;
return (new GLatLng(clat,clng));
},
createPinpoint:function(pt,overlay){
var m=new GMarker(pt);
if(overlay){
GEvent.addListener(m,"click",function(){
m.openInfoWindowHtml("<div>"+overlay+"</div>");
});
}
return m;
},
parse:function(table){
this.data=[];
// get the column indices
var h=table.getElementsByTagName("thead")[0];
if(!h){
return;
}
var a=[];
var cols=h.getElementsByTagName("td");
if(cols.length==0){
cols=h.getElementsByTagName("th");
}
for(var i=0; i<cols.length; i++){
var c=cols[i].innerHTML.toLowerCase();
if(c=="long") c="lng";
a.push(c);
}
// parse the data
var b=table.getElementsByTagName("tbody")[0];
if(!b){
return;
}
for(var i=0; i<b.childNodes.length; i++){
if(!(b.childNodes[i].nodeName&&b.childNodes[i].nodeName.toLowerCase()=="tr")){
continue;
}
var cells=b.childNodes[i].getElementsByTagName("td");
var o={};
for(var j=0; j<a.length; j++){
var col=a[j];
if(col=="lat"||col=="lng"){
o[col]=parseFloat(cells[j].innerHTML);
}else{
o[col]=cells[j].innerHTML;
}
}
this.data.push(o);
}
},
render:function(){
var bounds=new GLatLngBounds();
var d=this.data;
var pts=[];
for(var i=0; i<d.length; i++){
bounds.extend(new GLatLng(d[i].lat,d[i].lng));
}
this.map.setCenter(this.findCenter(bounds), this.map.getBoundsZoomLevel(bounds));
for(var i=0; i<this.data.length; i++){
var p=new GLatLng(this.data[i].lat,this.data[i].lng);
var d=this.data[i].description||null;
var m=this.createPinpoint(p,d);
this.map.addOverlay(m);
}
},
initialize:function(args, frag){
if(!GMap2){
dojo.raise("dojo.widget.GoogleMap: The Google Map script must be included (with a proper API key) in order to use this widget.");
}
if(this.datasrc){
this.parse(dojo.byId(this.datasrc));
}
else if(this.domNode.getElementsByTagName("table")[0]){
this.parse(this.domNode.getElementsByTagName("table")[0]);
}
},
postCreate:function(){
// clean the domNode before creating the map.
while(this.domNode.childNodes.length>0){
this.domNode.removeChild(this.domNode.childNodes[0]);
}
this.map=new GMap2(this.domNode);
this.render();
this.setControls();
}
});

View file

@ -8,47 +8,47 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.LinkPane");
dojo.provide("dojo.widget.html.LinkPane");
//
// a div that loads from a URL. (Similar to an iframe, but
// it's in the same environment as the main window)
//
dojo.require("dojo.widget.LinkPane");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.html");
dojo.require("dojo.style");
dojo.require("dojo.dom");
dojo.require("dojo.string");
dojo.widget.html.LinkPane = function(){
dojo.widget.html.ContentPane.call(this);
}
dojo.inherits(dojo.widget.html.LinkPane, dojo.widget.html.ContentPane);
dojo.lang.extend(dojo.widget.html.LinkPane, {
widgetType: "LinkPane",
// I'm using a template because the user may specify the input as
// <a href="foo.html">label</a>, in which case we need to get rid of the
// <a> because we don't want a link.
templateString: '<div class="dojoLinkPane"></div>',
fillInTemplate: function(args, frag){
var source = this.getFragNodeRef(frag);
// If user has specified node contents, they become the label
// (the link must be plain text)
this.label += source.innerHTML;
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
}
});
dojo.provide("dojo.widget.LinkPane");
dojo.provide("dojo.widget.html.LinkPane");
//
// a div that loads from a URL. (Similar to an iframe, but
// it's in the same environment as the main window)
//
dojo.require("dojo.widget.LinkPane");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.html");
dojo.require("dojo.style");
dojo.require("dojo.dom");
dojo.require("dojo.string");
dojo.widget.html.LinkPane = function(){
dojo.widget.html.ContentPane.call(this);
}
dojo.inherits(dojo.widget.html.LinkPane, dojo.widget.html.ContentPane);
dojo.lang.extend(dojo.widget.html.LinkPane, {
widgetType: "LinkPane",
// I'm using a template because the user may specify the input as
// <a href="foo.html">label</a>, in which case we need to get rid of the
// <a> because we don't want a link.
templateString: '<div class="dojoLinkPane"></div>',
fillInTemplate: function(args, frag){
var source = this.getFragNodeRef(frag);
// If user has specified node contents, they become the label
// (the link must be plain text)
this.label += source.innerHTML;
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
}
});

View file

@ -8,78 +8,78 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.html.TaskBar");
dojo.provide("dojo.widget.html.TaskBarItem");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.FloatingPane");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.event");
// Icon associated w/a floating pane
dojo.widget.html.TaskBarItem = function(){
dojo.widget.TaskBarItem.call(this);
dojo.widget.HtmlWidget.call(this);
}
dojo.inherits(dojo.widget.html.TaskBarItem, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.html.TaskBarItem, {
// constructor arguments
iconSrc: '',
caption: 'Untitled',
window: null,
templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlTaskBarItemTemplate.html"),
templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlTaskBar.css"),
fillInTemplate: function() {
if ( this.iconSrc != '' ) {
var img = document.createElement("img");
img.src = this.iconSrc;
this.domNode.appendChild(img);
}
this.domNode.appendChild(document.createTextNode(this.caption));
dojo.html.disableSelection(this.domNode);
},
postCreate: function() {
this.window=dojo.widget.getWidgetById(this.windowId);
this.window.explodeSrc = this.domNode;
dojo.event.connect(this.window, "destroy", this, "destroy")
},
onClick: function() {
this.window.show();
}
});
// Collection of widgets in a bar, like Windows task bar
dojo.widget.html.TaskBar = function(){
dojo.widget.html.FloatingPane.call(this);
dojo.widget.TaskBar.call(this);
this._addChildStack = [];
}
dojo.inherits(dojo.widget.html.TaskBar, dojo.widget.html.FloatingPane);
dojo.lang.extend(dojo.widget.html.TaskBar, {
resizable: false,
titleBarDisplay: "none",
addChild: function(child) {
if(!this.containerNode){
this._addChildStack.push(child);
}else if(this._addChildStack.length > 0){
var oarr = this._addChildStack;
this._addChildStack = [];
dojo.lang.forEach(oarr, this.addChild, this);
}
var tbi = dojo.widget.createWidget("TaskBarItem",
{ windowId: child.widgetId,
caption: child.title,
iconSrc: child.iconSrc
});
dojo.widget.html.TaskBar.superclass.addChild.call(this,tbi);
}
});
dojo.provide("dojo.widget.html.TaskBar");
dojo.provide("dojo.widget.html.TaskBarItem");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.FloatingPane");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.event");
// Icon associated w/a floating pane
dojo.widget.html.TaskBarItem = function(){
dojo.widget.TaskBarItem.call(this);
dojo.widget.HtmlWidget.call(this);
}
dojo.inherits(dojo.widget.html.TaskBarItem, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.html.TaskBarItem, {
// constructor arguments
iconSrc: '',
caption: 'Untitled',
window: null,
templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlTaskBarItemTemplate.html"),
templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlTaskBar.css"),
fillInTemplate: function() {
if ( this.iconSrc != '' ) {
var img = document.createElement("img");
img.src = this.iconSrc;
this.domNode.appendChild(img);
}
this.domNode.appendChild(document.createTextNode(this.caption));
dojo.html.disableSelection(this.domNode);
},
postCreate: function() {
this.window=dojo.widget.getWidgetById(this.windowId);
this.window.explodeSrc = this.domNode;
dojo.event.connect(this.window, "destroy", this, "destroy")
},
onClick: function() {
this.window.show();
}
});
// Collection of widgets in a bar, like Windows task bar
dojo.widget.html.TaskBar = function(){
dojo.widget.html.FloatingPane.call(this);
dojo.widget.TaskBar.call(this);
this._addChildStack = [];
}
dojo.inherits(dojo.widget.html.TaskBar, dojo.widget.html.FloatingPane);
dojo.lang.extend(dojo.widget.html.TaskBar, {
resizable: false,
titleBarDisplay: "none",
addChild: function(child) {
if(!this.containerNode){
this._addChildStack.push(child);
}else if(this._addChildStack.length > 0){
var oarr = this._addChildStack;
this._addChildStack = [];
dojo.lang.forEach(oarr, this.addChild, this);
}
var tbi = dojo.widget.createWidget("TaskBarItem",
{ windowId: child.widgetId,
caption: child.title,
iconSrc: child.iconSrc
});
dojo.widget.html.TaskBar.superclass.addChild.call(this,tbi);
}
});

View file

@ -8,63 +8,63 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.html.TitlePane");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.lfx.*");
dojo.widget.html.TitlePane = function(){
dojo.widget.HtmlWidget.call(this);
this.widgetType = "TitlePane";
this.labelNode="";
this.labelNodeClass="";
this.containerNodeClass="";
this.label="";
this.open=true;
this.templatePath = dojo.uri.dojoUri("src/widget/templates/TitlePane.html");
}
dojo.inherits(dojo.widget.html.TitlePane, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.html.TitlePane, {
isContainer: true,
postCreate: function() {
if (this.label) {
this.labelNode.appendChild(document.createTextNode(this.label));
}
if (this.labelNodeClass) {
dojo.html.addClass(this.labelNode, this.labelNodeClass);
}
if (this.containerNodeClass) {
dojo.html.addClass(this.containerNode, this.containerNodeClass);
}
if (!this.open) {
dojo.lfx.wipeOut(this.containerNode,0).play();
}
},
onLabelClick: function() {
if (this.open) {
dojo.lfx.wipeOut(this.containerNode,250).play();
this.open=false;
}else {
dojo.lfx.wipeIn(this.containerNode,250).play();
this.open=true;
}
},
setContent: function(content) {
this.containerNode.innerHTML=content;
},
setLabel: function(label) {
this.labelNode.innerHTML=label;
}
});
dojo.widget.tags.addParseTreeHandler("dojo:TitlePane");
dojo.provide("dojo.widget.html.TitlePane");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.lfx.*");
dojo.widget.html.TitlePane = function(){
dojo.widget.HtmlWidget.call(this);
this.widgetType = "TitlePane";
this.labelNode="";
this.labelNodeClass="";
this.containerNodeClass="";
this.label="";
this.open=true;
this.templatePath = dojo.uri.dojoUri("src/widget/templates/TitlePane.html");
}
dojo.inherits(dojo.widget.html.TitlePane, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.html.TitlePane, {
isContainer: true,
postCreate: function() {
if (this.label) {
this.labelNode.appendChild(document.createTextNode(this.label));
}
if (this.labelNodeClass) {
dojo.html.addClass(this.labelNode, this.labelNodeClass);
}
if (this.containerNodeClass) {
dojo.html.addClass(this.containerNode, this.containerNodeClass);
}
if (!this.open) {
dojo.lfx.wipeOut(this.containerNode,0).play();
}
},
onLabelClick: function() {
if (this.open) {
dojo.lfx.wipeOut(this.containerNode,250).play();
this.open=false;
}else {
dojo.lfx.wipeIn(this.containerNode,250).play();
this.open=true;
}
},
setContent: function(content) {
this.containerNode.innerHTML=content;
},
setLabel: function(label) {
this.labelNode.innerHTML=label;
}
});
dojo.widget.tags.addParseTreeHandler("dojo:TitlePane");

View file

@ -8,176 +8,176 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.html.Tooltip");
dojo.require("dojo.widget.html.ContentPane");
dojo.require("dojo.widget.Tooltip");
dojo.require("dojo.uri");
dojo.require("dojo.widget.*");
dojo.require("dojo.event");
dojo.require("dojo.style");
dojo.require("dojo.html");
dojo.widget.defineWidget(
"dojo.widget.html.Tooltip",
dojo.widget.html.ContentPane,
{
widgetType: "Tooltip",
isContainer: true,
// Constructor arguments
caption: "",
showDelay: 500,
hideDelay: 100,
connectId: "",
templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlTooltipTemplate.html"),
templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlTooltipTemplate.css"),
connectNode: null,
// Tooltip has the following possible states:
// erased - nothing on screen
// displaying - currently being faded in (partially displayed)
// displayed - fully displayed
// erasing - currently being faded out (partially erased)
state: "erased",
fillInTemplate: function(args, frag){
if(this.caption != ""){
this.domNode.appendChild(document.createTextNode(this.caption));
}
this.connectNode = dojo.byId(this.connectId);
dojo.widget.html.Tooltip.superclass.fillInTemplate.call(this, args, frag);
},
postCreate: function(args, frag){
// The domnode was appended to my parent widget's domnode, but the positioning
// only works if the domnode is a child of document.body
document.body.appendChild(this.domNode);
dojo.event.connect(this.connectNode, "onmouseover", this, "onMouseOver");
dojo.widget.html.Tooltip.superclass.postCreate.call(this, args, frag);
},
onMouseOver: function(e) {
this.mouse = {x: e.pageX, y: e.pageY};
if(!this.showTimer){
this.showTimer = setTimeout(dojo.lang.hitch(this, "show"), this.showDelay);
dojo.event.connect(document.documentElement, "onmousemove", this, "onMouseMove");
}
},
onMouseMove: function(e) {
this.mouse = {x: e.pageX, y: e.pageY};
if(dojo.html.overElement(this.connectNode, e) || dojo.html.overElement(this.domNode, e)) {
// If the tooltip has been scheduled to be erased, cancel that timer
// since we are hovering over element/tooltip again
if(this.hideTimer) {
clearTimeout(this.hideTimer);
delete this.hideTimer;
}
} else {
// mouse has been moved off the element/tooltip
// note: can't use onMouseOut to detect this because the "explode" effect causes
// spurious onMouseOut/onMouseOver events (due to interference from outline)
if(this.showTimer){
clearTimeout(this.showTimer);
delete this.showTimer;
}
if((this.state=="displaying"||this.state=="displayed") && !this.hideTimer){
this.hideTimer = setTimeout(dojo.lang.hitch(this, "hide"), this.hideDelay);
}
}
},
show: function() {
if(this.state=="erasing"){
// we are in the process of erasing; when that is finished, display it.
this.displayScheduled=true;
return;
}
if ( this.state=="displaying" || this.state=="displayed" ) { return; }
// prevent IE bleed through (iframe creation is deferred until first show()
// call because apparently it takes a long time)
if(!this.bgIframe){
this.bgIframe = new dojo.html.BackgroundIframe(this.domNode);
}
this.position();
// if rendering using explosion effect, need to set explosion source
this.explodeSrc = [this.mouse.x, this.mouse.y];
this.state="displaying";
dojo.widget.html.Tooltip.superclass.show.call(this);
},
onShow: function() {
dojo.widget.html.Tooltip.superclass.onShow.call(this);
this.state="displayed";
// in the corner case where the user has moved his mouse away
// while the tip was fading in
if(this.eraseScheduled){
this.hide();
this.eraseScheduled=false;
}
},
hide: function() {
if(this.state=="displaying"){
// in the process of fading in. wait until that is finished and then fade out
this.eraseScheduled=true;
return;
}
if ( this.state=="displayed" ) {
this.state="erasing";
if ( this.showTimer ) {
clearTimeout(this.showTimer);
delete this.showTimer;
}
if ( this.hideTimer ) {
clearTimeout(this.hideTimer);
delete this.hideTimer;
}
dojo.event.disconnect(document.documentElement, "onmousemove", this, "onMouseMove");
dojo.widget.html.Tooltip.superclass.hide.call(this);
}
},
onHide: function(){
this.state="erased";
// in the corner case where the user has moved his mouse back
// while the tip was fading out
if(this.displayScheduled){
this.display();
this.displayScheduled=false;
}
},
position: function(){
dojo.html.placeOnScreenPoint(this.domNode, this.mouse.x, this.mouse.y, [10,15], true);
this.bgIframe.onResized();
},
onLoad: function(){
if(this.isShowing()){
// the tooltip has changed size due to downloaded contents, so reposition it
dojo.lang.setTimeout(this, this.position, 50);
dojo.widget.html.Tooltip.superclass.onLoad.apply(this, arguments);
}
},
checkSize: function() {
// checkSize() is called when the user has resized the browser window,
// but that doesn't affect this widget (or this widget's children)
// so it can be safely ignored
}
}
);
dojo.provide("dojo.widget.html.Tooltip");
dojo.require("dojo.widget.html.ContentPane");
dojo.require("dojo.widget.Tooltip");
dojo.require("dojo.uri");
dojo.require("dojo.widget.*");
dojo.require("dojo.event");
dojo.require("dojo.style");
dojo.require("dojo.html");
dojo.widget.defineWidget(
"dojo.widget.html.Tooltip",
dojo.widget.html.ContentPane,
{
widgetType: "Tooltip",
isContainer: true,
// Constructor arguments
caption: "",
showDelay: 500,
hideDelay: 100,
connectId: "",
templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlTooltipTemplate.html"),
templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlTooltipTemplate.css"),
connectNode: null,
// Tooltip has the following possible states:
// erased - nothing on screen
// displaying - currently being faded in (partially displayed)
// displayed - fully displayed
// erasing - currently being faded out (partially erased)
state: "erased",
fillInTemplate: function(args, frag){
if(this.caption != ""){
this.domNode.appendChild(document.createTextNode(this.caption));
}
this.connectNode = dojo.byId(this.connectId);
dojo.widget.html.Tooltip.superclass.fillInTemplate.call(this, args, frag);
},
postCreate: function(args, frag){
// The domnode was appended to my parent widget's domnode, but the positioning
// only works if the domnode is a child of document.body
document.body.appendChild(this.domNode);
dojo.event.connect(this.connectNode, "onmouseover", this, "onMouseOver");
dojo.widget.html.Tooltip.superclass.postCreate.call(this, args, frag);
},
onMouseOver: function(e) {
this.mouse = {x: e.pageX, y: e.pageY};
if(!this.showTimer){
this.showTimer = setTimeout(dojo.lang.hitch(this, "show"), this.showDelay);
dojo.event.connect(document.documentElement, "onmousemove", this, "onMouseMove");
}
},
onMouseMove: function(e) {
this.mouse = {x: e.pageX, y: e.pageY};
if(dojo.html.overElement(this.connectNode, e) || dojo.html.overElement(this.domNode, e)) {
// If the tooltip has been scheduled to be erased, cancel that timer
// since we are hovering over element/tooltip again
if(this.hideTimer) {
clearTimeout(this.hideTimer);
delete this.hideTimer;
}
} else {
// mouse has been moved off the element/tooltip
// note: can't use onMouseOut to detect this because the "explode" effect causes
// spurious onMouseOut/onMouseOver events (due to interference from outline)
if(this.showTimer){
clearTimeout(this.showTimer);
delete this.showTimer;
}
if((this.state=="displaying"||this.state=="displayed") && !this.hideTimer){
this.hideTimer = setTimeout(dojo.lang.hitch(this, "hide"), this.hideDelay);
}
}
},
show: function() {
if(this.state=="erasing"){
// we are in the process of erasing; when that is finished, display it.
this.displayScheduled=true;
return;
}
if ( this.state=="displaying" || this.state=="displayed" ) { return; }
// prevent IE bleed through (iframe creation is deferred until first show()
// call because apparently it takes a long time)
if(!this.bgIframe){
this.bgIframe = new dojo.html.BackgroundIframe(this.domNode);
}
this.position();
// if rendering using explosion effect, need to set explosion source
this.explodeSrc = [this.mouse.x, this.mouse.y];
this.state="displaying";
dojo.widget.html.Tooltip.superclass.show.call(this);
},
onShow: function() {
dojo.widget.html.Tooltip.superclass.onShow.call(this);
this.state="displayed";
// in the corner case where the user has moved his mouse away
// while the tip was fading in
if(this.eraseScheduled){
this.hide();
this.eraseScheduled=false;
}
},
hide: function() {
if(this.state=="displaying"){
// in the process of fading in. wait until that is finished and then fade out
this.eraseScheduled=true;
return;
}
if ( this.state=="displayed" ) {
this.state="erasing";
if ( this.showTimer ) {
clearTimeout(this.showTimer);
delete this.showTimer;
}
if ( this.hideTimer ) {
clearTimeout(this.hideTimer);
delete this.hideTimer;
}
dojo.event.disconnect(document.documentElement, "onmousemove", this, "onMouseMove");
dojo.widget.html.Tooltip.superclass.hide.call(this);
}
},
onHide: function(){
this.state="erased";
// in the corner case where the user has moved his mouse back
// while the tip was fading out
if(this.displayScheduled){
this.display();
this.displayScheduled=false;
}
},
position: function(){
dojo.html.placeOnScreenPoint(this.domNode, this.mouse.x, this.mouse.y, [10,15], true);
this.bgIframe.onResized();
},
onLoad: function(){
if(this.isShowing()){
// the tooltip has changed size due to downloaded contents, so reposition it
dojo.lang.setTimeout(this, this.position, 50);
dojo.widget.html.Tooltip.superclass.onLoad.apply(this, arguments);
}
},
checkSize: function() {
// checkSize() is called when the user has resized the browser window,
// but that doesn't affect this widget (or this widget's children)
// so it can be safely ignored
}
}
);

View file

@ -8,173 +8,173 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.html.YahooMap");
dojo.require("dojo.event.*");
dojo.require("dojo.html");
dojo.require("dojo.math");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.YahooMap");
(function(){
var yappid = djConfig["yAppId"]||djConfig["yahooAppId"]||"dojotoolkit";
if(!dojo.hostenv.post_load_){
if(yappid == "dojotoolkit"){
dojo.debug("please provide a unique Yahoo App ID in djConfig.yahooAppId when using the map widget");
}
var tag = "<scr"+"ipt src='http://api.maps.yahoo.com/ajaxymap?v=3.0&appid="+yappid+"'></scri"+"pt>";
if(!dj_global["YMap"]){
document.write(tag);
}
}else{
dojo.debug("cannot initialize map system after the page has been loaded! Please either manually include the script block provided by Yahoo in your page or require() the YahooMap widget before onload has fired");
}
})();
dojo.widget.html.YahooMap=function(){
dojo.widget.HtmlWidget.call(this);
dojo.widget.YahooMap.call(this);
this.map=null;
this.datasrc="";
this.data=[];
this.width=0;
this.height=0;
this.controls=["zoomlong","maptype","pan"];
};
dojo.inherits(dojo.widget.html.YahooMap, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.html.YahooMap, {
widgetType: "YahooMap",
templatePath:null,
templateCssPath:null,
findCenter:function(aPts){
var start=new YGeoPoint(37,-90);
if(aPts.length==0) return start;
var minLat,maxLat, minLon, maxLon, cLat, cLon;
minLat=maxLat=aPts[0].Lat;
minLon=maxLon=aPts[0].Lon;
for(var i=0; i<aPts.length; i++){
minLat=Math.min(minLat,aPts[i].Lat);
maxLat=Math.max(maxLat,aPts[i].Lat);
minLon=Math.min(minLon,aPts[i].Lon);
maxLon=Math.max(maxLon,aPts[i].Lon);
}
cLat=dojo.math.round((minLat+maxLat)/2,6);
cLon=dojo.math.round((minLon+maxLon)/2,6);
return new YGeoPoint(cLat,cLon);
},
setControls:function(){
var c=this.controls;
var t=dojo.widget.YahooMap.Controls;
for(var i=0; i<c.length; i++){
switch(c[i]){
case t.MapType:{
this.map.addTypeControl();
break;
}
case t.Pan:{
this.map.addPanControl();
break;
}
case t.ZoomLong:{
this.map.addZoomLong();
break;
}
case t.ZoomShort:{
this.map.addZoomShort();
break;
}
}
}
},
parse:function(table){
this.data=[];
// get the column indices
var h=table.getElementsByTagName("thead")[0];
if(!h){
return;
}
var a=[];
var cols=h.getElementsByTagName("td");
if(cols.length==0){
cols=h.getElementsByTagName("th");
}
for(var i=0; i<cols.length; i++){
var c=cols[i].innerHTML.toLowerCase();
if(c=="long") c="lng";
a.push(c);
}
// parse the data
var b=table.getElementsByTagName("tbody")[0];
if(!b){
return;
}
for(var i=0; i<b.childNodes.length; i++){
if(!(b.childNodes[i].nodeName&&b.childNodes[i].nodeName.toLowerCase()=="tr")){
continue;
}
var cells=b.childNodes[i].getElementsByTagName("td");
var o={};
for(var j=0; j<a.length; j++){
var col=a[j];
if(col=="lat"||col=="lng"){
o[col]=parseFloat(cells[j].innerHTML);
}else{
o[col]=cells[j].innerHTML;
}
}
this.data.push(o);
}
},
render:function(){
var pts=[];
var d=this.data;
for(var i=0; i<d.length; i++){
var pt=new YGeoPoint(d[i].lat, d[i].lng);
pts.push(pt);
var icon=d[i].icon||null;
if(icon){
icon=new YImage(icon);
}
var m=new YMarker(pt,icon);
if(d[i].description){
m.addAutoExpand("<div>"+d[i].description+"</div>");
}
this.map.addOverlay(m);
}
var c=this.findCenter(pts);
var z=this.map.getZoomLevel(pts);
this.map.drawZoomAndCenter(c,z);
},
initialize:function(args, frag){
if(!YMap || !YGeoPoint){
dojo.raise("dojo.widget.YahooMap: The Yahoo Map script must be included in order to use this widget.");
}
if(this.datasrc){
this.parse(dojo.byId(this.datasrc));
}
else if(this.domNode.getElementsByTagName("table")[0]){
this.parse(this.domNode.getElementsByTagName("table")[0]);
}
},
postCreate:function(){
// clean the domNode before creating the map.
while(this.domNode.childNodes.length>0){
this.domNode.removeChild(this.domNode.childNodes[0]);
}
if(this.width>0&&this.height>0){
this.map=new YMap(this.domNode, YAHOO_MAP_REG, new YSize(this.width, this.height));
}else{
this.map=new YMap(this.domNode);
}
this.setControls();
this.render();
}
});
dojo.provide("dojo.widget.html.YahooMap");
dojo.require("dojo.event.*");
dojo.require("dojo.html");
dojo.require("dojo.math");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.YahooMap");
(function(){
var yappid = djConfig["yAppId"]||djConfig["yahooAppId"]||"dojotoolkit";
if(!dojo.hostenv.post_load_){
if(yappid == "dojotoolkit"){
dojo.debug("please provide a unique Yahoo App ID in djConfig.yahooAppId when using the map widget");
}
var tag = "<scr"+"ipt src='http://api.maps.yahoo.com/ajaxymap?v=3.0&appid="+yappid+"'></scri"+"pt>";
if(!dj_global["YMap"]){
document.write(tag);
}
}else{
dojo.debug("cannot initialize map system after the page has been loaded! Please either manually include the script block provided by Yahoo in your page or require() the YahooMap widget before onload has fired");
}
})();
dojo.widget.html.YahooMap=function(){
dojo.widget.HtmlWidget.call(this);
dojo.widget.YahooMap.call(this);
this.map=null;
this.datasrc="";
this.data=[];
this.width=0;
this.height=0;
this.controls=["zoomlong","maptype","pan"];
};
dojo.inherits(dojo.widget.html.YahooMap, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.html.YahooMap, {
widgetType: "YahooMap",
templatePath:null,
templateCssPath:null,
findCenter:function(aPts){
var start=new YGeoPoint(37,-90);
if(aPts.length==0) return start;
var minLat,maxLat, minLon, maxLon, cLat, cLon;
minLat=maxLat=aPts[0].Lat;
minLon=maxLon=aPts[0].Lon;
for(var i=0; i<aPts.length; i++){
minLat=Math.min(minLat,aPts[i].Lat);
maxLat=Math.max(maxLat,aPts[i].Lat);
minLon=Math.min(minLon,aPts[i].Lon);
maxLon=Math.max(maxLon,aPts[i].Lon);
}
cLat=dojo.math.round((minLat+maxLat)/2,6);
cLon=dojo.math.round((minLon+maxLon)/2,6);
return new YGeoPoint(cLat,cLon);
},
setControls:function(){
var c=this.controls;
var t=dojo.widget.YahooMap.Controls;
for(var i=0; i<c.length; i++){
switch(c[i]){
case t.MapType:{
this.map.addTypeControl();
break;
}
case t.Pan:{
this.map.addPanControl();
break;
}
case t.ZoomLong:{
this.map.addZoomLong();
break;
}
case t.ZoomShort:{
this.map.addZoomShort();
break;
}
}
}
},
parse:function(table){
this.data=[];
// get the column indices
var h=table.getElementsByTagName("thead")[0];
if(!h){
return;
}
var a=[];
var cols=h.getElementsByTagName("td");
if(cols.length==0){
cols=h.getElementsByTagName("th");
}
for(var i=0; i<cols.length; i++){
var c=cols[i].innerHTML.toLowerCase();
if(c=="long") c="lng";
a.push(c);
}
// parse the data
var b=table.getElementsByTagName("tbody")[0];
if(!b){
return;
}
for(var i=0; i<b.childNodes.length; i++){
if(!(b.childNodes[i].nodeName&&b.childNodes[i].nodeName.toLowerCase()=="tr")){
continue;
}
var cells=b.childNodes[i].getElementsByTagName("td");
var o={};
for(var j=0; j<a.length; j++){
var col=a[j];
if(col=="lat"||col=="lng"){
o[col]=parseFloat(cells[j].innerHTML);
}else{
o[col]=cells[j].innerHTML;
}
}
this.data.push(o);
}
},
render:function(){
var pts=[];
var d=this.data;
for(var i=0; i<d.length; i++){
var pt=new YGeoPoint(d[i].lat, d[i].lng);
pts.push(pt);
var icon=d[i].icon||null;
if(icon){
icon=new YImage(icon);
}
var m=new YMarker(pt,icon);
if(d[i].description){
m.addAutoExpand("<div>"+d[i].description+"</div>");
}
this.map.addOverlay(m);
}
var c=this.findCenter(pts);
var z=this.map.getZoomLevel(pts);
this.map.drawZoomAndCenter(c,z);
},
initialize:function(args, frag){
if(!YMap || !YGeoPoint){
dojo.raise("dojo.widget.YahooMap: The Yahoo Map script must be included in order to use this widget.");
}
if(this.datasrc){
this.parse(dojo.byId(this.datasrc));
}
else if(this.domNode.getElementsByTagName("table")[0]){
this.parse(this.domNode.getElementsByTagName("table")[0]);
}
},
postCreate:function(){
// clean the domNode before creating the map.
while(this.domNode.childNodes.length>0){
this.domNode.removeChild(this.domNode.childNodes[0]);
}
if(this.width>0&&this.height>0){
this.map=new YMap(this.domNode, YAHOO_MAP_REG, new YSize(this.width, this.height));
}else{
this.map=new YMap(this.domNode);
}
this.setControls();
this.render();
}
});

View file

@ -8,206 +8,206 @@
http://dojotoolkit.org/community/licensing.shtml
*/
// Maintain state of widgets when user hits back/forward button
dojo.provide("dojo.widget.html.stabile");
dojo.widget.html.stabile = {
// Characters to quote in single-quoted regexprs
_sqQuotables: new RegExp("([\\\\'])", "g"),
// Current depth.
_depth: 0,
// Set to true when calling v.toString, to sniff for infinite
// recursion.
_recur: false,
// Levels of nesting of Array and object displays.
// If when >= depth, no display or array or object internals.
depthLimit: 2
};
//// PUBLIC METHODS
// Get the state stored for the widget with the given ID, or undefined
// if none.
//
dojo.widget.html.stabile.getState = function(id){
dojo.widget.html.stabile.setup();
return dojo.widget.html.stabile.widgetState[id];
}
// Set the state stored for the widget with the given ID. If isCommit
// is true, commits all widget state to more stable storage.
//
dojo.widget.html.stabile.setState = function(id, state, isCommit){
dojo.widget.html.stabile.setup();
dojo.widget.html.stabile.widgetState[id] = state;
if(isCommit){
dojo.widget.html.stabile.commit(dojo.widget.html.stabile.widgetState);
}
}
// Sets up widgetState: a hash keyed by widgetId, maps to an object
// or array writable with "describe". If there is data in the widget
// storage area, use it, otherwise initialize an empty object.
//
dojo.widget.html.stabile.setup = function(){
if(!dojo.widget.html.stabile.widgetState){
var text = dojo.widget.html.stabile.getStorage().value;
dojo.widget.html.stabile.widgetState = text ? dj_eval("("+text+")") : {};
}
}
// Commits all widget state to more stable storage, so if the user
// navigates away and returns, it can be restored.
//
dojo.widget.html.stabile.commit = function(state){
dojo.widget.html.stabile.getStorage().value = dojo.widget.html.stabile.description(state);
}
// Return a JSON "description string" for the given value.
// Supports only core JavaScript types with literals, plus Date,
// and cyclic structures are unsupported.
// showAll defaults to false -- if true, this becomes a simple symbolic
// object dumper, but you cannot "eval" the output.
//
dojo.widget.html.stabile.description = function(v, showAll){
// Save and later restore dojo.widget.html.stabile._depth;
var depth = dojo.widget.html.stabile._depth;
var describeThis = function() {
return this.description(this, true);
}
try {
if(v===void(0)){
return "undefined";
}
if(v===null){
return "null";
}
if(typeof(v)=="boolean" || typeof(v)=="number"
|| v instanceof Boolean || v instanceof Number){
return v.toString();
}
if(typeof(v)=="string" || v instanceof String){
// Quote strings and their contents as required.
// Replacing by $& fails in IE 5.0
var v1 = v.replace(dojo.widget.html.stabile._sqQuotables, "\\$1");
v1 = v1.replace(/\n/g, "\\n");
v1 = v1.replace(/\r/g, "\\r");
// Any other important special cases?
return "'"+v1+"'";
}
if(v instanceof Date){
// Create a data constructor.
return "new Date("+d.getFullYear+","+d.getMonth()+","+d.getDate()+")";
}
var d;
if(v instanceof Array || v.push){
// "push" test needed for KHTML/Safari, don't know why -cp
if(depth>=dojo.widget.html.stabile.depthLimit)
return "[ ... ]";
d = "[";
var first = true;
dojo.widget.html.stabile._depth++;
for(var i=0; i<v.length; i++){
// Skip functions and undefined values
// if(v[i]==undef || typeof(v[i])=="function")
// continue;
if(first){
first = false;
}else{
d += ",";
}
d+=arguments.callee(v[i], showAll);
}
return d+"]";
}
if(v.constructor==Object
|| v.toString==describeThis){
if(depth>=dojo.widget.html.stabile.depthLimit)
return "{ ... }";
// Instanceof Hash is good, or if we just use Objects,
// we can say v.constructor==Object.
// IE (5?) lacks hasOwnProperty, but perhaps objects do not always
// have prototypes??
if(typeof(v.hasOwnProperty)!="function" && v.prototype){
throw new Error("description: "+v+" not supported by script engine");
}
var first = true;
d = "{";
dojo.widget.html.stabile._depth++;
for(var key in v){
// Skip values that are functions or undefined.
if(v[key]==void(0) || typeof(v[key])=="function")
continue;
if(first){
first = false;
}else{
d += ", ";
}
var kd = key;
// If the key is not a legal identifier, use its description.
// For strings this will quote the stirng.
if(!kd.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)){
kd = arguments.callee(key, showAll);
}
d += kd+": "+arguments.callee(v[key], showAll);
}
return d+"}";
}
if(showAll){
if(dojo.widget.html.stabile._recur){
// Save the original definitions of toString;
var objectToString = Object.prototype.toString;
return objectToString.apply(v, []);
}else{
dojo.widget.html.stabile._recur = true;
return v.toString();
}
}else{
// log("Description? "+v.toString()+", "+typeof(v));
throw new Error("Unknown type: "+v);
return "'unknown'";
}
} finally {
// Always restore the global current depth.
dojo.widget.html.stabile._depth = depth;
}
}
//// PRIVATE TO MODULE
// Gets an object (form field) with a read/write "value" property.
//
dojo.widget.html.stabile.getStorage = function(){
if (dojo.widget.html.stabile.dataField) {
return dojo.widget.html.stabile.dataField;
}
var form = document.forms._dojo_form;
return dojo.widget.html.stabile.dataField = form ? form.stabile : {value: ""};
}
// Maintain state of widgets when user hits back/forward button
dojo.provide("dojo.widget.html.stabile");
dojo.widget.html.stabile = {
// Characters to quote in single-quoted regexprs
_sqQuotables: new RegExp("([\\\\'])", "g"),
// Current depth.
_depth: 0,
// Set to true when calling v.toString, to sniff for infinite
// recursion.
_recur: false,
// Levels of nesting of Array and object displays.
// If when >= depth, no display or array or object internals.
depthLimit: 2
};
//// PUBLIC METHODS
// Get the state stored for the widget with the given ID, or undefined
// if none.
//
dojo.widget.html.stabile.getState = function(id){
dojo.widget.html.stabile.setup();
return dojo.widget.html.stabile.widgetState[id];
}
// Set the state stored for the widget with the given ID. If isCommit
// is true, commits all widget state to more stable storage.
//
dojo.widget.html.stabile.setState = function(id, state, isCommit){
dojo.widget.html.stabile.setup();
dojo.widget.html.stabile.widgetState[id] = state;
if(isCommit){
dojo.widget.html.stabile.commit(dojo.widget.html.stabile.widgetState);
}
}
// Sets up widgetState: a hash keyed by widgetId, maps to an object
// or array writable with "describe". If there is data in the widget
// storage area, use it, otherwise initialize an empty object.
//
dojo.widget.html.stabile.setup = function(){
if(!dojo.widget.html.stabile.widgetState){
var text = dojo.widget.html.stabile.getStorage().value;
dojo.widget.html.stabile.widgetState = text ? dj_eval("("+text+")") : {};
}
}
// Commits all widget state to more stable storage, so if the user
// navigates away and returns, it can be restored.
//
dojo.widget.html.stabile.commit = function(state){
dojo.widget.html.stabile.getStorage().value = dojo.widget.html.stabile.description(state);
}
// Return a JSON "description string" for the given value.
// Supports only core JavaScript types with literals, plus Date,
// and cyclic structures are unsupported.
// showAll defaults to false -- if true, this becomes a simple symbolic
// object dumper, but you cannot "eval" the output.
//
dojo.widget.html.stabile.description = function(v, showAll){
// Save and later restore dojo.widget.html.stabile._depth;
var depth = dojo.widget.html.stabile._depth;
var describeThis = function() {
return this.description(this, true);
}
try {
if(v===void(0)){
return "undefined";
}
if(v===null){
return "null";
}
if(typeof(v)=="boolean" || typeof(v)=="number"
|| v instanceof Boolean || v instanceof Number){
return v.toString();
}
if(typeof(v)=="string" || v instanceof String){
// Quote strings and their contents as required.
// Replacing by $& fails in IE 5.0
var v1 = v.replace(dojo.widget.html.stabile._sqQuotables, "\\$1");
v1 = v1.replace(/\n/g, "\\n");
v1 = v1.replace(/\r/g, "\\r");
// Any other important special cases?
return "'"+v1+"'";
}
if(v instanceof Date){
// Create a data constructor.
return "new Date("+d.getFullYear+","+d.getMonth()+","+d.getDate()+")";
}
var d;
if(v instanceof Array || v.push){
// "push" test needed for KHTML/Safari, don't know why -cp
if(depth>=dojo.widget.html.stabile.depthLimit)
return "[ ... ]";
d = "[";
var first = true;
dojo.widget.html.stabile._depth++;
for(var i=0; i<v.length; i++){
// Skip functions and undefined values
// if(v[i]==undef || typeof(v[i])=="function")
// continue;
if(first){
first = false;
}else{
d += ",";
}
d+=arguments.callee(v[i], showAll);
}
return d+"]";
}
if(v.constructor==Object
|| v.toString==describeThis){
if(depth>=dojo.widget.html.stabile.depthLimit)
return "{ ... }";
// Instanceof Hash is good, or if we just use Objects,
// we can say v.constructor==Object.
// IE (5?) lacks hasOwnProperty, but perhaps objects do not always
// have prototypes??
if(typeof(v.hasOwnProperty)!="function" && v.prototype){
throw new Error("description: "+v+" not supported by script engine");
}
var first = true;
d = "{";
dojo.widget.html.stabile._depth++;
for(var key in v){
// Skip values that are functions or undefined.
if(v[key]==void(0) || typeof(v[key])=="function")
continue;
if(first){
first = false;
}else{
d += ", ";
}
var kd = key;
// If the key is not a legal identifier, use its description.
// For strings this will quote the stirng.
if(!kd.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)){
kd = arguments.callee(key, showAll);
}
d += kd+": "+arguments.callee(v[key], showAll);
}
return d+"}";
}
if(showAll){
if(dojo.widget.html.stabile._recur){
// Save the original definitions of toString;
var objectToString = Object.prototype.toString;
return objectToString.apply(v, []);
}else{
dojo.widget.html.stabile._recur = true;
return v.toString();
}
}else{
// log("Description? "+v.toString()+", "+typeof(v));
throw new Error("Unknown type: "+v);
return "'unknown'";
}
} finally {
// Always restore the global current depth.
dojo.widget.html.stabile._depth = depth;
}
}
//// PRIVATE TO MODULE
// Gets an object (form field) with a read/write "value" property.
//
dojo.widget.html.stabile.getStorage = function(){
if (dojo.widget.html.stabile.dataField) {
return dojo.widget.html.stabile.dataField;
}
var form = document.forms._dojo_form;
return dojo.widget.html.stabile.dataField = form ? form.stabile : {value: ""};
}

View file

@ -1,6 +1,6 @@
<span>
<input type="checkbox" name="${this.name}" checked="${this.checked}" tabIndex="${this.tabIndex}" style="display: none"
dojoAttachPoint="inputNode">
<img src='${this.imgSrc}' class='dojoHtmlCheckbox'
dojoAttachPoint="imgNode" dojoAttachEvent="onMouseUp;onMouseOver;onMouseOut">
<span>
<input type="checkbox" name="${this.name}" checked="${this.checked}" tabIndex="${this.tabIndex}" style="display: none"
dojoAttachPoint="inputNode">
<img src='${this.imgSrc}' class='dojoHtmlCheckbox'
dojoAttachPoint="imgNode" dojoAttachEvent="onMouseUp;onMouseOver;onMouseOut">
</span>

View file

@ -1,18 +1,18 @@
<div class="dojoButton" style="position:relative;top:0px;left:0px; text-align:none;">
<div dojoAttachPoint="leftPart" class="dojoButtonLeftPart" style="position:absolute;left:0px;top:0px;"
dojoAttachEvent="onMouseOver:leftOver; onMouseOut:leftOut; onMouseUp:leftUp; onClick:leftClick;">
<div class="dojoButtonContents" dojoAttachPoint="containerNode" style="position:absolute;top:0px;right:0px;z-index:2;"></div>
<img dojoAttachPoint="leftImage" style="position:absolute;left:0px;top:0px;">
<img dojoAttachPoint="centerImage" style="position:absolute;right:0px;top:0px;z-index:1;">
</div>
<div dojoAttachPoint="rightPart" class="dojoButtonRightPart" style="position:absolute;top:0px;right:0px;"
dojoAttachEvent="onMouseOver:rightOver; onMouseOut:rightOut; onMouseUp:rightUp; onClick:rightClick;">
<img dojoAttachPoint="arrowBackgroundImage" style="position:absolute;top:0px;left:0px;z-index:1;">
<img src="${dojoRoot}src/widget/templates/images/whiteDownArrow.gif"
style="z-index:2;position:absolute;left:3px;top:50%;">
<img dojoAttachPoint="rightImage" style="position:absolute;top:0px;right:0px;">
</div>
</div>
<div class="dojoButton" style="position:relative;top:0px;left:0px; text-align:none;">
<div dojoAttachPoint="leftPart" class="dojoButtonLeftPart" style="position:absolute;left:0px;top:0px;"
dojoAttachEvent="onMouseOver:leftOver; onMouseOut:leftOut; onMouseUp:leftUp; onClick:leftClick;">
<div class="dojoButtonContents" dojoAttachPoint="containerNode" style="position:absolute;top:0px;right:0px;z-index:2;"></div>
<img dojoAttachPoint="leftImage" style="position:absolute;left:0px;top:0px;">
<img dojoAttachPoint="centerImage" style="position:absolute;right:0px;top:0px;z-index:1;">
</div>
<div dojoAttachPoint="rightPart" class="dojoButtonRightPart" style="position:absolute;top:0px;right:0px;"
dojoAttachEvent="onMouseOver:rightOver; onMouseOut:rightOut; onMouseUp:rightUp; onClick:rightClick;">
<img dojoAttachPoint="arrowBackgroundImage" style="position:absolute;top:0px;left:0px;z-index:1;">
<img src="${dojoRoot}src/widget/templates/images/whiteDownArrow.gif"
style="z-index:2;position:absolute;left:3px;top:50%;">
<img dojoAttachPoint="rightImage" style="position:absolute;top:0px;right:0px;">
</div>
</div>

View file

@ -1,9 +1,9 @@
<button dojoAttachPoint="button" class="dojoButton dojoButtonNoHover" dojoAttachEvent="onMouseOver: ; onMouseOut: ; onClick: ;">
<table dojoAttachPoint="table" style="margin:0 0 0 0;"><tr>
<td class="label" dojoAttachPoint="labelCell"></td>
<td class="border" dojoAttachPoint="borderCell"></td>
<td class="downArrow" dojoAttachPoint="arrowCell">
<img dojoAttachPoint="arrow">
</td>
</tr></table>
<button dojoAttachPoint="button" class="dojoButton dojoButtonNoHover" dojoAttachEvent="onMouseOver: ; onMouseOut: ; onClick: ;">
<table dojoAttachPoint="table" style="margin:0 0 0 0;"><tr>
<td class="label" dojoAttachPoint="labelCell"></td>
<td class="border" dojoAttachPoint="borderCell"></td>
<td class="downArrow" dojoAttachPoint="arrowCell">
<img dojoAttachPoint="arrow">
</td>
</tr></table>
</button>

View file

@ -1,27 +1,27 @@
.dojoHtmlFisheyeListItemLabel {
font-family: Arial, Helvetica, sans-serif;
background-color: #eee;
border: 2px solid #666;
padding: 2px;
text-align: center;
position: absolute;
display: none;
}
.dojoHtmlFisheyeListItemLabel.selected {
display: block;
}
.dojoHtmlFisheyeListItemImage {
border: 0px;
position: absolute;
}
.dojoHtmlFisheyeListItem {
position: absolute;
z-index: 2;
}
.dojoHtmlFisheyeListBar {
position: relative;
}
.dojoHtmlFisheyeListItemLabel {
font-family: Arial, Helvetica, sans-serif;
background-color: #eee;
border: 2px solid #666;
padding: 2px;
text-align: center;
position: absolute;
display: none;
}
.dojoHtmlFisheyeListItemLabel.selected {
display: block;
}
.dojoHtmlFisheyeListItemImage {
border: 0px;
position: absolute;
}
.dojoHtmlFisheyeListItem {
position: absolute;
z-index: 2;
}
.dojoHtmlFisheyeListBar {
position: relative;
}

View file

@ -1,18 +1,18 @@
<div id="${this.widgetId}" class="dojoFloatingPane">
<div dojoAttachPoint="titleBar" class="dojoFloatingPaneTitleBar" dojoAttachEvent="onMouseDown" style="display:none">
<img dojoAttachPoint="titleBarIcon" class="dojoFloatingPaneTitleBarIcon">
<div dojoAttachPoint="closeAction" dojoAttachEvent="onClick:closeWindow"
class="dojoFloatingPaneCloseIcon"></div>
<div dojoAttachPoint="restoreAction" dojoAttachEvent="onClick:restoreWindow"
class="dojoFloatingPaneRestoreIcon"></div>
<div dojoAttachPoint="maximizeAction" dojoAttachEvent="onClick:maximizeWindow"
class="dojoFloatingPaneMaximizeIcon"></div>
<div dojoAttachPoint="minimizeAction" dojoAttachEvent="onClick:minimizeWindow"
class="dojoFloatingPaneMinimizeIcon"></div>
<div dojoAttachPoint="titleBarText" class="dojoFloatingPaneTitleText">${this.title}</div>
</div>
<div id="${this.widgetId}_container" dojoAttachPoint="containerNode" class="dojoFloatingPaneClient"></div>
<div dojoAttachPoint="resizeBar" class="dojoFloatingPaneResizebar" style="display:none"></div>
<div id="${this.widgetId}" class="dojoFloatingPane">
<div dojoAttachPoint="titleBar" class="dojoFloatingPaneTitleBar" dojoAttachEvent="onMouseDown" style="display:none">
<img dojoAttachPoint="titleBarIcon" class="dojoFloatingPaneTitleBarIcon">
<div dojoAttachPoint="closeAction" dojoAttachEvent="onClick:closeWindow"
class="dojoFloatingPaneCloseIcon"></div>
<div dojoAttachPoint="restoreAction" dojoAttachEvent="onClick:restoreWindow"
class="dojoFloatingPaneRestoreIcon"></div>
<div dojoAttachPoint="maximizeAction" dojoAttachEvent="onClick:maximizeWindow"
class="dojoFloatingPaneMaximizeIcon"></div>
<div dojoAttachPoint="minimizeAction" dojoAttachEvent="onClick:minimizeWindow"
class="dojoFloatingPaneMinimizeIcon"></div>
<div dojoAttachPoint="titleBarText" class="dojoFloatingPaneTitleText">${this.title}</div>
</div>
<div id="${this.widgetId}_container" dojoAttachPoint="containerNode" class="dojoFloatingPaneClient"></div>
<div dojoAttachPoint="resizeBar" class="dojoFloatingPaneResizebar" style="display:none"></div>
</div>

View file

@ -1,173 +1,173 @@
.dojoTabContainer {
position : relative;
}
.dojoTabPaneWrapper {
position : relative;
border : 1px solid #6290d2;
clear: both;
}
.dojoTabLabels-top {
position : absolute;
top : 0px;
left : 0px;
overflow : visible;
margin-bottom : -1px;
width : 100%;
z-index: 2; /* so the bottom of the tab label will cover up the border of dojoTabPaneWrapper */
}
.dojoTabLabels-top-noLayout {
overflow : visible;
margin-bottom : -1px;
width : 100%;
z-index: 2;
}
.dojoTabPaneTab {
position : relative;
float : left;
padding-left : 9px;
border-bottom : 1px solid #6290d2;
background : url(images/tab_left.gif) no-repeat left top;
cursor: pointer;
}
.dojoTabPaneTab span {
display : block;
padding : 4px 15px 4px 6px;
background : url(images/tab_top_right.gif) no-repeat right top;
color : #333;
font-size : 90%;
}
.dojoTabPanePaneClose {
position : absolute;
bottom : 0px;
right : 6px;
height : 12px;
width : 12px;
background : url(images/tab_close.gif) no-repeat right top;
}
.dojoTabPanePaneCloseHover {
background-image : url(images/tab_close_h.gif);
}
.dojoTabPaneTabClose {
display : inline;
height : 12px;
width : 12px;
padding : 0 12px 0 0;
margin : 0 -10px 0 10px;
background : url(images/tab_close.gif) no-repeat right top;
cursor : default;
}
.dojoTabPaneTabCloseHover {
background-image : url(images/tab_close_h.gif);
}
.dojoTabPaneTab.current {
padding-bottom : 1px;
border-bottom : 0;
background-position : 0 -150px;
}
.dojoTabPaneTab.current span {
padding-bottom : 5px;
margin-bottom : -1px;
background-position : 100% -150px;
}
/* bottom tabs */
.dojoTabLabels-bottom {
position : absolute;
bottom : 0px;
left : 0px;
overflow : visible;
margin-top : -1px;
width : 100%;
z-index: 2;
}
.dojoTabLabels-bottom .dojoTabPaneTab {
border-top : 1px solid #6290d2;
border-bottom : 0;
background : url(images/tab_bot_left.gif) no-repeat left bottom;
}
.dojoTabLabels-bottom .dojoTabPaneTab span {
background : url(images/tab_bot_right.gif) no-repeat right bottom;
}
.dojoTabLabels-bottom .dojoTabPaneTab.current {
padding-top : 1px;
border-top : 0;
background : url(images/tab_bot_left_curr.gif) no-repeat left bottom;
}
.dojoTabLabels-bottom .dojoTabPaneTab.current span {
padding-top : 5px;
margin-top : -1px;
background : url(images/tab_bot_right_curr.gif) no-repeat right bottom;
}
/* right-h tabs */
.dojoTabLabels-right-h {
position : absolute;
top : 0px;
right : 0px;
overflow : visible;
margin-left : -1px;
z-index: 2;
}
.dojoTabLabels-right-h .dojoTabPaneTab {
padding-left : 0;
border-left : 1px solid #6290d2;
border-bottom : 0;
background : url(images/tab_bot_right.gif) no-repeat right bottom;
float : none;
}
.dojoTabLabels-right-h .dojoTabPaneTab span {
padding : 4px 15px 4px 15px;
}
.dojoTabLabels-right-h .dojoTabPaneTab.current {
border-left : 0;
border-bottom : 1px solid #6290d2;
}
/* left-h tabs */
.dojoTabLabels-left-h {
position : absolute;
top : 0px;
left : 0px;
overflow : visible;
margin-right : -1px;
z-index: 2;
}
.dojoTabLabels-left-h .dojoTabPaneTab {
border-right : 1px solid #6290d2;
border-bottom : 0;
float : none;
background : url(images/tab_top_left.gif) no-repeat left top;
}
.dojoTabLabels-left-h .dojoTabPaneTab.current {
border-right : 0;
border-bottom : 1px solid #6290d2;
padding-bottom : 0;
background : url(images/tab_top_left.gif) no-repeat 0 -150px;
}
.dojoTabLabels-left-h .dojoTabPaneTab span {
background : 0;
border-bottom : 1px solid #6290d2;
}
.dojoTabContainer {
position : relative;
}
.dojoTabPaneWrapper {
position : relative;
border : 1px solid #6290d2;
clear: both;
}
.dojoTabLabels-top {
position : absolute;
top : 0px;
left : 0px;
overflow : visible;
margin-bottom : -1px;
width : 100%;
z-index: 2; /* so the bottom of the tab label will cover up the border of dojoTabPaneWrapper */
}
.dojoTabLabels-top-noLayout {
overflow : visible;
margin-bottom : -1px;
width : 100%;
z-index: 2;
}
.dojoTabPaneTab {
position : relative;
float : left;
padding-left : 9px;
border-bottom : 1px solid #6290d2;
background : url(images/tab_left.gif) no-repeat left top;
cursor: pointer;
}
.dojoTabPaneTab span {
display : block;
padding : 4px 15px 4px 6px;
background : url(images/tab_top_right.gif) no-repeat right top;
color : #333;
font-size : 90%;
}
.dojoTabPanePaneClose {
position : absolute;
bottom : 0px;
right : 6px;
height : 12px;
width : 12px;
background : url(images/tab_close.gif) no-repeat right top;
}
.dojoTabPanePaneCloseHover {
background-image : url(images/tab_close_h.gif);
}
.dojoTabPaneTabClose {
display : inline;
height : 12px;
width : 12px;
padding : 0 12px 0 0;
margin : 0 -10px 0 10px;
background : url(images/tab_close.gif) no-repeat right top;
cursor : default;
}
.dojoTabPaneTabCloseHover {
background-image : url(images/tab_close_h.gif);
}
.dojoTabPaneTab.current {
padding-bottom : 1px;
border-bottom : 0;
background-position : 0 -150px;
}
.dojoTabPaneTab.current span {
padding-bottom : 5px;
margin-bottom : -1px;
background-position : 100% -150px;
}
/* bottom tabs */
.dojoTabLabels-bottom {
position : absolute;
bottom : 0px;
left : 0px;
overflow : visible;
margin-top : -1px;
width : 100%;
z-index: 2;
}
.dojoTabLabels-bottom .dojoTabPaneTab {
border-top : 1px solid #6290d2;
border-bottom : 0;
background : url(images/tab_bot_left.gif) no-repeat left bottom;
}
.dojoTabLabels-bottom .dojoTabPaneTab span {
background : url(images/tab_bot_right.gif) no-repeat right bottom;
}
.dojoTabLabels-bottom .dojoTabPaneTab.current {
padding-top : 1px;
border-top : 0;
background : url(images/tab_bot_left_curr.gif) no-repeat left bottom;
}
.dojoTabLabels-bottom .dojoTabPaneTab.current span {
padding-top : 5px;
margin-top : -1px;
background : url(images/tab_bot_right_curr.gif) no-repeat right bottom;
}
/* right-h tabs */
.dojoTabLabels-right-h {
position : absolute;
top : 0px;
right : 0px;
overflow : visible;
margin-left : -1px;
z-index: 2;
}
.dojoTabLabels-right-h .dojoTabPaneTab {
padding-left : 0;
border-left : 1px solid #6290d2;
border-bottom : 0;
background : url(images/tab_bot_right.gif) no-repeat right bottom;
float : none;
}
.dojoTabLabels-right-h .dojoTabPaneTab span {
padding : 4px 15px 4px 15px;
}
.dojoTabLabels-right-h .dojoTabPaneTab.current {
border-left : 0;
border-bottom : 1px solid #6290d2;
}
/* left-h tabs */
.dojoTabLabels-left-h {
position : absolute;
top : 0px;
left : 0px;
overflow : visible;
margin-right : -1px;
z-index: 2;
}
.dojoTabLabels-left-h .dojoTabPaneTab {
border-right : 1px solid #6290d2;
border-bottom : 0;
float : none;
background : url(images/tab_top_left.gif) no-repeat left top;
}
.dojoTabLabels-left-h .dojoTabPaneTab.current {
border-right : 0;
border-bottom : 1px solid #6290d2;
padding-bottom : 0;
background : url(images/tab_top_left.gif) no-repeat 0 -150px;
}
.dojoTabLabels-left-h .dojoTabPaneTab span {
background : 0;
border-bottom : 1px solid #6290d2;
}

View file

@ -1,4 +1,4 @@
<div id="${this.widgetId}" class="dojoTabContainer" waiRole="tabpanel">
<div dojoAttachPoint="dojoTabLabels"></div>
<div class="dojoTabPaneWrapper" dojoAttachPoint="containerNode" ></div>
</div>
<div id="${this.widgetId}" class="dojoTabContainer" waiRole="tabpanel">
<div dojoAttachPoint="dojoTabLabels"></div>
<div class="dojoTabPaneWrapper" dojoAttachPoint="containerNode" ></div>
</div>

View file

@ -1,29 +1,29 @@
.dojoTaskBarItem {
display: inline-block;
background-color: ThreeDFace;
border: outset 2px;
margin-right: 5px;
cursor: pointer;
height: 35px;
width: 100px;
font-size: 10pt;
white-space: nowrap;
text-align: center;
float: left;
overflow: hidden;
}
.dojoTaskBarItem img {
vertical-align: middle;
margin-right: 5px;
margin-left: 5px;
height: 32px;
width: 32px;
}
.dojoTaskBarItem a {
color: black;
text-decoration: none;
}
.dojoTaskBarItem {
display: inline-block;
background-color: ThreeDFace;
border: outset 2px;
margin-right: 5px;
cursor: pointer;
height: 35px;
width: 100px;
font-size: 10pt;
white-space: nowrap;
text-align: center;
float: left;
overflow: hidden;
}
.dojoTaskBarItem img {
vertical-align: middle;
margin-right: 5px;
margin-left: 5px;
height: 32px;
width: 32px;
}
.dojoTaskBarItem a {
color: black;
text-decoration: none;
}

View file

@ -1,2 +1,2 @@
<div class="dojoTaskBarItem" dojoAttachEvent="onClick">
<div class="dojoTaskBarItem" dojoAttachEvent="onClick">
</div>

View file

@ -1,9 +1,9 @@
.dojoTooltip {
border: solid black 1px;
background: beige;
color: black;
position: absolute;
font-size: small;
padding: 2px 2px 2px 2px;
z-index: 10;
}
.dojoTooltip {
border: solid black 1px;
background: beige;
color: black;
position: absolute;
font-size: small;
padding: 2px 2px 2px 2px;
z-index: 10;
}

View file

@ -1,2 +1,2 @@
<div class='dojoTooltip' style="display:none" dojoAttachPoint="containerNode">
<div class='dojoTooltip' style="display:none" dojoAttachPoint="containerNode">
</div>

View file

@ -1,36 +1,36 @@
.dojoTree {
font: caption;
font-size: 11px;
font-weight: normal;
overflow: auto;
}
.dojoTreeNodeLabelTitle {
padding-left: 2px;
color: WindowText;
}
.dojoTreeNodeLabel {
cursor:hand;
cursor:pointer;
}
.dojoTreeNodeLabelTitle:hover {
text-decoration: underline;
}
.dojoTreeNodeLabelSelected {
background-color: Highlight;
color: HighlightText;
}
.dojoTree div {
white-space: nowrap;
}
.dojoTree img, .dojoTreeNodeLabel img {
vertical-align: middle;
}
.dojoTree {
font: caption;
font-size: 11px;
font-weight: normal;
overflow: auto;
}
.dojoTreeNodeLabelTitle {
padding-left: 2px;
color: WindowText;
}
.dojoTreeNodeLabel {
cursor:hand;
cursor:pointer;
}
.dojoTreeNodeLabelTitle:hover {
text-decoration: underline;
}
.dojoTreeNodeLabelSelected {
background-color: Highlight;
color: HighlightText;
}
.dojoTree div {
white-space: nowrap;
}
.dojoTree img, .dojoTreeNodeLabel img {
vertical-align: middle;
}

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<svg version="1.1" id="Layer_1" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="15.433" height="15.433"
viewBox="0 0 15.433 15.433" overflow="visible" enable-background="new 0 0 15.433 15.433" xml:space="preserve">
<circle fill="none" stroke="#D02026" stroke-width="2" cx="7.716" cy="7.716" r="6.716"/>
<line fill="none" stroke="#D02026" stroke-width="2" x1="3.02" y1="12.352" x2="12.639" y2="2.732"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<svg version="1.1" id="Layer_1" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="15.433" height="15.433"
viewBox="0 0 15.433 15.433" overflow="visible" enable-background="new 0 0 15.433 15.433" xml:space="preserve">
<circle fill="none" stroke="#D02026" stroke-width="2" cx="7.716" cy="7.716" r="6.716"/>
<line fill="none" stroke="#D02026" stroke-width="2" x1="3.02" y1="12.352" x2="12.639" y2="2.732"/>
</svg>

Before

Width:  |  Height:  |  Size: 763 B

After

Width:  |  Height:  |  Size: 752 B

Before After
Before After

View file

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<script type="text/javascript">
function init(){
document.designMode = 'On';
parentPageDomain = document.location.href.split('#')[1];
if (parentPageDomain) {
document.domain = parentPageDomain;
}
}
window.onload = init;
</script>
</head>
<body>
<br />
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<script type="text/javascript">
function init(){
document.designMode = 'On';
parentPageDomain = document.location.href.split('#')[1];
if (parentPageDomain) {
document.domain = parentPageDomain;
}
}
window.onload = init;
</script>
</head>
<body>
<br />
</body>
</html>

View file

@ -8,419 +8,419 @@
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.vml.Chart");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Chart");
dojo.require("dojo.math");
dojo.require("dojo.html");
//dojo.require("dojo.vml");
dojo.require("dojo.graphics.color");
dojo.widget.vml.Chart=function(){
dojo.widget.Chart.call(this);
dojo.widget.HtmlWidget.call(this);
};
dojo.inherits(dojo.widget.vml.Chart, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.vml.Chart, {
// widget props
templatePath:null,
templateCssPath:null,
// state
_isInitialized:false,
hasData:false,
// chart props
vectorNode:null,
plotArea:null,
dataGroup:null,
axisGroup:null,
properties:{
height:400, // defaults, will resize to the domNode.
width:600,
plotType:null,
padding:{
top:10,
bottom:2,
left:60,
right:30
},
axes:{
x:{
plotAt:0,
label:"",
unitLabel:"",
unitType:Number,
nUnitsToShow:10,
range:{
min:0,
max:200
}
},
y:{
plotAt:0,
label:"",
unitLabel:"",
unitType:Number,
nUnitsToShow:10,
range:{
min:0,
max:200
}
}
}
},
fillInTemplate:function(args,frag){
this.initialize();
this.render();
},
parseData:function(){
},
initialize:function(){
// parse the data first.
this.parseData();
// render the body of the chart, not the chart data.
if(this.vectorNode){ this.destroy(); }
this.vectorNode=document.createElement("div");
this.vectorNode.style.width=this.properties.width+"px";
this.vectorNode.style.height=this.properties.height+"px";
this.vectorNode.style.position="relative";
this.domNode.appendChild(this.vectorNode);
var plotWidth=this.properties.width-this.properties.padding.left-this.properties.padding.right;
var plotHeight=this.properties.height-this.properties.padding.top-this.properties.padding.bottom;
this.plotArea=document.createElement("div");
this.plotArea.style.position="absolute";
this.plotArea.style.backgroundColor="#fff";
this.plotArea.style.top=(this.properties.padding.top)-2+"px";
this.plotArea.style.left=(this.properties.padding.left-1)+"px";
this.plotArea.style.width=plotWidth+"px";
this.plotArea.style.height=plotHeight+"px";
this.vectorNode.appendChild(this.plotArea);
this.dataGroup=document.createElement("div");
this.dataGroup.style.position="relative";
this.plotArea.appendChild(this.dataGroup);
// clipping rects, what a fucking pain.
var bg=this.domNode.style.backgroundColor;
var r=document.createElement("v:rect");
r.setAttribute("fillcolor", bg);
r.setAttribute("stroked", "false");
r.style.position="absolute";
r.style.top=(-1*this.properties.padding.top)-1+"px";
r.style.left=(-1*this.properties.padding.left)+"px";
r.style.width=(this.properties.width-3)+"px";
r.style.height=(this.properties.padding.top)-2+"px";
this.vectorNode.appendChild(r);
r=document.createElement("v:rect");
r.setAttribute("fillcolor", bg);
r.setAttribute("stroked", "false");
r.style.position="absolute";
r.style.top=plotHeight-2+"px";
r.style.left=(-1*this.properties.padding.left)+"px";
r.style.width=(this.properties.width-3)+"px";
r.style.height=(this.properties.padding.bottom)-2+"px"; // fixme: check this.
this.vectorNode.appendChild(r);
r=document.createElement("v:rect");
r.setAttribute("fillcolor", bg);
r.setAttribute("stroked", "false");
r.style.position="absolute";
r.style.top="-2px";
r.style.left=(-1*this.properties.padding.left)+"px";
r.style.width=(this.properties.padding.left-1)+"px";
r.style.height=plotHeight+"px";
this.vectorNode.appendChild(r);
r=document.createElement("v:rect");
r.setAttribute("fillcolor", bg);
r.setAttribute("stroked", "false");
r.style.position="absolute";
r.style.top="-2px";
r.style.right=(-1*this.properties.padding.right)+1+"px";
r.style.width=(this.properties.padding.right-1)+"px";
r.style.height=plotHeight+"px";
this.vectorNode.appendChild(r);
// end clipping rects. god that sucks, i wish VML had clipping outside of that crap vmlframe...
this.axisGroup=document.createElement("div");
this.axisGroup.style.position="relative";
this.plotArea.appendChild(this.axisGroup);
var stroke=1;
// x axis
var line=document.createElement("v:line");
var y=dojo.widget.vml.Chart.Plotter.getY(this.properties.axes.x.plotAt, this);
line.setAttribute("from", this.properties.padding.left-stroke + "," + y);
line.setAttribute("to", plotWidth + "," + y);
line.style.position="absolute";
line.style.antialias="false";
line.setAttribute("strokecolor", "#666");
line.setAttribute("strokeweight", stroke*2+"px");
this.axisGroup.appendChild(line);
// y axis
var line=document.createElement("v:line");
var y=dojo.widget.vml.Chart.Plotter.getX(this.properties.axes.y.plotAt, this);
line.setAttribute("from", y+","+this.properties.padding.top);
line.setAttribute("to", y+","+this.properties.height-this.properties.padding.bottom);
line.style.position="absolute";
line.style.antialias="false";
line.setAttribute("strokecolor", "#666");
line.setAttribute("strokeweight", stroke*2+"px");
this.axisGroup.appendChild(line);
// labels
var size=10;
// x axis labels.
var t=document.createElement("div");
t.style.position="absolute";
t.style.top=(this.properties.height-this.properties.padding.bottom+size+2)+"px";
t.style.left=this.properties.padding.left+"px";
t.style.fontFamily="sans-serif";
t.style.fontSize=size+"px";
t.innerHTML=dojo.math.round(parseFloat(this.properties.axes.x.range.min),2);
this.axisGroup.appendChild(t);
t=document.createElement("div");
t.style.position="absolute";
t.style.top=(this.properties.height-this.properties.padding.bottom+size+2)+"px";
t.style.left=(this.properties.width-this.properties.padding.right-(size/2))+"px";
t.style.fontFamily="sans-serif";
t.style.fontSize=size+"px";
t.innerHTML=dojo.math.round(parseFloat(this.properties.axes.x.range.max),2);
this.axisGroup.appendChild(t);
// y axis labels.
t=document.createElement("div");
t.style.position="absolute";
t.style.top=-1*(size/2)+"px";
t.style.right=(plotWidth+4)+"px";
t.style.fontFamily="sans-serif";
t.style.fontSize=size+"px";
t.innerHTML=dojo.math.round(parseFloat(this.properties.axes.y.range.max),2);
this.axisGroup.appendChild(t);
t=document.createElement("div");
t.style.position="absolute";
t.style.top=(this.properties.height-this.properties.padding.bottom)+"px";
t.style.right=(plotWidth+4)+"px";
t.style.fontFamily="sans-serif";
t.style.fontSize=size+"px";
t.innerHTML=dojo.math.round(parseFloat(this.properties.axes.y.range.min),2);
this.axisGroup.appendChild(t);
// this is last.
this.assignColors();
this._isInitialized=true;
},
destroy:function(){
while(this.domNode.childNodes.length>0){
this.domNode.removeChild(this.domNode.childNodes[0]);
}
this.vectorNode=this.plotArea=this.dataGroup=this.axisGroup=null;
},
render:function(){
if (this.dataGroup){
while(this.dataGroup.childNodes.length>0){
this.dataGroup.removeChild(this.dataGroup.childNodes[0]);
}
} else {
this.initialize();
}
for(var i=0; i<this.series.length; i++){
dojo.widget.vml.Chart.Plotter.plot(this.series[i], this);
}
}
});
dojo.widget.vml.Chart.Plotter=new function(){
var _this=this;
var plotters = {};
var types=dojo.widget.Chart.PlotTypes;
this.getX=function(value, chart){
var v=parseFloat(value);
var min=chart.properties.axes.x.range.min;
var max=chart.properties.axes.x.range.max;
var ofst=0-min;
min+=ofst; max+=ofst; v+=ofst;
var xmin=chart.properties.padding.left;
var xmax=chart.properties.width-chart.properties.padding.right;
var x=(v*((xmax-xmin)/max))+xmin;
return x;
};
this.getY=function(value, chart){
var v=parseFloat(value);
var max=chart.properties.axes.y.range.max;
var min=chart.properties.axes.y.range.min;
var ofst=0;
if(min<0)ofst+=Math.abs(min);
min+=ofst; max+=ofst; v+=ofst;
var ymin=chart.properties.height-chart.properties.padding.bottom;
var ymax=chart.properties.padding.top;
var y=(((ymin-ymax)/(max-min))*(max-v))+ymax;
return y;
};
this.addPlotter=function(name, func){
plotters[name]=func;
};
this.plot=function(series, chart){
if (series.values.length==0) return;
if (series.plotType && plotters[series.plotType]){
return plotters[series.plotType](series, chart);
}
else if (chart.plotType && plotters[chart.plotType]){
return plotters[chart.plotType](series, chart);
}
};
// plotting
plotters[types.Bar]=function(series, chart){
var space=1;
var lastW = 0;
for (var i=0; i<series.values.length; i++){
var x=_this.getX(series.values[i].x, chart);
var w;
if (i==series.values.length-1){
w=lastW;
} else{
w=_this.getX(series.values[i+1].x, chart)-x-space;
lastW=w;
}
x-=(w/2);
var yA=_this.getY(chart.properties.axes.x.plotAt, chart);
var y=_this.getY(series.values[i].value, chart);
var h=Math.abs(yA-y);
if (parseFloat(series.values[i].value)<chart.properties.axes.x.plotAt){
var oy=yA;
yA=y;
y=oy;
}
var bar=document.createElement("v:rect");
bar.style.position="absolute";
bar.style.top=x+"px";
bar.style.left=y+"px";
bar.style.width=w+"px";
bar.style.height=h+"px";
bar.setAttribute("fillColor", series.color);
bar.setAttribute("title", series.label + ": " + series.values[i].value);
bar.setAttribute("coordsize", chart.properties.width + "," + chart.properties.height);
var fill=document.createElement("v:fill");
fill.setAttribute("opacity", "0.9");
bar.appendChild(fill);
chart.dataGroup.appendChild(bar);
}
};
plotters[types.Line]=function(series, chart){
var tension=3;
var line=document.createElement("v:shape");
line.setAttribute("strokeweight", "2px");
line.setAttribute("strokecolor", series.color);
line.setAttribute("fillcolor", "none");
line.setAttribute("filled", "false");
line.setAttribute("title", series.label);
line.setAttribute("coordsize", chart.properties.width + "," + chart.properties.height);
line.style.position="absolute";
line.style.top="0px";
line.style.left="0px";
line.style.width= chart.properties.width+"px";
line.style.height=chart.properties.height+"px";
var stroke=document.createElement("v:stroke");
stroke.setAttribute("opacity", "0.85");
line.appendChild(stroke);
var path = [];
for (var i=0; i<series.values.length; i++){
var x = _this.getX(series.values[i].x, chart)
var y = _this.getY(series.values[i].value, chart);
if (i==0){
path.push("m");
path.push(x+","+y);
}else{
var lastx=_this.getX(series.values[i-1].x, chart);
var lasty=_this.getY(series.values[i-1].value, chart);
var dx=x-lastx;
path.push("v");
var cx=x-(tension-1)*(dx/tension);
path.push(cx+",0");
cx=x-(dx/tension);
path.push(cx+","+y-lasty);
path.push(dx, y-lasty);
}
}
line.setAttribute("path", path.join(" ")+" e");
chart.dataGroup.appendChild(line);
};
plotters[types.Scatter]=function(series, chart){
var r=8;
for (var i=0; i<series.values.length; i++){
var x=_this.getX(series.values[i].x, chart);
var y=_this.getY(series.values[i].value, chart);
var mod=r/2;
var point=document.createElement("v:rect");
point.setAttribute("fillcolor", series.color);
point.setAttribute("strokecolor", series.color);
point.setAttribute("title", series.label + ": " + series.values[i].value);
point.style.position="absolute";
point.style.rotation="45";
point.style.top=(y-mod)+"px";
point.style.left=(x-mod)+"px";
point.style.width=r+"px";
point.style.height=r+"px";
var fill=document.createElement("v:fill");
fill.setAttribute("opacity", "0.5");
point.appendChild(fill);
chart.dataGroup.appendChild(point);
}
};
plotters[types.Bubble]=function(series, chart){
// added param for series[n].value: size
var minR=1;
// do this off the x axis?
var min=chart.properties.axes.x.range.min;
var max=chart.properties.axes.x.range.max;
var ofst=0-min;
min+=ofst; max+=ofst;
var xmin=chart.properties.padding.left;
var xmax=chart.properties.width-chart.properties.padding.right;
var factor=(max-min)/(xmax-xmin)*25;
for (var i=0; i<series.values.length; i++){
var size = series.values[i].size;
if (isNaN(parseFloat(size))) size=minR;
var mod=(parseFloat(size)*factor)/2;
var point=document.createElement("v:oval");
point.setAttribute("strokecolor", series.color);
point.setAttribute("fillcolor", series.color);
point.setAttribute("title", series.label + ": " + series.values[i].value + " (" + size + ")");
point.style.position="absolute";
point.style.top=(_this.getY(series.values[i].value, chart)-mod) + "px";
point.style.left=(_this.getX(series.values[i].x, chart)-mod) + "px";
point.style.width=mod+"px";
point.style.height=mod+"px";
chart.dataGroup.appendChild(point);
}
};
}();
dojo.provide("dojo.widget.vml.Chart");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Chart");
dojo.require("dojo.math");
dojo.require("dojo.html");
//dojo.require("dojo.vml");
dojo.require("dojo.graphics.color");
dojo.widget.vml.Chart=function(){
dojo.widget.Chart.call(this);
dojo.widget.HtmlWidget.call(this);
};
dojo.inherits(dojo.widget.vml.Chart, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.vml.Chart, {
// widget props
templatePath:null,
templateCssPath:null,
// state
_isInitialized:false,
hasData:false,
// chart props
vectorNode:null,
plotArea:null,
dataGroup:null,
axisGroup:null,
properties:{
height:400, // defaults, will resize to the domNode.
width:600,
plotType:null,
padding:{
top:10,
bottom:2,
left:60,
right:30
},
axes:{
x:{
plotAt:0,
label:"",
unitLabel:"",
unitType:Number,
nUnitsToShow:10,
range:{
min:0,
max:200
}
},
y:{
plotAt:0,
label:"",
unitLabel:"",
unitType:Number,
nUnitsToShow:10,
range:{
min:0,
max:200
}
}
}
},
fillInTemplate:function(args,frag){
this.initialize();
this.render();
},
parseData:function(){
},
initialize:function(){
// parse the data first.
this.parseData();
// render the body of the chart, not the chart data.
if(this.vectorNode){ this.destroy(); }
this.vectorNode=document.createElement("div");
this.vectorNode.style.width=this.properties.width+"px";
this.vectorNode.style.height=this.properties.height+"px";
this.vectorNode.style.position="relative";
this.domNode.appendChild(this.vectorNode);
var plotWidth=this.properties.width-this.properties.padding.left-this.properties.padding.right;
var plotHeight=this.properties.height-this.properties.padding.top-this.properties.padding.bottom;
this.plotArea=document.createElement("div");
this.plotArea.style.position="absolute";
this.plotArea.style.backgroundColor="#fff";
this.plotArea.style.top=(this.properties.padding.top)-2+"px";
this.plotArea.style.left=(this.properties.padding.left-1)+"px";
this.plotArea.style.width=plotWidth+"px";
this.plotArea.style.height=plotHeight+"px";
this.vectorNode.appendChild(this.plotArea);
this.dataGroup=document.createElement("div");
this.dataGroup.style.position="relative";
this.plotArea.appendChild(this.dataGroup);
// clipping rects, what a fucking pain.
var bg=this.domNode.style.backgroundColor;
var r=document.createElement("v:rect");
r.setAttribute("fillcolor", bg);
r.setAttribute("stroked", "false");
r.style.position="absolute";
r.style.top=(-1*this.properties.padding.top)-1+"px";
r.style.left=(-1*this.properties.padding.left)+"px";
r.style.width=(this.properties.width-3)+"px";
r.style.height=(this.properties.padding.top)-2+"px";
this.vectorNode.appendChild(r);
r=document.createElement("v:rect");
r.setAttribute("fillcolor", bg);
r.setAttribute("stroked", "false");
r.style.position="absolute";
r.style.top=plotHeight-2+"px";
r.style.left=(-1*this.properties.padding.left)+"px";
r.style.width=(this.properties.width-3)+"px";
r.style.height=(this.properties.padding.bottom)-2+"px"; // fixme: check this.
this.vectorNode.appendChild(r);
r=document.createElement("v:rect");
r.setAttribute("fillcolor", bg);
r.setAttribute("stroked", "false");
r.style.position="absolute";
r.style.top="-2px";
r.style.left=(-1*this.properties.padding.left)+"px";
r.style.width=(this.properties.padding.left-1)+"px";
r.style.height=plotHeight+"px";
this.vectorNode.appendChild(r);
r=document.createElement("v:rect");
r.setAttribute("fillcolor", bg);
r.setAttribute("stroked", "false");
r.style.position="absolute";
r.style.top="-2px";
r.style.right=(-1*this.properties.padding.right)+1+"px";
r.style.width=(this.properties.padding.right-1)+"px";
r.style.height=plotHeight+"px";
this.vectorNode.appendChild(r);
// end clipping rects. god that sucks, i wish VML had clipping outside of that crap vmlframe...
this.axisGroup=document.createElement("div");
this.axisGroup.style.position="relative";
this.plotArea.appendChild(this.axisGroup);
var stroke=1;
// x axis
var line=document.createElement("v:line");
var y=dojo.widget.vml.Chart.Plotter.getY(this.properties.axes.x.plotAt, this);
line.setAttribute("from", this.properties.padding.left-stroke + "," + y);
line.setAttribute("to", plotWidth + "," + y);
line.style.position="absolute";
line.style.antialias="false";
line.setAttribute("strokecolor", "#666");
line.setAttribute("strokeweight", stroke*2+"px");
this.axisGroup.appendChild(line);
// y axis
var line=document.createElement("v:line");
var y=dojo.widget.vml.Chart.Plotter.getX(this.properties.axes.y.plotAt, this);
line.setAttribute("from", y+","+this.properties.padding.top);
line.setAttribute("to", y+","+this.properties.height-this.properties.padding.bottom);
line.style.position="absolute";
line.style.antialias="false";
line.setAttribute("strokecolor", "#666");
line.setAttribute("strokeweight", stroke*2+"px");
this.axisGroup.appendChild(line);
// labels
var size=10;
// x axis labels.
var t=document.createElement("div");
t.style.position="absolute";
t.style.top=(this.properties.height-this.properties.padding.bottom+size+2)+"px";
t.style.left=this.properties.padding.left+"px";
t.style.fontFamily="sans-serif";
t.style.fontSize=size+"px";
t.innerHTML=dojo.math.round(parseFloat(this.properties.axes.x.range.min),2);
this.axisGroup.appendChild(t);
t=document.createElement("div");
t.style.position="absolute";
t.style.top=(this.properties.height-this.properties.padding.bottom+size+2)+"px";
t.style.left=(this.properties.width-this.properties.padding.right-(size/2))+"px";
t.style.fontFamily="sans-serif";
t.style.fontSize=size+"px";
t.innerHTML=dojo.math.round(parseFloat(this.properties.axes.x.range.max),2);
this.axisGroup.appendChild(t);
// y axis labels.
t=document.createElement("div");
t.style.position="absolute";
t.style.top=-1*(size/2)+"px";
t.style.right=(plotWidth+4)+"px";
t.style.fontFamily="sans-serif";
t.style.fontSize=size+"px";
t.innerHTML=dojo.math.round(parseFloat(this.properties.axes.y.range.max),2);
this.axisGroup.appendChild(t);
t=document.createElement("div");
t.style.position="absolute";
t.style.top=(this.properties.height-this.properties.padding.bottom)+"px";
t.style.right=(plotWidth+4)+"px";
t.style.fontFamily="sans-serif";
t.style.fontSize=size+"px";
t.innerHTML=dojo.math.round(parseFloat(this.properties.axes.y.range.min),2);
this.axisGroup.appendChild(t);
// this is last.
this.assignColors();
this._isInitialized=true;
},
destroy:function(){
while(this.domNode.childNodes.length>0){
this.domNode.removeChild(this.domNode.childNodes[0]);
}
this.vectorNode=this.plotArea=this.dataGroup=this.axisGroup=null;
},
render:function(){
if (this.dataGroup){
while(this.dataGroup.childNodes.length>0){
this.dataGroup.removeChild(this.dataGroup.childNodes[0]);
}
} else {
this.initialize();
}
for(var i=0; i<this.series.length; i++){
dojo.widget.vml.Chart.Plotter.plot(this.series[i], this);
}
}
});
dojo.widget.vml.Chart.Plotter=new function(){
var _this=this;
var plotters = {};
var types=dojo.widget.Chart.PlotTypes;
this.getX=function(value, chart){
var v=parseFloat(value);
var min=chart.properties.axes.x.range.min;
var max=chart.properties.axes.x.range.max;
var ofst=0-min;
min+=ofst; max+=ofst; v+=ofst;
var xmin=chart.properties.padding.left;
var xmax=chart.properties.width-chart.properties.padding.right;
var x=(v*((xmax-xmin)/max))+xmin;
return x;
};
this.getY=function(value, chart){
var v=parseFloat(value);
var max=chart.properties.axes.y.range.max;
var min=chart.properties.axes.y.range.min;
var ofst=0;
if(min<0)ofst+=Math.abs(min);
min+=ofst; max+=ofst; v+=ofst;
var ymin=chart.properties.height-chart.properties.padding.bottom;
var ymax=chart.properties.padding.top;
var y=(((ymin-ymax)/(max-min))*(max-v))+ymax;
return y;
};
this.addPlotter=function(name, func){
plotters[name]=func;
};
this.plot=function(series, chart){
if (series.values.length==0) return;
if (series.plotType && plotters[series.plotType]){
return plotters[series.plotType](series, chart);
}
else if (chart.plotType && plotters[chart.plotType]){
return plotters[chart.plotType](series, chart);
}
};
// plotting
plotters[types.Bar]=function(series, chart){
var space=1;
var lastW = 0;
for (var i=0; i<series.values.length; i++){
var x=_this.getX(series.values[i].x, chart);
var w;
if (i==series.values.length-1){
w=lastW;
} else{
w=_this.getX(series.values[i+1].x, chart)-x-space;
lastW=w;
}
x-=(w/2);
var yA=_this.getY(chart.properties.axes.x.plotAt, chart);
var y=_this.getY(series.values[i].value, chart);
var h=Math.abs(yA-y);
if (parseFloat(series.values[i].value)<chart.properties.axes.x.plotAt){
var oy=yA;
yA=y;
y=oy;
}
var bar=document.createElement("v:rect");
bar.style.position="absolute";
bar.style.top=x+"px";
bar.style.left=y+"px";
bar.style.width=w+"px";
bar.style.height=h+"px";
bar.setAttribute("fillColor", series.color);
bar.setAttribute("title", series.label + ": " + series.values[i].value);
bar.setAttribute("coordsize", chart.properties.width + "," + chart.properties.height);
var fill=document.createElement("v:fill");
fill.setAttribute("opacity", "0.9");
bar.appendChild(fill);
chart.dataGroup.appendChild(bar);
}
};
plotters[types.Line]=function(series, chart){
var tension=3;
var line=document.createElement("v:shape");
line.setAttribute("strokeweight", "2px");
line.setAttribute("strokecolor", series.color);
line.setAttribute("fillcolor", "none");
line.setAttribute("filled", "false");
line.setAttribute("title", series.label);
line.setAttribute("coordsize", chart.properties.width + "," + chart.properties.height);
line.style.position="absolute";
line.style.top="0px";
line.style.left="0px";
line.style.width= chart.properties.width+"px";
line.style.height=chart.properties.height+"px";
var stroke=document.createElement("v:stroke");
stroke.setAttribute("opacity", "0.85");
line.appendChild(stroke);
var path = [];
for (var i=0; i<series.values.length; i++){
var x = _this.getX(series.values[i].x, chart)
var y = _this.getY(series.values[i].value, chart);
if (i==0){
path.push("m");
path.push(x+","+y);
}else{
var lastx=_this.getX(series.values[i-1].x, chart);
var lasty=_this.getY(series.values[i-1].value, chart);
var dx=x-lastx;
path.push("v");
var cx=x-(tension-1)*(dx/tension);
path.push(cx+",0");
cx=x-(dx/tension);
path.push(cx+","+y-lasty);
path.push(dx, y-lasty);
}
}
line.setAttribute("path", path.join(" ")+" e");
chart.dataGroup.appendChild(line);
};
plotters[types.Scatter]=function(series, chart){
var r=8;
for (var i=0; i<series.values.length; i++){
var x=_this.getX(series.values[i].x, chart);
var y=_this.getY(series.values[i].value, chart);
var mod=r/2;
var point=document.createElement("v:rect");
point.setAttribute("fillcolor", series.color);
point.setAttribute("strokecolor", series.color);
point.setAttribute("title", series.label + ": " + series.values[i].value);
point.style.position="absolute";
point.style.rotation="45";
point.style.top=(y-mod)+"px";
point.style.left=(x-mod)+"px";
point.style.width=r+"px";
point.style.height=r+"px";
var fill=document.createElement("v:fill");
fill.setAttribute("opacity", "0.5");
point.appendChild(fill);
chart.dataGroup.appendChild(point);
}
};
plotters[types.Bubble]=function(series, chart){
// added param for series[n].value: size
var minR=1;
// do this off the x axis?
var min=chart.properties.axes.x.range.min;
var max=chart.properties.axes.x.range.max;
var ofst=0-min;
min+=ofst; max+=ofst;
var xmin=chart.properties.padding.left;
var xmax=chart.properties.width-chart.properties.padding.right;
var factor=(max-min)/(xmax-xmin)*25;
for (var i=0; i<series.values.length; i++){
var size = series.values[i].size;
if (isNaN(parseFloat(size))) size=minR;
var mod=(parseFloat(size)*factor)/2;
var point=document.createElement("v:oval");
point.setAttribute("strokecolor", series.color);
point.setAttribute("fillcolor", series.color);
point.setAttribute("title", series.label + ": " + series.values[i].value + " (" + size + ")");
point.style.position="absolute";
point.style.top=(_this.getY(series.values[i].value, chart)-mod) + "px";
point.style.left=(_this.getX(series.values[i].x, chart)-mod) + "px";
point.style.width=mod+"px";
point.style.height=mod+"px";
chart.dataGroup.appendChild(point);
}
};
}();